00001
00002
00003
00004
00005
00006
00007 #ifndef SYSCALLS_H
00008 #define SYSCALLS_H
00009
00010 #ifdef TARGET_OS_WINDOWS
00011 # ifdef TARGET_COMPILER_VC
00012 # include <direct.h>
00013 # endif
00014 # define WIN32_LEAN_AND_MEAN
00015 # include <windows.h>
00016 # define rename(foo,bar) !MoveFileEx(foo, bar, MOVEFILE_REPLACE_EXISTING)
00017 #endif
00018
00019 bool lock_file(int fd, bool write, bool wait = false);
00020 bool unlock_file(int fd);
00021
00022 bool read_urandom(char *buf, int len);
00023
00024 #ifdef TARGET_OS_WINDOWS
00025 # ifndef UNIX
00026 int fdatasync(int fd);
00027 # endif
00028 #endif
00029
00030
00031 #if !defined(TARGET_OS_LINUX) && !defined(TARGET_OS_WINDOWS) && !defined(TARGET_OS_NETBSD) && !defined(TARGET_OS_SOLARIS)
00032 # define NEED_FAKE_FDATASYNC
00033 int fdatasync(int fd);
00034 #endif
00035
00036 #endif