OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / sem_getvalue.3
1 '\" t
2 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\"
4 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
5 .\"
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\"
26 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved.
27 .\" Translated 2006-04-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
28 .\"
29 .TH SEM_GETVALUE 3 2006-03-25 "Linux" "Linux Programmer's Manual"
30 .\"O .SH NAME
31 .SH Ì¾Á°
32 .\"O sem_getvalue \- get the value of a semaphore
33 sem_getvalue \- ¥»¥Þ¥Õ¥©¤ÎÃͤò¼èÆÀ¤¹¤ë
34 .\"O .SH SYNOPSIS
35 .SH ½ñ¼°
36 .nf
37 .B #include <semaphore.h>
38 .sp
39 .BI "int sem_getvalue(sem_t *" sem ", int *" sval );
40 .fi
41 .sp
42 .\"O Link with \fI\-lrt\fP or \fI\-pthread\fP.
43 \fI\-lrt\fP ¤Þ¤¿¤Ï \fI\-pthread\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
44 .\"O .SH DESCRIPTION
45 .SH ÀâÌÀ
46 .\"O .BR sem_getvalue ()
47 .\"O places the current value of the semaphore pointed to
48 .\"O .I sem
49 .\"O into the integer pointed to by
50 .\"O .IR sval .
51 .BR sem_getvalue ()
52 ¤Ï¡¢
53 .I sem
54 ¤¬»Ø¤¹¥»¥Þ¥Õ¥©¤Î¸½ºß¤ÎÃͤò
55 .I sval
56 ¤Ç»Ø¤¹À°¿ô¤Ë³ÊǼ¤¹¤ë¡£
57
58 .\"O If one or more processes or threads are blocked
59 .\"O waiting to lock the semaphore with
60 .\"O .BR sem_wait (3),
61 .\"O POSIX.1-2001 permits two possibilities for the value returned in
62 .\"O .IR sval :
63 .\"O either 0 is returned;
64 .\"O or a negative number whose absolute value is the count
65 .\"O of the number of processes and threads currently blocked in
66 .\"O .BR sem_wait (3).
67 .\"O Linux adopts the former behavior.
68 POSIX.1-2001 ¤Ë¤è¤ë¤È¡¢
69 1¤Ä°Ê¾å¤Î¥×¥í¥»¥¹¤«¥¹¥ì¥Ã¥É¤¬
70 .BR sem_wait (3)
71 ¤Ç¥»¥Þ¥Õ¥©¤Î¥í¥Ã¥¯ÂÔ¤Á¤ÇÄä»ß¤·¤Æ¤¤¤ë¾ì¹ç¡¢
72 .I sval
73 ¤ÇÊÖ¤µ¤ì¤ëÃͤϠ0 ¤â¤·¤¯¤ÏÉé¤ÎÃͤΤ¤¤º¤ì¤«¤È¤Ê¤ë¡£
74 Éé¤ÎÃͤξì¹ç¡¢¤½¤ÎÀäÂÐÃͤÏ
75 .BR sem_wait (3)
76 ¤Ç¸½ºßÄä»ß¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤«¥¹¥ì¥Ã¥É¤Î¹ç·×¿ô¤ËÅù¤·¤¤¡£
77 Linux ¤ÏÁ°¼Ô¤ÎÆ°ºî (0 ¤òÊÖ¤¹Æ°ºî) ¤òºÎÍѤ·¤Æ¤¤¤ë¡£
78 .\"O .SH RETURN VALUE
79 .SH ÊÖ¤êÃÍ
80 .\"O .BR sem_getvalue ()
81 .\"O returns 0 on success;
82 .\"O on error, \-1 is returned and
83 .\"O .I errno
84 .\"O is set to indicate the error.
85 À®¸ù¤¹¤ë¤È¡¢
86 .BR sem_getvalue ()
87 ¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
88 .I errno
89 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£
90 .\"O .SH ERRORS
91 .SH ¥¨¥é¡¼
92 .TP
93 .B EINVAL
94 .\"O .I sem
95 .\"O is not a valid semaphore.
96 .I sem
97 ¤ÏÍ­¸ú¤Ê¥»¥Þ¥Õ¥©¤Ç¤Ï¤Ê¤¤¡£
98 .\"O .SH CONFORMING TO
99 .SH ½àµò
100 POSIX.1-2001.
101 .\"O .SH NOTES
102 .SH Ãí°Õ
103 .\"O The value of the semaphore may already have changed by the time
104 .\"O .BR sem_getvalue ()
105 .\"O returns.
106 .BR sem_getvalue ()
107 ¤¬ÊÖ¤ë¤È¤­¤Ë¤Ï¡¢¤¹¤Ç¤Ë¥»¥Þ¥Õ¥©¤ÎÃͤÏÊѲ½¤·¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
108 .\"O .SH "SEE ALSO"
109 .SH ´ØÏ¢¹àÌÜ
110 .BR sem_post (3),
111 .BR sem_wait (3),
112 .BR sem_overview (7)