| ... | @@ -2266,6 +2266,34 @@ pub const libc = struct { | ... | @@ -2266,6 +2266,34 @@ pub const libc = struct { |
| 2266 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_mutexattr_init.html | 2266 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_mutexattr_init.html |
| 2267 | pub extern fn pthread_mutexattr_init(attr: *pthread_mutexattr_t) c_int; | 2267 | pub extern fn pthread_mutexattr_init(attr: *pthread_mutexattr_t) c_int; |
| 2268 | | 2268 | |
| | 2269 | /// int pthread_rwlock_destroy(pthread_rwlock_t *rwlock); |
| | 2270 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_destroy.html |
| | 2271 | pub extern fn pthread_rwlock_destroy(rwlock: *pthread_rwlock_t) c_int; |
| | 2272 | |
| | 2273 | /// int pthread_rwlock_init(pthread_rwlock_t *restrict rwlock, const pthread_rwlockattr_t *restrict attr); |
| | 2274 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_init.html |
| | 2275 | pub extern fn pthread_rwlock_init(noalias rwlock: *pthread_rwlock_t, noalias attr: ?*const pthread_rwlockattr_t) c_int; |
| | 2276 | |
| | 2277 | /// int pthread_rwlock_rdlock(pthread_rwlock_t *rwlock); |
| | 2278 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_rdlock.html |
| | 2279 | pub extern fn pthread_rwlock_rdlock(rwlock: *pthread_rwlock_t) c_int; |
| | 2280 | |
| | 2281 | /// int pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock); |
| | 2282 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_tryrdlock.html |
| | 2283 | pub extern fn pthread_rwlock_tryrdlock(rwlock: *pthread_rwlock_t) c_int; |
| | 2284 | |
| | 2285 | /// int pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock); |
| | 2286 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_trywrlock.html |
| | 2287 | pub extern fn pthread_rwlock_trywrlock(rwlock: *pthread_rwlock_t) c_int; |
| | 2288 | |
| | 2289 | /// int pthread_rwlock_unlock(pthread_rwlock_t *rwlock); |
| | 2290 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_unlock.html |
| | 2291 | pub extern fn pthread_rwlock_unlock(rwlock: *pthread_rwlock_t) c_int; |
| | 2292 | |
| | 2293 | /// int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock); |
| | 2294 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_wrlock.html |
| | 2295 | pub extern fn pthread_rwlock_wrlock(rwlock: *pthread_rwlock_t) c_int; |
| | 2296 | |
| 2269 | /// pthread_t pthread_self(void); | 2297 | /// pthread_t pthread_self(void); |
| 2270 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_self.html | 2298 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_self.html |
| 2271 | pub extern fn pthread_self() pthread_t; | 2299 | pub extern fn pthread_self() pthread_t; |
| ... | @@ -2806,6 +2834,8 @@ pub const pthread_mutexattr_t = impdef.pthread_mutexattr_t; | ... | @@ -2806,6 +2834,8 @@ pub const pthread_mutexattr_t = impdef.pthread_mutexattr_t; |
| 2806 | pub const pthread_mutex_t = impdef.pthread_mutex_t; | 2834 | pub const pthread_mutex_t = impdef.pthread_mutex_t; |
| 2807 | pub const pthread_condattr_t = impdef.pthread_condattr_t; | 2835 | pub const pthread_condattr_t = impdef.pthread_condattr_t; |
| 2808 | pub const pthread_cond_t = impdef.pthread_cond_t; | 2836 | pub const pthread_cond_t = impdef.pthread_cond_t; |
| | 2837 | pub const pthread_rwlockattr_t = impdef.pthread_rwlockattr_t; |
| | 2838 | pub const pthread_rwlock_t = impdef.pthread_rwlock_t; |
| 2809 | | 2839 | |
| 2810 | pub const AT = struct { | 2840 | pub const AT = struct { |
| 2811 | pub const FDCWD = -100; | 2841 | pub const FDCWD = -100; |
| ... | @@ -3522,3 +3552,31 @@ pub fn faccessat(fd: c_int, path: [*:0]const u8, amode: c_int, flag: c_int) !voi | ... | @@ -3522,3 +3552,31 @@ pub fn faccessat(fd: c_int, path: [*:0]const u8, amode: c_int, flag: c_int) !voi |
| 3522 | if (rc == -1) return errno.fromInt(errno.fromLibC()); | 3552 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3523 | std.debug.assert(rc == 0); | 3553 | std.debug.assert(rc == 0); |
| 3524 | } | 3554 | } |
| | 3555 | pub fn pthread_rwlock_init(noalias rwlock: *pthread_rwlock_t, noalias attr: ?*const pthread_rwlockattr_t) !void { |
| | 3556 | const rc = libc.pthread_rwlock_init(rwlock, attr); |
| | 3557 | if (rc != 0) return errno.fromInt(rc); |
| | 3558 | } |
| | 3559 | pub fn pthread_rwlock_destroy(rwlock: *pthread_rwlock_t) !void { |
| | 3560 | const rc = libc.pthread_rwlock_destroy(rwlock); |
| | 3561 | if (rc != 0) return errno.fromInt(rc); |
| | 3562 | } |
| | 3563 | pub fn pthread_rwlock_rdlock(rwlock: *pthread_rwlock_t) !void { |
| | 3564 | const rc = libc.pthread_rwlock_rdlock(rwlock); |
| | 3565 | if (rc != 0) return errno.fromInt(rc); |
| | 3566 | } |
| | 3567 | pub fn pthread_rwlock_tryrdlock(rwlock: *pthread_rwlock_t) !void { |
| | 3568 | const rc = libc.pthread_rwlock_tryrdlock(rwlock); |
| | 3569 | if (rc != 0) return errno.fromInt(rc); |
| | 3570 | } |
| | 3571 | pub fn pthread_rwlock_wrlock(rwlock: *pthread_rwlock_t) !void { |
| | 3572 | const rc = libc.pthread_rwlock_wrlock(rwlock); |
| | 3573 | if (rc != 0) return errno.fromInt(rc); |
| | 3574 | } |
| | 3575 | pub fn pthread_rwlock_trywrlock(rwlock: *pthread_rwlock_t) !void { |
| | 3576 | const rc = libc.pthread_rwlock_trywrlock(rwlock); |
| | 3577 | if (rc != 0) return errno.fromInt(rc); |
| | 3578 | } |
| | 3579 | pub fn pthread_rwlock_unlock(rwlock: *pthread_rwlock_t) !void { |
| | 3580 | const rc = libc.pthread_rwlock_unlock(rwlock); |
| | 3581 | if (rc != 0) return errno.fromInt(rc); |
| | 3582 | } |