summaryrefslogtreecommitdiffstats
path: root/share/man/man9/sema.9
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>2004-06-14 18:19:05 +0000
committerjdp <jdp@FreeBSD.org>2004-06-14 18:19:05 +0000
commit32b926e0fbaacbc2b3175a2d2b1c791fbeefa99c (patch)
treef18a0b115d49023a3e78c267aa48ca58dc6304d5 /share/man/man9/sema.9
parentf2c0db1521299639d6b16b7d477a777fbd81ada6 (diff)
downloadFreeBSD-src-32b926e0fbaacbc2b3175a2d2b1c791fbeefa99c.zip
FreeBSD-src-32b926e0fbaacbc2b3175a2d2b1c791fbeefa99c.tar.gz
Change the return value of sema_timedwait() so it returns 0 on
success and a proper errno value on failure. This makes it consistent with cv_timedwait(), and paves the way for the introduction of functions such as sema_timedwait_sig() which can fail in multiple ways. Bump __FreeBSD_version and add a note to UPDATING. Approved by: scottl (ips driver), arch
Diffstat (limited to 'share/man/man9/sema.9')
-rw-r--r--share/man/man9/sema.921
1 files changed, 17 insertions, 4 deletions
diff --git a/share/man/man9/sema.9 b/share/man/man9/sema.9
index 9ba5890..e8f2cb9 100644
--- a/share/man/man9/sema.9
+++ b/share/man/man9/sema.9
@@ -98,13 +98,26 @@ argument to
.Fn sema_timedwait
specifies the minimum time in ticks to wait before returning with failure.
.Fn sema_value
+is used to read the current value of the semaphore.
+.Sh RETURN VALUES
+.Fn sema_value
returns the current value of the semaphore.
.Pp
-.Fn sema_timedwait
-and
+If decrementing the semaphore would result in its value being negative,
.Fn sema_trywait
-will return 0 if waiting on the semaphore failed; otherwise a non-zero value
-will be returned to indicate success.
+returns 0 to indicate failure.
+Otherwise, a non-zero value is returned to indicate success.
+.Pp
+.Fn sema_timedwait
+returns 0 if waiting on the semaphore succeeded; otherwise a
+non-zero error code is returned.
+.Sh ERRORS
+.Fn sema_timedwait
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EWOULDBLOCK
+Timeout expired.
+.El
.Sh SEE ALSO
.Xr condvar 9 ,
.Xr mtx_pool 9 ,
OpenPOWER on IntegriCloud