Land #745, fix nc build on macOS

This commit is contained in:
Brent Cook 2022-04-19 15:03:51 -05:00
commit 5c7021517a
2 changed files with 2 additions and 2 deletions

View File

@ -6,8 +6,7 @@
#ifndef _WIN32 #ifndef _WIN32
#include_next <sys/socket.h> #include_next <sys/socket.h>
#if !defined(SOCK_NONBLOCK) || !defined(SOCK_CLOEXEC) #if defined(NEED_SOCKET_FLAGS)
#define NEED_SOCKET_FLAGS
int _socket(int domain, int type, int protocol); int _socket(int domain, int type, int protocol);
#ifndef SOCKET_FLAGS_PRIV #ifndef SOCKET_FLAGS_PRIV
#define socket(d, t, p) _socket(d, t, p) #define socket(d, t, p) _socket(d, t, p)

View File

@ -10,6 +10,7 @@
#endif #endif
#if !defined(SOCK_NONBLOCK) || !defined(SOCK_CLOEXEC) #if !defined(SOCK_NONBLOCK) || !defined(SOCK_CLOEXEC)
#define NEED_SOCKET_FLAGS
#define SOCK_CLOEXEC 0x8000 /* set FD_CLOEXEC */ #define SOCK_CLOEXEC 0x8000 /* set FD_CLOEXEC */
#define SOCK_NONBLOCK 0x4000 /* set O_NONBLOCK */ #define SOCK_NONBLOCK 0x4000 /* set O_NONBLOCK */
int bsd_socketpair(int domain, int type, int protocol, int socket_vector[2]); int bsd_socketpair(int domain, int type, int protocol, int socket_vector[2]);