Add option-taking pipe() implementation for Windows

This commit is contained in:
Guillaume Lessard committed 2026-06-09 16:27:18 -07:00
1 parent ebbbc31709
commit e59002fa14
6 files changed
+30 -7

No files matched your search

+3
View File
@@ -7,5 +7,8 @@
See https://swift.org/LICENSE.txt for license information
*/
#if !defined(_WIN32)
extern int csystem_posix_pipe2(int fildes[2], int flag);
#endif
extern int csystem_posix_dup3(int fildes, int fildes2, int flag);
+4
View File
@@ -28,6 +28,8 @@
#endif
// Wrappers are required because _GNU_SOURCE causes a conflict with other imports when defined in CSystemLinux.h
#if !defined(_WIN32)
extern int csystem_posix_pipe2(int fildes[2], int flag) {
#ifdef HAVE_PIPE2_DUP3
return pipe2(fildes, flag);
@@ -36,6 +38,8 @@ extern int csystem_posix_pipe2(int fildes[2], int flag) {
return -1;
#endif
}
#endif // !defined(_WIN32)
extern int csystem_posix_dup3(int fildes, int fildes2, int flag) {
#ifdef HAVE_PIPE2_DUP3
return dup3(fildes, fildes2, flag);