/* */ #ifndef _D_A2IO_H_ #define _D_A2IO_H_ #include "common.h" #include #include #include #include #ifdef HAVE_IO_H # include #endif // HAVE_IO_H // in some platforms following definitions are missing: #ifndef EINPROGRESS # define EINPROGRESS (WSAEINPROGRESS) #endif // EINPROGRESS #ifndef O_NONBLOCK # define O_NONBLOCK (O_NDELAY) #endif // O_NONBLOCK #ifndef O_BINARY # define O_BINARY (0) #endif // O_BINARY // st_mode flags #ifndef S_IRUSR # define S_IRUSR 0000400 /* read permission, owner */ #endif /* S_IRUSR */ #ifndef S_IWUSR # define S_IWUSR 0000200 /* write permission, owner */ #endif /* S_IWUSR */ #ifndef S_IXUSR # define S_IXUSR 0000100/* execute/search permission, owner */ #endif /* S_IXUSR */ #ifndef S_IRWXU # define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) #endif /* S_IRWXU */ #ifndef S_IRGRP # define S_IRGRP 0000040 /* read permission, group */ #endif /* S_IRGRP */ #ifndef S_IWGRP # define S_IWGRP 0000020 /* write permission, grougroup */ #endif /* S_IWGRP */ #ifndef S_IXGRP # define S_IXGRP 0000010/* execute/search permission, group */ #endif /* S_IXGRP */ #ifndef S_IRWXG # define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) #endif /* S_IRWXG */ #ifndef S_IROTH # define S_IROTH 0000004 /* read permission, other */ #endif /* S_IROTH */ #ifndef S_IWOTH # define S_IWOTH 0000002 /* write permission, other */ #endif /* S_IWOTH */ #ifndef S_IXOTH # define S_IXOTH 0000001/* execute/search permission, other */ #endif /* S_IXOTH */ #ifndef S_IRWXO # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) #endif /* S_IRWXO */ // Use 'null' instead of /dev/null in win32. #ifdef HAVE_WINSOCK2_H # define DEV_NULL "nul" #else # define DEV_NULL "/dev/null" #endif // HAVE_WINSOCK2_H // Use 'con' instead of '/dev/stdout' in win32. #ifdef HAVE_WINSOCK2_H # define DEV_STDOUT "con" #else # define DEV_STDOUT "/dev/stdout" #endif // HAVE_WINSOCK2_H #ifdef __MINGW32__ # define lseek(a, b, c) _lseeki64((a), (b), (c)) # define a2mkdir(path, openMode) mkdir(path) #else # define a2mkdir(path, openMode) mkdir(path, openMode) #endif // __MINGW32__ #if defined HAVE_POSIX_MEMALIGN && defined O_DIRECT # define ENABLE_DIRECT_IO 1 #endif // HAVE_POSIX_MEMALIGN && O_DIRECT #define OPEN_MODE S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH #define DIR_OPEN_MODE S_IRWXU|S_IRWXG|S_IRWXO #if defined HAVE_EPOLL_CREATE && \ (defined HAVE_LIBCARES || !defined ENABLE_ASYNC_DNS) # define HAVE_EPOLL 1 #endif // HAVE_EPOLL_CREATE || (HAVE_LIBCARES || !ENABLE_ASYNC_DNS) #endif // _D_A2IO_H_