From b7b66845da26ef99063e7ea8539e559aab2da1e8 Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Wed, 10 Jun 2026 09:56:17 -0700 Subject: [PATCH] Update proposal with Windows change --- Proposals/0007-FileDescriptor-dup3-pipe2.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Proposals/0007-FileDescriptor-dup3-pipe2.md b/Proposals/0007-FileDescriptor-dup3-pipe2.md index 5e159de..a94d781 100644 --- a/Proposals/0007-FileDescriptor-dup3-pipe2.md +++ b/Proposals/0007-FileDescriptor-dup3-pipe2.md @@ -9,6 +9,8 @@ * **v1** Initial version +- **v2** Add Windows version of `pipe(options:)` + ## Introduction Swift System today provides `FileDescriptor.duplicate()`, `FileDescriptor.duplicate(as:)` and `FileDescriptor.pipe()` cover APIs for the POSIX `dup`, `dup2`, and `pipe` functions, respectively. @@ -165,7 +167,9 @@ struct FileDescriptor { } ``` -These API additions are unavailable on Windows and Darwin, as the underlying `dup3` and `pipe2` APIs do not exist. +These API additions are unavailable Darwin, as the underlying `dup3` and `pipe2` APIs do not exist. + +`pipe(options:)` is added for Windows with the option `.closeOnExec`, but `duplicate(as:options:)` is not added because the underlying API does not match `dup3`. `closeOnFork` is unavailable on Linux and Android, as the underlying `O_CLOFORK` constant does not exist.