include pipe2/socketpair compat for macOS

This commit is contained in:
Brent Cook
2017-01-15 04:30:41 -06:00
committed by Brent Cook
parent fa20dae329
commit dfb6b11e5a
6 changed files with 83 additions and 2 deletions

View File

@@ -8,3 +8,10 @@
#else
#include <win32netcompat.h>
#endif
#if !defined(SOCK_NONBLOCK) || !defined(SOCK_CLOEXEC)
#define SOCK_CLOEXEC 0x8000 /* set FD_CLOEXEC */
#define SOCK_NONBLOCK 0x4000 /* set O_NONBLOCK */
int bsd_socketpair(int domain, int type, int protocol, int socket_vector[2]);
#define socketpair(d,t,p,sv) bsd_socketpair(d,t,p,sv)
#endif

View File

@@ -40,4 +40,8 @@ int getentropy(void *buf, size_t buflen);
#define pledge(request, paths) 0
#ifndef HAVE_PIPE2
int pipe2(int fildes[2], int flags);
#endif
#endif