X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/5b2abdfbf4211b6592cdd02b9507555a0ecbb04b..5f4d86c1219d56604890d932a3152b3b5dd15b55:/sys/sem_wait.2 diff --git a/sys/sem_wait.2 b/sys/sem_wait.2 index feeff3b..02f8d85 100644 --- a/sys/sem_wait.2 +++ b/sys/sem_wait.2 @@ -24,27 +24,27 @@ .Dt SEM_WAIT 2 .Os Darwin .Sh NAME -.Nm sem_wait, sem_trywait +.Nm sem_trywait, sem_wait .Nd lock a semaphore .Sh SYNOPSIS .Fd #include .Ft int -.Fn sem_wait "sem_t *sem" -.Ft int .Fn sem_trywait "sem_t *sem" +.Ft int +.Fn sem_wait "sem_t *sem" .Sh DESCRIPTION The semaphore referenced by .Fa sem is locked. When calling .Fn sem_wait , if the semaphore's value is zero, the calling thread will block until -the lock is aquired or until the call is interrupted by a +the lock is acquired or until the call is interrupted by a signal. Alternatively, the .Fn sem_trywait function will fail if the semaphore is already locked, rather than blocking on the semaphore. .Pp -If successful (the lock was aquired), +If successful (the lock was acquired), .Fn sem_wait and .Fn sem_trywait @@ -59,13 +59,13 @@ succeed unless: .Bl -tag -width Er .It Bq Er EAGAIN The semaphore is already locked. -.It Bq Er EINVAL -.Fa sem -is not a valid semaphore descriptor. .It Bq Er EDEADLK A deadlock was detected. .It Bq Er EINTR The call was interrupted by a signal. +.It Bq Er EINVAL +.Fa sem +is not a valid semaphore descriptor. .El .Sh NOTES Applications may encounter a priority inversion while using @@ -76,11 +76,11 @@ has occured, and the higher-priority thread will be blocked for an unlimited time period. Programmers using the realtime functionality of the system should take care to avoid priority inversions. .Sh SEE ALSO +.Xr sem_open 2 , +.Xr sem_post 2 , .Xr semctl 2 , .Xr semget 2 , -.Xr semop 2 , -.Xr sem_open 2 , -.Xr sem_post 2 +.Xr semop 2 .Sh HISTORY .Fn sem_wait and