|
10 | 10 |
|
11 | 11 | #include <stdio.h> |
12 | 12 | #include <sys/stat.h> |
13 | | -#include <unistd.h> |
| 13 | +// #include <unistd.h> |
14 | 14 |
|
15 | 15 | #ifdef __cplusplus |
16 | 16 | extern "C" { |
@@ -41,36 +41,36 @@ typedef struct stat os_stat_t; |
41 | 41 | #define os_close close |
42 | 42 | #define os_fclose fclose |
43 | 43 |
|
44 | | -typedef off_t os_off_t; |
45 | | -int os_open(const char *pathname, int flags, ...); |
46 | | -int os_fsync(int fd); |
47 | | -int os_fsync_dir(const char *dir_name); |
48 | | -int os_stat(const char *pathname, os_stat_t *buf); |
49 | | -int os_unlink(const char *pathname); |
50 | | -int os_access(const char *pathname, int mode); |
51 | | -FILE *os_fopen(const char *pathname, const char *mode); |
52 | | -FILE *os_fdopen(int fd, const char *mode); |
53 | | -int os_chmod(const char *pathname, mode_t mode); |
54 | | -int os_mkstemp(char *temp); |
55 | | -int os_posix_fallocate(int fd, os_off_t offset, os_off_t len); |
56 | | -int os_ftruncate(int fd, os_off_t length); |
57 | | -int os_flock(int fd, int operation); |
58 | | -ssize_t os_writev(int fd, const struct iovec *iov, int iovcnt); |
59 | | -int os_clock_gettime(int id, struct timespec *ts); |
60 | | -unsigned os_rand_r(unsigned *seedp); |
61 | | -int os_unsetenv(const char *name); |
62 | | -int os_setenv(const char *name, const char *value, int overwrite); |
63 | | -char *os_getenv(const char *name); |
64 | | -const char *os_strsignal(int sig); |
65 | | -int os_execv(const char *path, char *const argv[]); |
| 44 | +// typedef off_t os_off_t; |
| 45 | +// int os_open(const char *pathname, int flags, ...); |
| 46 | +// int os_fsync(int fd); |
| 47 | +// int os_fsync_dir(const char *dir_name); |
| 48 | +// int os_stat(const char *pathname, os_stat_t *buf); |
| 49 | +// int os_unlink(const char *pathname); |
| 50 | +// int os_access(const char *pathname, int mode); |
| 51 | +// FILE *os_fopen(const char *pathname, const char *mode); |
| 52 | +// FILE *os_fdopen(int fd, const char *mode); |
| 53 | +// int os_chmod(const char *pathname, mode_t mode); |
| 54 | +// int os_mkstemp(char *temp); |
| 55 | +// int os_posix_fallocate(int fd, os_off_t offset, os_off_t len); |
| 56 | +// int os_ftruncate(int fd, os_off_t length); |
| 57 | +// int os_flock(int fd, int operation); |
| 58 | +// ssize_t os_writev(int fd, const struct iovec *iov, int iovcnt); |
| 59 | +// int os_clock_gettime(int id, struct timespec *ts); |
| 60 | +// unsigned os_rand_r(unsigned *seedp); |
| 61 | +// int os_unsetenv(const char *name); |
| 62 | +// int os_setenv(const char *name, const char *value, int overwrite); |
| 63 | +// char *os_getenv(const char *name); |
| 64 | +// const char *os_strsignal(int sig); |
| 65 | +// int os_execv(const char *path, char *const argv[]); |
66 | 66 |
|
67 | 67 | FILE *os_fopen(const char *filename, const char *mode) { |
68 | 68 | #ifdef _MSC_VER |
69 | 69 | FILE *file; |
70 | 70 | if (0 == fopen_s(&file, filename, mode)) { |
71 | 71 | return file; |
72 | 72 | } else { |
73 | | - return UBENCH_NULL; |
| 73 | + return NULL; |
74 | 74 | } |
75 | 75 | #else |
76 | 76 | return fopen(filename, mode); |
|
0 commit comments