From d8366ed153fb375810ec78e90e52ece3c3363b6a Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sun, 6 Apr 2025 19:59:43 +0800 Subject: [PATCH] pipe2: support pipe2 on solaris and illumos Solaris implemented pipe2 in 11.4 and illumos have had it since 2013. Ref: https://docs.oracle.com/cd/E88353_01/html/E37841/pipe2-2.html https://illumos.org/man/2/pipe2 https://www.illumos.org/issues/3714 --- src/unix/pipe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/unix/pipe.c b/src/unix/pipe.c index 6bfe6cf2f..9512c20ca 100644 --- a/src/unix/pipe.c +++ b/src/unix/pipe.c @@ -496,7 +496,9 @@ int uv_pipe(uv_os_fd_t fds[2], int read_flags, int write_flags) { defined(__FreeBSD__) || \ defined(__OpenBSD__) || \ defined(__DragonFly__) || \ - defined(__NetBSD__) + defined(__NetBSD__) || \ + defined(__illumos__) || \ + (defined(UV__SOLARIS_11_4) && UV__SOLARIS_11_4) int flags = O_CLOEXEC; if ((read_flags & UV_NONBLOCK_PIPE) && (write_flags & UV_NONBLOCK_PIPE))