summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2004-07-02 16:45:56 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2004-07-02 16:45:56 +0000
commit26b6c45a92c8eae91cad4a7ce8935e08d2e5d368 (patch)
tree78dccaeba712e69b1159fb258d39913bc17f4612
parent0fe4fb09bc5d05bb01c0a45633738e5ad53fa3d4 (diff)
Notes
-rw-r--r--lib/libc/gen/sem_destroy.310
-rw-r--r--lib/libc/gen/sem_getvalue.37
-rw-r--r--lib/libc/gen/sem_init.39
-rw-r--r--lib/libc/gen/sem_open.318
-rw-r--r--lib/libc/gen/sem_post.33
-rw-r--r--lib/libc/gen/sem_wait.36
6 files changed, 37 insertions, 16 deletions
diff --git a/lib/libc/gen/sem_destroy.3 b/lib/libc/gen/sem_destroy.3
index 0d0df30fea866..f488b4efe08d2 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 26a1e149fe0b2..a8dd177ea381f 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 c55cd75ab449f..d18f5e23547e4 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 28ce9650700be..f5ba249f126a9 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 ce1248a0b4d65..6dd18a1ef880f 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 1307aabdabbcd..b6c3b7c798ce4 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