bsd: support pipe2() on *BSD (#4412)
--------- Signed-off-by: Andy Pan <i@andypan.me>
This commit is contained in:
parent
ab3ecf6565
commit
c8d4a87f49
@ -487,7 +487,11 @@ int uv_pipe_chmod(uv_pipe_t* handle, int mode) {
|
|||||||
int uv_pipe(uv_os_fd_t fds[2], int read_flags, int write_flags) {
|
int uv_pipe(uv_os_fd_t fds[2], int read_flags, int write_flags) {
|
||||||
uv_os_fd_t temp[2];
|
uv_os_fd_t temp[2];
|
||||||
int err;
|
int err;
|
||||||
#if defined(__FreeBSD__) || defined(__linux__)
|
#if defined(__linux__) || \
|
||||||
|
defined(__FreeBSD__) || \
|
||||||
|
defined(__OpenBSD__) || \
|
||||||
|
defined(__DragonFly__) || \
|
||||||
|
defined(__NetBSD__)
|
||||||
int flags = O_CLOEXEC;
|
int flags = O_CLOEXEC;
|
||||||
|
|
||||||
if ((read_flags & UV_NONBLOCK_PIPE) && (write_flags & UV_NONBLOCK_PIPE))
|
if ((read_flags & UV_NONBLOCK_PIPE) && (write_flags & UV_NONBLOCK_PIPE))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user