From 9d678b540a55cef6a0dc68e22adef0aa02d0aaa1 Mon Sep 17 00:00:00 2001 From: ru Date: Fri, 2 Jul 2004 16:45:56 +0000 Subject: Markup tidying. --- lib/libc/gen/sem_destroy.3 | 10 +++++++--- lib/libc/gen/sem_getvalue.3 | 7 ++++++- lib/libc/gen/sem_init.3 | 9 +++++++-- lib/libc/gen/sem_open.3 | 18 +++++++++--------- lib/libc/gen/sem_post.3 | 3 +++ lib/libc/gen/sem_wait.3 | 6 +++++- 6 files changed, 37 insertions(+), 16 deletions(-) (limited to 'lib') diff --git a/lib/libc/gen/sem_destroy.3 b/lib/libc/gen/sem_destroy.3 index 0d0df30..f488b4e 100644 --- a/lib/libc/gen/sem_destroy.3 +++ b/lib/libc/gen/sem_destroy.3 @@ -26,6 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ +.\" .Dd February 15, 2000 .Dt SEM_DESTROY 3 .Os @@ -47,7 +48,7 @@ After a successful call to .Fn sem_destroy , .Fa sem is unusable until re-initialized by another call to -.Fn sem_init . +.Xr sem_init 3 . .Sh RETURN VALUES .Rv -std sem_destroy .Sh ERRORS @@ -56,7 +57,9 @@ The function will fail if: .Bl -tag -width Er .It Bq Er EINVAL +The .Fa sem +argument points to an invalid semaphore. .It Bq Er EBUSY There are currently threads blocked on the semaphore that @@ -72,11 +75,12 @@ The function conforms to .St -p1003.1-96 . .Pp -POSIX does not define the behavior of +.Tn POSIX +does not define the behavior of .Fn sem_destroy if called while there are threads blocked on .Fa sem , -but this implementation is guaranteed to return -1 and set +but this implementation is guaranteed to return \-1 and set .Va errno to .Er EBUSY diff --git a/lib/libc/gen/sem_getvalue.3 b/lib/libc/gen/sem_getvalue.3 index 26a1e149..a8dd177 100644 --- a/lib/libc/gen/sem_getvalue.3 +++ b/lib/libc/gen/sem_getvalue.3 @@ -26,6 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ +.\" .Dd February 15, 2000 .Dt SEM_GETVALUE 3 .Os @@ -56,7 +57,9 @@ The function will fail if: .Bl -tag -width Er .It Bq Er EINVAL +The .Fa sem +argument points to an invalid semaphore. .El .Sh SEE ALSO @@ -71,6 +74,8 @@ function conforms to .St -p1003.1-96 . .Pp The value of the semaphore is never negative, even if there are threads blocked -on the semaphore. POSIX is somewhat ambiguous in its wording with regard to +on the semaphore. +.Tn POSIX +is somewhat ambiguous in its wording with regard to what the value of the semaphore should be if there are blocked waiting threads, but this behavior is conformant, given the wording of the specification. diff --git a/lib/libc/gen/sem_init.3 b/lib/libc/gen/sem_init.3 index c55cd75..d18f5e2 100644 --- a/lib/libc/gen/sem_init.3 +++ b/lib/libc/gen/sem_init.3 @@ -26,6 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ +.\" .Dd February 15, 2000 .Dt SEM_INIT 3 .Os @@ -71,8 +72,10 @@ The function will fail if: .Bl -tag -width Er .It Bq Er EINVAL +The .Fa value -exceeds SEM_VALUE_MAX. +argument exceeds +.Dv SEM_VALUE_MAX . .It Bq Er ENOSPC Memory allocation error. .It Bq Er EPERM @@ -95,7 +98,9 @@ by setting .Va errno to .Er EPERM . -This is perhaps a stretch of the intention of POSIX, but is +This is perhaps a stretch of the intention of +.Tn POSIX , +but is compliant, with the caveat that .Fn sem_init always reports a permissions error when an attempt to create a shared semaphore diff --git a/lib/libc/gen/sem_open.3 b/lib/libc/gen/sem_open.3 index 28ce965..f5ba249 100644 --- a/lib/libc/gen/sem_open.3 +++ b/lib/libc/gen/sem_open.3 @@ -26,6 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ +.\" .Dd January 15, 2003 .Dt SEM_OPEN 3 .Os @@ -38,8 +39,8 @@ .Lb libc .Sh SYNOPSIS .In semaphore.h -.Ft sem_t * -.Fn sem_open "const char *name" "int oflag" "..." +.Ft "sem_t *" +.Fn sem_open "const char *name" "int oflag" ... .Ft int .Fn sem_close "sem_t *sem" .Ft int @@ -50,10 +51,10 @@ The function creates or opens the named semaphore specified by .Fa name . The returned semaphore may be used in subsequent calls to -.Fn sem_getvalue , -.Fn sem_wait , -.Fn sem_trywait , -.Fn sem_post +.Xr sem_getvalue 3 , +.Xr sem_wait 3 , +.Xr sem_trywait 3 , +.Xr sem_post 3 , and .Fn sem_close . .Pp @@ -70,8 +71,7 @@ must be of type .Vt mode_t and specifies the mode for the semaphore. Only the -.Dv S_IWUSR , -.Dv S_IWGRP , +.Dv S_IWUSR , S_IWGRP , and .Dv S_IWOTH bits are examined; @@ -137,7 +137,7 @@ function will fail if: .It Bq Er EACCES The semaphore exists and the permissions specified by .Fa oflag -at the time it was created deny access to the this process. +at the time it was created deny access to this process. .It Bq Er EACCES The semaphore does not exist, but permission to create it is denied. .It Bq Er EEXIST diff --git a/lib/libc/gen/sem_post.3 b/lib/libc/gen/sem_post.3 index ce1248a..6dd18a1 100644 --- a/lib/libc/gen/sem_post.3 +++ b/lib/libc/gen/sem_post.3 @@ -26,6 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ +.\" .Dd February 15, 2000 .Dt SEM_POST 3 .Os @@ -60,7 +61,9 @@ The function will fail if: .Bl -tag -width Er .It Bq Er EINVAL +The .Fa sem +argument points to an invalid semaphore. .El .Sh SEE ALSO diff --git a/lib/libc/gen/sem_wait.3 b/lib/libc/gen/sem_wait.3 index 1307aab..b6c3b7c 100644 --- a/lib/libc/gen/sem_wait.3 +++ b/lib/libc/gen/sem_wait.3 @@ -26,6 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ +.\" .Dd February 15, 2000 .Dt SEM_WAIT 3 .Os @@ -54,7 +55,8 @@ The .Fn sem_trywait function decrements (locks) the semaphore pointed to by .Fa sem -only if the value is non-zero. Otherwise, the semaphore is not decremented and +only if the value is non-zero. +Otherwise, the semaphore is not decremented and an error is returned. .Sh RETURN VALUES .Rv -std @@ -66,7 +68,9 @@ and functions will fail if: .Bl -tag -width Er .It Bq Er EINVAL +The .Fa sem +argument points to an invalid semaphore. .El .Pp -- cgit v1.1