OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / release / man2 / close.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
4 .\"                               1993 Michael Haardt, Ian Jackson.
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 .\" Modified Wed Jul 21 22:40:25 1993 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified Sat Feb 18 15:27:48 1995 by Michael Haardt
28 .\" Modified Sun Apr 14 11:40:50 1996 by Andries Brouwer <aeb@cwi.nl>:
29 .\"   corrected description of effect on locks (thanks to
30 .\"   Tigran Aivazian <tigran@sco.com>).
31 .\" Modified Fri Jan 31 16:21:46 1997 by Eric S. Raymond <esr@thyrsus.com>
32 .\" Modified 2000-07-22 by Nicolas Lichtmaier <nick@debian.org>
33 .\"   added note about close(2) not guaranteeing that data is safe on close.
34 .\"
35 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
36 .\"         all rights reserved.
37 .\" Translated Sat Jun  1 22:22:05 JST 1997
38 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
39 .\" Modified Mon Sep 23 20:42:13 JST 2000
40 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
41 .\" Updated & Modified Sat Apr  7 03:24:03 JST 2001
42 .\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
43 .\" Updated & Modified Mon Jan 14 12:41:36 JST 2002 by Yuichi SATO
44 .\" Updated & Modified Wed Dec 29 07:01:14 JST 2004
45 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
46 .\" Updated 2007-10-12, Akihiro MOTOKI, LDP v2.66
47 .\" Updated 2008-02-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.77
48 .\"
49 .\"WORD:        descriptor              ¥Ç¥£¥¹¥¯¥ê¥×¥¿
50 .\"WORD:        close                   ¥¯¥í¡¼¥º
51 .\"WORD:        lock                    ¥í¥Ã¥¯
52 .\"WORD:        process                 ¥×¥í¥»¥¹
53 .\"WORD:        quota                   ¥¯¥©¡¼¥¿
54 .\"
55 .TH CLOSE 2 2007-12-28 "Linux" "Linux Programmer's Manual"
56 .SH Ì¾Á°
57 close \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë
58 .SH ½ñ¼°
59 .nf
60 .B #include <unistd.h>
61 .sp
62 .BI "int close(int " fd );
63 .fi
64 .SH ÀâÌÀ
65 .BR close ()
66 ¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë¡£
67 ¤½¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤É¤Î¥Õ¥¡¥¤¥ë¤â»²¾È¤·¤Æ¤¤¤Ê¤¤¾õÂ֤ˤʤꡢ
68 ºÆÍøÍѤ¬²Äǽ¤Ë¤Ê¤ë¡£
69 ¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë
70 ¤«¤±¤é¤ì¤¿¥ì¥³¡¼¥É¡¦¥í¥Ã¥¯
71 .RB ( fcntl (2)
72 »²¾È) ¤Î¤¦¤Á¡¢¤½¤Î¥×¥í¥»¥¹¤¬ÊÝÍ­¤·¤Æ¤¤¤ë¤â¤Î¤Ï¡¢
73 (¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¥í¥Ã¥¯¼èÆÀ¤ËÍøÍѤµ¤ì¤¿¤«
74 ¤É¤¦¤«¤Ë¤è¤é¤º) ¤¹¤Ù¤Æºï½ü¤µ¤ì¤ë¡£
75 .PP
76 .I fd
77 ¤¬¡¢Âбþ¤¹¤ë¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò (open file description)
78 .RB ( open (2)
79 »²¾È) ¤ò»²¾È¤¹¤ëºÇ¸å¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤À¤Ã¤¿¾ì¹ç¡¢
80 ¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ­½Ò¤Ë´ØÏ¢¤¹¤ë¥ê¥½¡¼¥¹¤¬²òÊü¤µ¤ì¤ë¡£
81 ¤½¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¡¢
82 .B unlink
83 ¤ò»ÈÍѤ·¤Æºï½ü (remove) ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëºÇ¸å¤Î»²¾È¤À¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢
84 ¤½¤Î¥Õ¥¡¥¤¥ë¤Ïºï½ü (delete) ¤µ¤ì¤ë¡£
85 .SH ÊÖ¤êÃÍ
86 .BR close ()
87 ¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£
88 ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¤Æ¡¢
89 .I errno
90 ¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£
91 .SH ¥¨¥é¡¼
92 .TP
93 .B EBADF
94 .I fd
95 ¤¬Í­¸ú¤Ê¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£
96 .TP
97 .B EINTR
98 .BR close ()
99 ¥³¡¼¥ë¤¬¥·¥°¥Ê¥ë¤Ë¤è¤êÃæÃÇ (interrupt) ¤µ¤ì¤¿¡£
100 .BR signal (7)
101 »²¾È¡£
102 .TP
103 .B EIO
104 I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
105 .SH ½àµò
106 SVr4, 4.3BSD, POSIX.1-2001.
107 .\" SVr4, SVID, POSIX, X/OPEN, 4.3BSD ¤Ë½àµò¤¹¤ë¡£
108 .\" SVr4 ¤Ë¤Ï¾¤Ë ENOLINK ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£
109 .SH Ãí°Õ
110 .BR close ()
111 ¤ÎÊÖ¤êÃͤΥÁ¥§¥Ã¥¯¤Ï¤è¤¯¾Êά¤µ¤ì¤ë¤¬¡¢
112 ¤³¤ì¤Ï¿¼¹ï¤Ê¥×¥í¥°¥é¥ß¥ó¥°¥¨¥é¡¼¤Ç¤¢¤ë¡£
113 Á°¤Î
114 .BR write (2)
115 ½èÍý¤Ë´Ø¤¹¤ë¥¨¥é¡¼¤¬ºÇ¸å¤Î
116 .BR close ()
117 ¤Î¤È¤­¤Ë¤Ê¤Ã¤Æ½é¤á¤ÆÄÌÃΤµ¤ì¤ë¾ì¹ç¤¬¤¢¤ê¤¦¤ë¡£
118 ¥Õ¥¡¥¤¥ë¥¯¥í¡¼¥º¤ÎºÝ¤ËÊÖ¤êÃͤò¥Á¥§¥Ã¥¯¤·¤Ê¤¤¤È¡¢
119 µ¤ÉÕ¤«¤Ê¤¤¤¦¤Á¤Ë¥Ç¡¼¥¿¤ò¼º¤Ã¤Æ¤·¤Þ¤¦¤«¤â¤·¤ì¤Ê¤¤¡£
120 ¤³¤ì¤ÏÆäˠNFS ¤ä¥Ç¥£¥¹¥¯¡¦¥¯¥©¡¼¥¿¤ò»ÈÍѤ·¤¿¾ì¹ç¤Ë¸«¤é¤ì¤ë¡£
121 .PP
122 ¥¯¥í¡¼¥º¤ËÀ®¸ù¤·¤Æ¤â¡¢¥Ç¡¼¥¿¤¬¥Ç¥£¥¹¥¯¤ËÊݸ¤µ¤ì¤¿¤«¤É¤¦¤«¤Ï
123 Êݾڤµ¤ì¤Ê¤¤ (¥«¡¼¥Í¥ë¤¬½ñ¤­¤³¤ß¤òÃٱ䤵¤»¤ë¤³¤È¤¬¤¢¤ë¤¿¤á¤Ç¤¢¤ë)¡£
124 ¥¹¥È¥ê¡¼¥à¤¬¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¤­¤Ë¥Ð¥Ã¥Õ¥¡¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¤«¤É¤¦¤«¤Ï¡¢
125 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£
126 ¥Ç¡¼¥¿¤¬ÊªÍýŪ¤ËÊݸ¤µ¤ì¤ë¤³¤È¤òÊݾڤ¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢
127 .BR fsync (2)
128 ¤ò»ÈÍѤ¹¤ë¤³¤È
129 .RB ( fsync (3)
130 ¤ò¹Ô¤Ã¤¿»þÅÀ¤Ç¡¢¥Ç¡¼¥¿¤ÎÊݸ¤Ï¥Ç¥£¥¹¥¯¤Î¥Ï¡¼¥É¥¦¥§¥¢¤Ë°Í¸¤¹¤ë
131 ÌäÂê¤È¤Ê¤ë)¡£
132 .PP
133 Ʊ¤¸¥×¥í¥»¥¹Æâ¤Î¾¤Î¥¹¥ì¥Ã¥É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬»ÈÍѤ·¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ë´Ö¤Ë¡¢
134 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤¹¤ë¤Î¤Ï¡¢¤ª¤½¤é¤¯¸­ÌÀ¤Ç¤Ï¤Ê¤¤¤À¤í¤¦¡£
135 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏºÆÍøÍѤµ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç¡¢
136 ¤¢¤¤¤Þ¤¤¤Ê¶¥¹ç¾ò·ï¤È¤Ê¤ë¤³¤È¤¬¤¢¤ê¡¢°Õ¿Þ¤·¤Ê¤¤ÉûºîÍѤθ¶°ø¤È¤Ê¤ê¤¦¤ë¡£
137 .\" Date: Tue, 4 Sep 2007 13:57:35 +0200
138 .\" From: Fredrik Noring <noring@nocrew.org>
139 .\" One such race involves signals and ERESTARTSYS. If a file descriptor
140 .\" in use by a system call is closed and then reused by e.g. an
141 .\" independent open() in some unrelated thread, before the original system
142 .\" call has restared after ERESTARTSYS, the original system call will
143 .\" later restart with the reused file descriptor. This is most likely a
144 .\" serious programming error.
145 .SH ´ØÏ¢¹àÌÜ
146 .BR fcntl (2),
147 .BR fsync (2),
148 .BR open (2),
149 .BR shutdown (2),
150 .BR unlink (2),
151 .BR fclose (3)