swift-system icon indicating copy to clipboard operation
swift-system copied to clipboard

Add variants of `pipe()`, and `duplicate()` that wrap `pipe2` and `dup3`

Open jakepetroules opened this issue 8 months ago • 1 comments

pipe2() and dup3() were standardized by POSIX 2024 and are already supported on most platforms (Linux, BSD) outside of macOS.

We should add new overloads of the Swift System functions which accept the flags (like O_CLOEXEC). For Apple platforms, which don't support these calls, we could compile them out for now, throw an error, or add unavailable annotations.

jakepetroules avatar Apr 27 '25 00:04 jakepetroules

Jake's forum pitch and thread: https://forums.swift.org/t/pitch-swiftsystem-dup3-and-pipe2-cover-apis/

glessard avatar Nov 19 '25 21:11 glessard