diff options
Diffstat (limited to 'man3/sem_wait.3')
-rw-r--r-- | man3/sem_wait.3 | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/man3/sem_wait.3 b/man3/sem_wait.3 index b1302ca..aa4793c 100644 --- a/man3/sem_wait.3 +++ b/man3/sem_wait.3 @@ -3,7 +3,7 @@ .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" -.TH sem_wait 3 2023-07-20 "Linux man-pages 6.05.01" +.TH sem_wait 3 2023-10-31 "Linux man-pages 6.7" .SH NAME sem_wait, sem_timedwait, sem_trywait \- lock a semaphore .SH LIBRARY @@ -12,18 +12,18 @@ POSIX threads library .SH SYNOPSIS .nf .B #include <semaphore.h> -.PP +.P .BI "int sem_wait(sem_t *" sem ); .BI "int sem_trywait(sem_t *" sem ); .BI "int sem_timedwait(sem_t *restrict " sem , .BI " const struct timespec *restrict " abs_timeout ); .fi -.PP +.P .RS -4 Feature Test Macro Requirements for glibc (see .BR feature_test_macros (7)): .RE -.PP +.P .BR sem_timedwait (): .nf _POSIX_C_SOURCE >= 200112L @@ -38,7 +38,7 @@ If the semaphore currently has the value zero, then the call blocks until either it becomes possible to perform the decrement (i.e., the semaphore value rises above zero), or a signal handler interrupts the call. -.PP +.P .BR sem_trywait () is the same as .BR sem_wait (), @@ -48,7 +48,7 @@ then call returns an error set to .BR EAGAIN ) instead of blocking. -.PP +.P .BR sem_timedwait () is the same as .BR sem_wait (), @@ -62,7 +62,7 @@ argument points to a .BR timespec (3) structure that specifies an absolute timeout in seconds and nanoseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). -.PP +.P If the timeout has already expired by the time of the call, and the semaphore could not be locked immediately, then @@ -71,7 +71,7 @@ fails with a timeout error .RI ( errno set to .BR ETIMEDOUT ). -.PP +.P If the operation can be performed immediately, then .BR sem_timedwait () never fails with a timeout error, regardless of the value of @@ -127,7 +127,6 @@ T{ .BR sem_timedwait () T} Thread safety MT-Safe .TE -.sp 1 .SH STANDARDS POSIX.1-2008. .SH HISTORY @@ -150,7 +149,7 @@ The second command-line argument specifies the length of the timeout, in seconds, for .BR sem_timedwait (). The following shows what happens on two different runs of the program: -.PP +.P .in +4n .EX .RB "$" " ./a.out 2 3" |