mirror of
https://github.com/apple/swift-system
synced 2026-11-25 04:47:55 +00:00
Add option-taking pipe() implementation for Windows
This commit is contained in:
1 parent
ebbbc31709
commit
e59002fa14
6 files changed
+30
-7
No files matched your search
@@ -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);
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user