OSDN Git Service

(split) Fixed #25191 (typo in fenv.3).
[linuxjm/LDP_man-pages.git] / release / man3 / flockfile.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Japanese Version Copyright (c) 2001 Yuichi SATO
24 .\"         all rights reserved.
25 .\" Translated Sun Nov  4 14:09:45 2001
26 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
27 .\"
28 .\"WORD:        lockcount       ¥í¥Ã¥¯¿ô
29 .\"WORD:        owner thread    ½êÍ­¼Ô¥¹¥ì¥Ã¥É
30 .\"
31 .TH FLOCKFILE 3  2008-08-29 "" "Linux Programmer's Manual"
32 .SH Ì¾Á°
33 flockfile, ftrylockfile, funlockfile \- É¸½àÆþ½ÐÎÏ FILE ¤Î¥í¥Ã¥¯¤ò¹Ô¤¦
34 .SH ½ñ¼°
35 .nf
36 .B #include <stdio.h>
37 .sp
38 .BI "void flockfile(FILE *" filehandle );
39 .br
40 .BI "int ftrylockfile(FILE *" filehandle );
41 .br
42 .BI "void funlockfile(FILE *" filehandle );
43 .fi
44 .sp
45 .in -4n
46 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
47 .RB ( feature_test_macros (7)
48 »²¾È):
49 .in
50 .ad l
51 .sp
52 ¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô:
53 .RS 4
54 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE ||
55 _SVID_SOURCE || _POSIX_SOURCE
56 .RE
57 .ad b
58 .SH ÀâÌÀ
59 ɸ½àÆþ½ÐÎÏ´Ø¿ô¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤¢¤ë¡£¤³¤ì¤Ï¡¢³Æ
60 .I FILE
61 ¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ·¡¢¥í¥Ã¥¯¿ô (lockcount) ¤È
62 (¥í¥Ã¥¯¿ô¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¤Ï) ½êÍ­¼Ô¥¹¥ì¥Ã¥É (owner thread)
63 ¤ò´ÉÍý¤¹¤ë¤³¤È¤Ç¼Â¸½¤µ¤ì¤ë¡£
64 ¥é¥¤¥Ö¥é¥ê¤Î¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤ëËè¤Ë¡¢É¸½àÆþ½ÐÎÏ´Ø¿ô¤Ï
65 .I FILE
66 ¥ª¥Ö¥¸¥§¥¯¥È¤¬Â¾¤Î¥¹¥ì¥Ã¥É¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¾õÂ֤ˤʤë¤Þ¤ÇÂÔ¤Á¡¢
67 .I FILE
68 ¥ª¥Ö¥¸¥§¥¯¥È¤ò¥í¥Ã¥¯¤·¡¢Í׵ᤵ¤ì¤ÆÆþ½ÐÎϤò¹Ô¤¤¡¢
69 ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë¡£
70 .LP
71 (Ãí: ¤³¤Î¥í¥Ã¥¯¤Ï¡¢
72 .BR flock (2)
73 ¤ä
74 .BR lockf (3)
75 ¤È¤¤¤Ã¤¿´Ø¿ô¤¬¹Ô¤¦¥í¥Ã¥¯¤È¤ÏÁ´¤¯Ìµ´Ø·¸¤Ç¤¢¤ë¡£)
76 .LP
77 ¤³¤ì¤é¤Î¤³¤È¤Ï¤¹¤Ù¤Æ C ¥×¥í¥°¥é¥Þ¤Ë¤Ï¸«¤¨¤Ê¤¤Éôʬ¤Ç¹Ô¤ï¤ì¤ë¤¬¡¢
78 ¤è¤êºÙ¤«¤¤À©¸æ¤¬¤Ç¤­¤¿Êý¤¬¤è¤¤Íýͳ¤¬2¤Ä¤¢¤ë¤À¤í¤¦¡£°ì¤Ä¤Ï¡¢°ì¤Ä¤Î¥¹¥ì¥Ã¥É¤¬
79 ¹Ô¤¦°ìÏ¢¤ÎÆþ½ÐÎÏÆ°ºî¤Ï°ì½ï¤Ë¹Ô¤ï¤ì¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤ÎÆþ½ÐÎϤˤè¤Ã¤ÆÃæÃǤµ¤ì¤Ê¤¤
80 Êý¤¬¤è¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤í¤¦¡£¤â¤¦°ì¤Ä¤Ï¡¢¸úΨ¤òÂ礭¤¯¾å¤²¤ë¤¿¤á¤Ë¤Ï
81 ¥í¥Ã¥¯¤Î¥ª¡¼¥Ð¥Ø¥Ã¥É¤òÈò¤±¤ëɬÍפ¬¤¢¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤í¤¦¡£
82 .LP
83 ¤³¤ÎÌÜŪ¤ò¼Â¸½¤¹¤ë¤¿¤á¤Ë¡¢
84 .I FILE
85 ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥í¥Ã¥¯¡¢°ìÏ¢¤ÎÆþ½ÐÎÏÆ°ºî¤Î¼Â¹Ô¡¢
86 ¥í¥Ã¥¯¤Î²ò½ü¤ò¥¹¥ì¥Ã¥É¤¬ÌÀ¼¨Åª¤Ë»Ø¼¨¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
87 ¤³¤ì¤Ë¤è¤ê¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤¬ÅÓÃæ¤ÇÆþ½ÐÎϤò¹Ô¤¦¤Î¤òËɻߤ¹¤ë¡£
88 ¤³¤Î¤è¤¦¤Ê¤³¤È¤ò¹Ô¤¦Íýͳ¤¬¸úΨ¤Î¸þ¾å¤Ç¤¢¤ë¤Ê¤é¤Ð¡¢
89 ¥í¥Ã¥¯¤ò¹Ô¤ï¤Ê¤¤¥Ð¡¼¥¸¥ç¥ó¤Îɸ½àÆþ½ÐÎÏ´Ø¿ô¤ò»È¤¦¤³¤È¤â¤Ç¤­¤ë¡£
90 Î㤨¤Ð¡¢
91 .BR getc (3)
92 ¤ä
93 .BR putc (3)
94 ¤ÎÂå¤ï¤ê¤Ë
95 .BR getc_unlocked (3)
96 ¤ä
97 .BR putc_unlocked (3)
98 ¤ò»ÈÍѤ¹¤ë¡£
99 .LP
100 .BR flockfile ()
101 ´Ø¿ô¤Ï¡¢\fI*filehandle\fP ¤¬Â¾¤Î¥¹¥ì¥Ã¥É¤Ë¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê
102 ¤¤¾õÂ֤ˤʤë¤Þ¤ÇÂԤ俤ΤÁ¡¢¸½ºß¤Î¥¹¥ì¥Ã¥É¤ò \fI*filehandle\fP ¤Î¥ª¡¼¥Ê¤ËÀß
103 Äꤷ¡¢¥í¥Ã¥¯¿ô¤ò²Ã»»¤¹¤ë¡£
104 .LP
105 .BR funlockfile ()
106 ´Ø¿ô¤Ï¡¢¥í¥Ã¥¯¿ô¤ò¸º»»¤¹¤ë¡£
107 .LP
108 .BR ftrylockfile ()
109 ´Ø¿ô¤Ï
110 .BR flockfile ()
111 ¤Î¥Ö¥í¥Ã¥­¥ó¥°¤ò¹Ô¤ï¤Ê¤¤
112 ¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë¡£Â¾¤Î¥¹¥ì¥Ã¥É¤¬ \fI*filehandle\fP ¤ò¥í¥Ã¥¯¤·¤Æ¤¤¤ë»þ¤Ï
113 ²¿¤â¹Ô¤ï¤º¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï \fI*filehandle\fP ¤Î½êÍ­¸¢¤ò³ÍÆÀ¤·¡¢
114 ¥í¥Ã¥¯¿ô¤ò²Ã»»¤¹¤ë¡£
115 .SH ÊÖ¤êÃÍ
116 .BR ftrylockfile ()
117 ´Ø¿ô¤Ï¥í¥Ã¥¯¤ËÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢
118 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£
119 .SH ¥¨¥é¡¼
120 ¤Ê¤·¡£
121 .SH ½àµò
122 POSIX.1-2001.
123 .SH ²ÄÍÑÀ­
124 .B _POSIX_THREAD_SAFE_FUNCTIONS
125 ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤È¤­¤Ë¤³¤ì¤é¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
126 5.1.1 °Ê¹ß¤Î libc ¤È 2.0 °Ê¹ß¤Î glibc ¤Ë¸ºß¤¹¤ë¡£
127 .SH ´ØÏ¢¹àÌÜ
128 .BR unlocked_stdio (3)