1 /*
2  * Public domain
3  * sys/socket.h compatibility shim
4  */
5 
6 #include_next <sys/socket.h>
7 
8 #if !defined(SOCK_CLOEXEC) || !defined(SOCK_NONBLOCK)
9 #define NEED_SOCKET_FLAGS
10 int _socket(int domain, int type, int protocol);
11 int _socketpair(int domain, int type, int protocol, int socket_vector[2]);
12 #ifndef IN_SOCKET_COMPAT
13 #define socket(d, t, p) _socket(d, t, p)
14 #define socketpair(d, t, p, s) _socketpair(d, t, p, s)
15 #endif
16 #endif
17 
18 #ifndef SOCK_NONBLOCK
19 #define SOCK_NONBLOCK  0x4000 /* set O_NONBLOCK */
20 #endif
21 
22 #ifndef SOCK_CLOEXEC
23 #define SOCK_CLOEXEC  0x8000 /* set FD_CLOEXEC */
24 #endif
25