4 * BSD socket emulation code for Winsock2
5 * Brent Cook <bcook@openbsd.org>
8 #ifndef _COMPAT_POSIX_WIN_H
9 #define _COMPAT_POSIX_WIN_H
23 #include <../ucrt/fcntl.h>
25 #include <../include/fcntl.h>
30 int posix_open(const char *path, ...);
32 int posix_close(int fd);
34 ssize_t posix_read(int fd, void *buf, size_t count);
36 ssize_t posix_write(int fd, const void *buf, size_t count);
38 #ifndef NO_REDEF_POSIX_FUNCTIONS
39 #define open(path, ...) posix_open(path, __VA_ARGS__)
40 #define close(fd) posix_close(fd)
41 #define read(fd, buf, count) posix_read(fd, buf, count)
42 #define write(fd, buf, count) posix_write(fd, buf, count)
47 #endif /* !_COMPAT_POSIX_WIN_H */