OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / sem_wait.3
index 9523593..cd57468 100644 (file)
@@ -1,8 +1,7 @@
 '\" t
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -22,8 +21,9 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
-.TH SEM_WAIT 3 2010-02-25 "Linux" "Linux Programmer's Manual"
+.TH SEM_WAIT 3 2014-02-26 "Linux" "Linux Programmer's Manual"
 .SH NAME
 sem_wait, sem_timedwait, sem_trywait \- lock a semaphore
 .SH SYNOPSIS
@@ -37,7 +37,7 @@ sem_wait, sem_timedwait, sem_trywait \- lock a semaphore
 .BI "int sem_timedwait(sem_t *" sem ", const struct timespec *" abs_timeout );
 .fi
 .sp
-Link with \fI\-lrt\fP or \fI\-pthread\fP.
+Link with \fI\-pthread\fP.
 .sp
 .in -4n
 Feature Test Macro Requirements for glibc (see
@@ -140,6 +140,14 @@ is less than 0, or greater than or equal to 1000 million.
 The call timed out before the semaphore could be locked.
 .\" POSIX.1-2001 also allows EDEADLK -- "A deadlock condition
 .\" was detected", but this does not occur on Linux(?).
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+The
+.BR sem_wait (),
+.BR sem_trywait (),
+and
+.BR sem_timedwait ()
+functions are thread-safe.
 .SH CONFORMING TO
 POSIX.1-2001.
 .SH NOTES
@@ -175,7 +183,6 @@ The following shows what happens on two different runs of the program:
 .RB "$" " ./a.out 2 3"
 About to call sem_timedwait()
 sem_post() from handler
-sem_getvalue() from handler; value = 1
 sem_timedwait() succeeded
 .RB "$" " ./a.out 2 1"
 About to call sem_timedwait()
@@ -260,9 +267,18 @@ main(int argc, char *argv[])
     exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 .fi
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR clock_gettime (2),
 .BR sem_getvalue (3),
 .BR sem_post (3),
 .BR sem_overview (7),
 .BR time (7)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.