Skip to content

Commit 0e9c6e5

Browse files
willnodetgross35
authored andcommitted
redox: Add semaphore functions
(backport <#5051>) (cherry picked from commit 30fd290)
1 parent 24ef457 commit 0e9c6e5

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

libc-test/semver/redox.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,14 @@ qsort
337337
reallocarray
338338
renameat2
339339
rlim_t
340+
sem_clockwait
341+
sem_destroy
342+
sem_getvalue
343+
sem_init
344+
sem_post
345+
sem_timedwait
346+
sem_trywait
347+
sem_wait
340348
setgrent
341349
setpwent
342350
setresgid

src/unix/redox/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,17 @@ extern "C" {
13091309
result: *mut *mut passwd,
13101310
) -> c_int;
13111311

1312+
// semaphore.h
1313+
pub fn sem_destroy(sem: *mut sem_t) -> c_int;
1314+
pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int;
1315+
pub fn sem_clockwait(
1316+
sem: *mut sem_t,
1317+
clock_id: clockid_t,
1318+
abstime: *const crate::timespec,
1319+
) -> c_int;
1320+
pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int;
1321+
pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int;
1322+
13121323
// signal.h
13131324
pub fn pthread_sigmask(
13141325
how: c_int,

0 commit comments

Comments
 (0)