OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 <cstddef>
20 #include <cstdint>
21 #include <cstdio>
22 
23 namespace omnisci {
24 
25 size_t file_size(const int fd);
26 
27 void* checked_mmap(const int fd, const size_t sz);
28 
29 void checked_munmap(void* addr, size_t length);
30 
31 int msync(void* addr, size_t length, bool async);
32 
33 int fsync(int fd);
34 
35 int open(const char* path, int flags, int mode);
36 
37 void close(const int fd);
38 
39 ::FILE* fopen(const char* filename, const char* mode);
40 
41 ::FILE* popen(const char* command, const char* type);
42 
43 int32_t pclose(::FILE* fh);
44 
45 int get_page_size();
46 
47 int32_t ftruncate(const int32_t fd, int64_t length);
48 } // namespace omnisci
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
::FILE * popen(const char *command, const char *type)
Definition: omnisci_fs.cpp:76
void close(const int fd)
Definition: omnisci_fs.cpp:68
future< Result > async(Fn &&fn, Args &&...args)
int32_t ftruncate(const int32_t fd, int64_t length)
Definition: omnisci_fs.cpp:84
int fsync(int fd)
Definition: omnisci_fs.cpp:60
int32_t pclose(::FILE *fh)
Definition: omnisci_fs.cpp:80
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