about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRain <rain@sunshowers.io>2024-11-13 05:26:31 +0000
committerRain <rain@sunshowers.io>2024-11-13 05:48:06 +0000
commitfb3edb2fc7c0ff8ec51dbebc11a455b53767d236 (patch)
treec7186acdbe0e4bd0698ce6c90c439eda78319094
parent242f20dc1e95ca8def0ff436d7c844811ae7ac25 (diff)
downloadrust-fb3edb2fc7c0ff8ec51dbebc11a455b53767d236.tar.gz
rust-fb3edb2fc7c0ff8ec51dbebc11a455b53767d236.zip
[illumos] use pipe2 to create anonymous pipes
pipe2 allows the newly-created pipe to atomically be CLOEXEC.

pipe2 was added to illumos a long time ago:
https://github.com/illumos/illumos-gate/commit/5dbfd19ad5fcc2b779f40f80fa05c1bd28fd0b4e.
I've verified that this change passes all tests.
-rw-r--r--library/std/src/sys/pal/unix/pipe.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/std/src/sys/pal/unix/pipe.rs b/library/std/src/sys/pal/unix/pipe.rs
index f0ebc767bad..4a992e32a91 100644
--- a/library/std/src/sys/pal/unix/pipe.rs
+++ b/library/std/src/sys/pal/unix/pipe.rs
@@ -23,6 +23,7 @@ pub fn anon_pipe() -> io::Result<(AnonPipe, AnonPipe)> {
             target_os = "dragonfly",
             target_os = "freebsd",
             target_os = "hurd",
+            target_os = "illumos",
             target_os = "linux",
             target_os = "netbsd",
             target_os = "openbsd",