OmniSciDB  0264ff685a
omnisci_fs.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020 OmniSci, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <stddef.h>
20 #include <stdio.h>
21 
22 namespace omnisci {
23 
24 size_t file_size(const int fd);
25 
26 void* checked_mmap(const int fd, const size_t sz);
27 
28 void checked_munmap(void* addr, size_t length);
29 
30 int msync(void* addr, size_t length, bool async);
31 
32 int fsync(int fd);
33 
34 int open(const char* path, int flags, int mode);
35 
36 void close(const int fd);
37 
38 ::FILE* fopen(const char* filename, const char* mode);
39 
40 int get_page_size();
41 
42 } // namespace omnisci
std::string filename(char const *path)
Definition: Logger.cpp:62
int open(const char *path, int flags, int mode)
Definition: omnisci_fs.cpp:64
void * checked_mmap(const int fd, const size_t sz)
Definition: omnisci_fs.cpp:38
::FILE * fopen(const char *filename, const char *mode)
Definition: omnisci_fs.cpp:72
void close(const int fd)
Definition: omnisci_fs.cpp:68
int fsync(int fd)
Definition: omnisci_fs.cpp:60
int msync(void *addr, size_t length, bool async)
Definition: omnisci_fs.cpp:55
void checked_munmap(void *addr, size_t length)
Definition: omnisci_fs.cpp:51
int get_page_size()
Definition: omnisci_fs.cpp:27
size_t file_size(const int fd)
Definition: omnisci_fs.cpp:31