OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / draft / man3 / aio_write.3
1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
12 .\"
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\" GNU General Public License for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21 .\" USA.
22 .\"
23 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
24 .\"         all rights reserved.
25 .\" Translated Sat Jul 10 03:54:47 JST 2004
26 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
27 .\"
28 .TH AIO_WRITE 3 2003-11-14  "" "Linux Programmer's Manual"
29 .\"O .SH NAME
30 .SH Ì¾Á°
31 .\"O aio_write \- asynchronous write
32 aio_write \- ÈóƱ´ü¤Ç½ñ¤­¹þ¤à
33 .\"O .SH SYNOPSIS
34 .SH ½ñ¼°
35 .B "#include <aio.h>"
36 .sp
37 .BI "int aio_write(struct aiocb *" aiocbp );
38 .sp
39 .\"O Link with \fI\-lrt\fP.
40 \fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
41 .\"O .SH DESCRIPTION
42 .SH ÀâÌÀ
43 .\"O The
44 .\"O .BR aio_write ()
45 .\"O function requests an asynchronous "n = write(fd, buf, count)"
46 .\"O with fd, buf, count given by
47 .\"O .IR aiocbp\->aio_fildes ,
48 .\"O .IR aiocbp\->aio_buf ,
49 .\"O .IR aiocbp\->aio_nbytes ,
50 .\"O respectively.
51 .\"O The return status n can be retrieved upon completion using
52 .\"O .BR aio_return (3).
53 .BR aio_write ()
54 ´Ø¿ô¤ÏÈóƱ´ü¤Î "n = write(fd, buf, count)" ¤ò¥ê¥¯¥¨¥¹¥È¤¹¤ë¡£
55 ¤³¤³¤Ç fd, buf, count ¤Ï¡¢¤½¤ì¤¾¤ì
56 .IR aiocbp\->aio_fildes ,
57 .IR aiocbp\->aio_buf ,
58 .I aiocbp\->aio_nbytes
59 ¤ÇÍ¿¤¨¤é¤ì¤ë¡£
60 ÊÖ¤êÃÍ (return status) n ¤Ï¡¢´°Î»»þ¤Ë
61 .BR aio_return (3)
62 ¤ò»È¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£
63 .LP
64 .\"O If
65 .\"O .B O_APPEND
66 .\"O is not set, the data is written starting at the
67 .\"O absolute file offset
68 .\"O .IR aiocbp\->aio_offset ,
69 .\"O regardless of the current file position.
70 .B O_APPEND
71 ¤¬ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢¥«¥ì¥ó¥È¤Î¥Õ¥¡¥¤¥ë°ÌÃ֤˴ط¸¤Ê¤¯¡¢
72 ¥Ç¡¼¥¿¤ÏÀäÂÐ¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È
73 .I aiocbp\->aio_offset
74 ¤ò³«»ÏÅÀ¤È¤·¤Æ½ñ¤­¹þ¤Þ¤ì¤ë¡£
75 .\"O If
76 .\"O .B O_APPEND
77 .\"O is set, the data is written at the end of the file.
78 .B O_APPEND
79 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥Ç¡¼¥¿¤Ï¥Õ¥¡¥¤¥ë¤Î½ªÃ¼¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£
80 .\"O After this request, the value of the current file position is unspecified.
81 ¤³¤Î¥ê¥¯¥¨¥¹¥È¤Î¸å¤Î¡¢¥«¥ì¥ó¥È¤Î¥Õ¥¡¥¤¥ë°ÌÃ֤ϵ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
82 .LP
83 .\"O The "asynchronous" means that this call returns as soon as the
84 .\"O request has been enqueued; the write may or may not have completed
85 .\"O when the call returns.
86 .\"O One tests for completion using
87 .\"O .BR aio_error (3).
88 ¡ÖÈóƱ´ü¡×¤È¤Ï¡Ö¥ê¥¯¥¨¥¹¥È¤¬¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤¿¤é¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤Ï¤¹¤°¤ËÊÖ¤ë¡×
89 ¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£
90 ¸Æ¤Ó½Ð¤·¤«¤éÌá¤Ã¤¿»þ¤Ë¡¢½ñ¤­¹þ¤ß¤Ï´°Î»¤·¤Æ¤¤¤ë¤«¤âÃΤì¤Ê¤¤¤·¡¢
91 ´°Î»¤·¤Æ¤¤¤Ê¤¤¤«¤âÃΤì¤Ê¤¤¡£
92 .BR aio_error (3)
93 ¤ò»È¤¦¤³¤È¤Ç´°Î»¤·¤¿¤«¤ò¥Æ¥¹¥È¤Ç¤­¤ë¡£
94 .LP
95 .\"O If
96 .\"O .B _POSIX_PRIORITIZED_IO
97 .\"O is defined, and this file supports it,
98 .\"O then the asynchronous operation is submitted at a priority equal
99 .\"O to that of the calling process minus
100 .\"O .IR aiocbp\->aio_reqprio .
101 .B _POSIX_PRIORITIZED_IO
102 ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Æ¡¢
103 ¤«¤Ä¥Õ¥¡¥¤¥ë¤¬¤³¤ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç¡¢
104 ÈóƱ´üÁàºî¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤«¤é
105 .I aiocbp\->aio_reqprio
106 ¤ò°ú¤¤¤¿Í¥ÀèÅÙ¤ÇÅÐÏ¿ (submit) ¤µ¤ì¤ë¡£
107 .LP
108 .\"O The field
109 .\"O .I aiocbp\->aio_lio_opcode
110 .\"O is ignored.
111 ¥Õ¥£¡¼¥ë¥É
112 .I aiocbp\->aio_lio_opcode
113 ¤Ï̵»ë¤µ¤ì¤ë¡£
114 .LP
115 .\"O No data is written to a regular file beyond its maximum offset.
116 ºÇÂ祪¥Õ¥»¥Ã¥È¤òĶ¤¨¤¿Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢²¿¤â¥Ç¡¼¥¿¤¬½ñ¤­¹þ¤Þ¤ì¤Ê¤¤¡£
117 .\"O .SH "RETURN VALUE"
118 .SH ÊÖ¤êÃÍ
119 .\"O On success, 0 is returned.
120 .\"O On error the request is not enqueued, \-1
121 .\"O is returned, and
122 .\"O .I errno
123 .\"O is set appropriately.
124 .\"O If an error is first detected later, it will
125 .\"O be reported via
126 .\"O .BR aio_return (3)
127 .\"O (returns status \-1) and
128 .\"O .BR aio_error (3)
129 .\"O (error status whatever one would have gotten in
130 .\"O .IR errno ,
131 .\"O such as
132 .\"O .BR EBADF ).
133 À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£
134 ¥¨¥é¡¼¤Î¾ì¹ç¡¢¥ê¥¯¥¨¥¹¥È¤Ï¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤º¡¢
135 \-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢
136 .I errno
137 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
138 ¥¨¥é¡¼¤ÏºÇ½é¤Ë¸¡ÃΤµ¤ì¤¿¸å¤Ç¡¢
139 (¾õÂÖ \-1 ¤òÊÖ¤¹)
140 .BR aio_return (3)
141 ¤È
142 .RI ( errno
143 ¤Ç¼èÆÀ¤Ç¤­¤ë
144 .B EBADF
145 ¤Î¤è¤¦¤Ê¥¨¥é¡¼¾õÂÖ¤òÊÖ¤¹)
146 .BR aio_error (3)
147 ¤ÇÊó¹ð¤µ¤ì¤ë¤À¤í¤¦¡£
148 .\"O .SH ERRORS
149 .SH ¥¨¥é¡¼
150 .TP
151 .B EAGAIN
152 .\"O Out of resources.
153 ¥ê¥½¡¼¥¹¤¬Â­¤ê¤Ê¤¤¡£
154 .TP
155 .B EBADF
156 .\"O .I aio_fildes
157 .\"O is not a valid file descriptor open for writing.
158 .I aio_fildes
159 ¤Ï½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£
160 .TP
161 .B EFBIG
162 .\"O The file is a regular file, we want to write at least one byte,
163 .\"O but the starting position is at or beyond the maximum offset for this file.
164 ¥Õ¥¡¥¤¥ë¤ÏÄ̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¡¢¾¯¤Ê¤¯¤È¤â 1 ¥Ð¥¤¥È¤ò½ñ¤­¹þ¤â¤¦¤È¤·¤Æ¤¤¤ë¡£
165 ¤·¤«¤·³«»Ï°ÌÃÖ¤¬¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ÎºÇÂ祪¥Õ¥»¥Ã¥È¤ÈƱ¤¸¤«¤½¤ì¤òĶ¤¨¤Æ¤¤¤ë¡£
166 .TP
167 .B EINVAL
168 .\"O One or more of
169 .\"O .IR aio_offset ,
170 .\"O .IR aio_reqprio ,
171 .\"O .I aio_nbytes
172 .\"O are invalid.
173 .IR aio_offset ,
174 .IR aio_reqprio ,
175 .I aio_nbytes
176 ¤Î¤¦¤Á 1 ¤Ä°Ê¾å¤¬Ìµ¸ú¤Ç¤¢¤ë¡£
177 .TP
178 .B ENOSYS
179 .\"O This function is not supported.
180 ¤³¤Î´Ø¿ô¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
181 .\"O .SH "CONFORMING TO"
182 .SH ½àµò
183 POSIX.1-2001.
184 .\"O .SH NOTES
185 .SH Ãí°Õ
186 .\"O It is a good idea to zero out the control block before use.
187 »ÈÍѤ¹¤ëÁ°¤ËÀ©¸æ¥Ö¥í¥Ã¥¯¤ò 0 ¤Ë¤·¤Æ¤ª¤¯¤Î¤Ï¡¢¤è¤¤¹Í¤¨¤Ç¤¢¤ë¡£
188 .\"O This control block must not be changed while the write operation
189 .\"O is in progress.
190 ¤³¤ÎÀ©¸æ¥Ö¥í¥Ã¥¯¤Ï¡¢Æɤ߹þ¤ßÁàºî¤¬¿Ê¹Ô¤·¤Æ¤¤¤ë´Ö¤ÏÊѹ¹¤¹¤Ù¤­¤Ç¤Ê¤¤¡£
191 .\"O The buffer area being written out
192 .\"O .\" or the control block of the operation
193 .\"O must not be accessed during the operation or undefined results may
194 .\"O occur.
195 .\"O The memory areas involved must remain valid.
196 Æɤ߹þ¤Þ¤ì¤ë¥Ð¥Ã¥Õ¥¡Îΰè¤Ï
197 .\" ¤Þ¤¿¤ÏÁàºî¤ÎÀ©¸æ¥Ö¥í¥Ã¥¯¤Ï
198 Áàºî¤ÎºÇÃæ¤Ë¥¢¥¯¥»¥¹¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£
199 ¤µ¤â¤Ê¤¤¤Èµ¯¤³¤ë·ë²Ì¤¬ÉÔÄê¤Ë¤Ê¤ë¡£
200 ¤³¤ì¤Ë´Þ¤Þ¤ì¤ë¥á¥â¥êÎΰè¤Ï¡¢Í­¸ú¤Ê¤Þ¤Þ¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
201 .\"O .SH "SEE ALSO"
202 .SH ´ØÏ¢¹àÌÜ
203 .BR aio_cancel (3),
204 .BR aio_error (3),
205 .BR aio_fsync (3),
206 .BR aio_read (3),
207 .BR aio_return (3),
208 .BR aio_suspend (3)