| ... | @@ -2155,6 +2155,10 @@ pub const libc = struct { | ... | @@ -2155,6 +2155,10 @@ pub const libc = struct { |
| 2155 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pause.html | 2155 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pause.html |
| 2156 | pub extern fn pause() c_int; | 2156 | pub extern fn pause() c_int; |
| 2157 | | 2157 | |
| | 2158 | /// int pipe2(int fildes[2], int flag); |
| | 2159 | /// https://pubs.opengroup.org/onlinepubs/9799919799/functions/pipe.html |
| | 2160 | pub extern fn pipe2(pipefd: *[2]c_int, flag: c_int) c_int; |
| | 2161 | |
| 2158 | /// double pow(double x, double y); | 2162 | /// double pow(double x, double y); |
| 2159 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pow.html | 2163 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pow.html |
| 2160 | pub extern fn pow(x: f64, y: f64) f64; | 2164 | pub extern fn pow(x: f64, y: f64) f64; |
| ... | @@ -3537,3 +3541,10 @@ pub fn pthread_rwlock_unlock(rwlock: *pthread_rwlock_t) !void { | ... | @@ -3537,3 +3541,10 @@ pub fn pthread_rwlock_unlock(rwlock: *pthread_rwlock_t) !void { |
| 3537 | const rc = libc.pthread_rwlock_unlock(rwlock); | 3541 | const rc = libc.pthread_rwlock_unlock(rwlock); |
| 3538 | if (rc != 0) return errno.fromInt(rc); | 3542 | if (rc != 0) return errno.fromInt(rc); |
| 3539 | } | 3543 | } |
| | 3544 | pub fn pipe2(flag: c_int) ![2]c_int { |
| | 3545 | var fildes: [2]c_int = @splat(-1); |
| | 3546 | const rc = libc.pipe2(&fildes, flag); |
| | 3547 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| | 3548 | std.debug.assert(rc == 0); |
| | 3549 | return fildes; |
| | 3550 | } |