OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man2 / vmsplice.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" This manpage is Copyright (C) 2006 Jens Axboe
4 .\" and 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) 2007  Akihiro MOTOKI
27 .\"         all rights reserved.
28 .\" Translated 2007-02-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
29 .\" 
30 .TH VMSPLICE 2 2009-09-15 "Linux" "Linux Programmer's Manual"
31 .\"O .SH NAME
32 .\"O vmsplice \- splice user pages into a pipe
33 .SH Ì¾Á°
34 vmsplice \- ¥æ¡¼¥¶¡¦¥Ú¡¼¥¸¤ò¥Ñ¥¤¥×¤Ë·Ñ¤®¹ç¤ï¤»¤ë
35 .\"O .SH SYNOPSIS
36 .SH ½ñ¼°
37 .nf
38 .B #define _GNU_SOURCE
39 .B #include <fcntl.h>
40 .B #include <sys/uio.h>
41
42 .BI "ssize_t vmsplice(int " fd ", const struct iovec *" iov ,
43 .BI "                 unsigned long " nr_segs ", unsigned int " flags );
44 .fi
45 .\" Return type was long before glibc 2.7
46 .\"O .SH DESCRIPTION
47 .SH ÀâÌÀ
48 .\" Linus: vmsplice() system call to basically do a "write to
49 .\" the buffer", but using the reference counting and VM traversal
50 .\" to actually fill the buffer. This means that the user needs to
51 .\" be careful not to reuse the user-space buffer it spliced into
52 .\" the kernel-space one (contrast this to "write()", which copies
53 .\" the actual data, and you can thus reuse the buffer immediately
54 .\" after a successful write), but that is often easy to do.
55 .\"O The
56 .\"O .BR vmsplice ()
57 .\"O system call maps
58 .\"O .I nr_segs
59 .\"O ranges of user memory described by
60 .\"O .I iov
61 .\"O into a pipe.
62 .\"O The file descriptor
63 .\"O .I fd
64 .\"O must refer to a pipe.
65 .BR vmsplice ()
66 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢
67 .I iov
68 ¤Ç»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¡¦¥á¥â¥ê¤Î
69 .I nr_segs
70 ¤ÎÈϰϤò¥Ñ¥¤¥×¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¡£
71 .I fd
72 ¤Ï¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
73
74 .\"O The pointer
75 .\"O .I iov
76 .\"O points to an array of
77 .\"O .I iovec
78 .\"O structures as defined in
79 .\"O .IR <sys/uio.h> :
80 ¥Ý¥¤¥ó¥¿
81 .I iov
82 ¤Ï
83 .I iovec
84 ¹½Â¤ÂΤÎÇÛÎó¤ò»Ø¤¹¡£
85 .I iovec
86 ¹½Â¤ÂΤÏ
87 .I <sys/uio.h>
88 ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
89
90 .in +4n
91 .nf
92 struct iovec {
93 .\"O     void  *iov_base;            /* Starting address */
94 .\"O     size_t iov_len;             /* Number of bytes */
95     void  *iov_base;            /* ³«»Ï¥¢¥É¥ì¥¹ */
96     size_t iov_len;             /* ¥Ð¥¤¥È¿ô */
97 };
98 .in
99 .fi
100
101 .\"O The
102 .\"O .I flags
103 .\"O argument is a bit mask that is composed by ORing together
104 .\"O zero or more of the following values:
105 .I flags
106 °ú¤­¿ô¤Ë¤Ï¡¢°Ê²¼¤ÎÃͤΠ0 ¸Ä°Ê¾å¤ò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýϤηÁ¤Ç»ØÄꤹ¤ë¡£
107 .TP 1.9i
108 .B SPLICE_F_MOVE
109 .\"O Unused for
110 .\"O .BR vmsplice ();
111 .\"O see
112 .\"O .BR splice (2).
113 .BR vmsplice ()
114 ¤Ç¤Ï̤»ÈÍÑ¡£
115 .BR splice (2)
116 »²¾È¡£
117 .TP
118 .B SPLICE_F_NONBLOCK
119 .\" Not used for vmsplice
120 .\" May be in the future -- therefore EAGAIN
121 .\"O Do not block on I/O; see
122 .\"O .BR splice (2)
123 .\"O for further details.
124 Æþ½ÐÎϤÇÄä»ß (block) ¤·¤Ê¤¤¡£¾ÜºÙ¤Ï
125 .BR splice (2)
126 »²¾È¡£
127 .TP
128 .B SPLICE_F_MORE
129 .\"O Currently has no effect for
130 .\"O .BR vmsplice (),
131 .\"O but may be implemented in the future; see
132 .\"O .BR splice (2).
133 ¸½ºß¤Î¤È¤³¤í
134 .BR vmsplice ()
135 ¤Ç¤Ï²¿¤Î¸ú²Ì¤â¤Ê¤¤¤¬¡¢¾­ÍèŪ¤Ë¤Ï¼ÂÁõ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
136 .BR splice (2)
137 »²¾È¡£
138 .TP
139 .B SPLICE_F_GIFT
140 .\"O The user pages are a gift to the kernel.
141 .\"O The application may not modify this memory ever,
142 .\"O .\" FIXME Explain the following line in a little more detail:
143 .\"O or page cache and on-disk data may differ.
144 ¥æ¡¼¥¶¡¦¥Ú¡¼¥¸¤¬¥«¡¼¥Í¥ë¤ØÅϤ¹¤â¤Î (gift) ¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£
145 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤Î¥á¥â¥ê¤òÀäÂФËÊѹ¹¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
146 .\" FIXME Explain the following line in a little more detail:
147 ¤µ¤â¤Ê¤±¤ì¤Ð¡¢¥Ú¡¼¥¸¥­¥ã¥Ã¥·¥å¤È¥Ç¥£¥¹¥¯¾å¤Î¥Ç¡¼¥¿¤Ï
148 °ìÃפ·¤Ê¤¯¤Ê¤ë¤À¤í¤¦¡£
149 .\"O Gifting pages to the kernel means that a subsequent
150 .\"O .BR splice (2)
151 .\"O .B SPLICE_F_MOVE
152 .\"O can successfully move the pages;
153 ¥Ú¡¼¥¸¤ò¥«¡¼¥Í¥ë¤ËÅϤ¹¤È¡¢¤³¤Î¼¡¤Î
154 .BR splice (2)
155 .B SPLICE_F_MOVE
156 ¤Ç¤½¤Î¥Ú¡¼¥¸¤Î°ÜÆ°¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£
157 .\"O if this flag is not specified, then a subsequent
158 .\"O .BR splice (2)
159 .\"O .B SPLICE_F_MOVE
160 .\"O must copy the pages.
161 ¤³¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¤³¤Î¼¡¤Î
162 .BR splice (2)
163 .B SPLICE_F_MOVE
164 ¤Ç¤½¤Î¥Ú¡¼¥¸¤Î¥³¥Ô¡¼¤ò¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
165 .\"O Data must also be properly page aligned, both in memory and length.
166 ¥Ç¡¼¥¿¤Ï¥á¥â¥ê¾å¤Ç¥Ú¡¼¥¸¶­³¦¤Ë¤¢¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢
167 Ťµ¤â¥Ú¡¼¥¸¶­³¦¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
168 .\" .... if we expect to later SPLICE_F_MOVE to the cache.
169 .\"O .SH RETURN VALUE
170 .SH ÊÖ¤êÃÍ
171 .\"O Upon successful completion,
172 .\"O .BR vmsplice ()
173 .\"O returns the number of bytes transferred to the pipe.
174 .\"O On error,
175 .\"O .BR vmsplice ()
176 .\"O returns \-1 and
177 .\"O .I errno
178 .\"O is set to indicate the error.
179 À®¸ù¤·¤Æ´°Î»¤¹¤ë¤È¡¢
180 .BR vmsplice ()
181 ¤Ï¥Ñ¥¤¥×¤ËžÁ÷¤·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
182 ¥¨¥é¡¼¤Î¾ì¹ç¡¢
183 .BR vmplice ()
184 ¤Ï \-1 ¤òÊÖ¤·¡¢
185 .I errno
186 ¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£
187 .\"O .SH ERRORS
188 .SH ¥¨¥é¡¼
189 .TP
190 .B EBADF
191 .\"O .I fd
192 .\"O either not valid, or doesn't refer to a pipe.
193 .I fd
194 ¤¬Í­¸ú¤Ç¤Ê¤¤¡¢¤â¤·¤¯¤Ï¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£
195 .TP
196 .B EINVAL
197 .\"O .I nr_segs
198 .\"O is 0 or greater than
199 .\"O .BR IOV_MAX ;
200 .\"O or memory not aligned if
201 .\"O .B SPLICE_F_GIFT
202 .\"O set.
203 .I nr_segs
204 ¤¬ 0 ¤â¤·¤¯¤Ï
205 .B IOV_MAX
206 ¤è¤ê¤âÂ礭¤¤¡£¤Þ¤¿¤Ï
207 .B SPLICE_F_GIFT
208 ¤¬ÀßÄꤵ¤ì¤¿¤¬¥á¥â¥ê¤¬¥Ú¡¼¥¸¶­³¦¤Ë¤¢¤Ã¤Æ¤¤¤Ê¤¤¡£
209 .TP
210 .B ENOMEM
211 .\"O Out of memory.
212 ¥á¥â¥êÉÔ­¡£
213 .\"O .SH VERSIONS
214 .SH ¥Ð¡¼¥¸¥ç¥ó
215 .\"O The
216 .\"O .BR vmsplice ()
217 .\"O system call first appeared in Linux 2.6.17.
218 .BR vmsplice ()
219 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6.17 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
220 .\"O .SH "CONFORMING TO"
221 .SH ½àµò
222 .\"O This system call is Linux-specific.
223 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£
224 .\"O .SH NOTES
225 .SH È÷¹Í
226 .\"O .BR vmsplice ()
227 .\"O follows the other vectorized read/write type functions when it comes to
228 .\"O limitations on number of segments being passed in.
229 .\"O This limit is
230 .\"O .B IOV_MAX
231 .\"O as defined in
232 .\"O .IR <limits.h> .
233 .\"O At the time of this writing, that limit is 1024.
234 »ØÄꤵ¤ì¤¿¥»¥°¥á¥ó¥È¿ô¤¬¾å¸Â¤Ë㤷¤¿¾ì¹ç¡¢
235 .BR vmsplice ()
236 ¤Ï¾¤Î¥Ù¥¯¥È¥ë·Á¼°¤Î read/write ¤ò¹Ô¤¦´Ø¿ô¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¡£
237 ¾å¸Â¤Ï
238 .B IOV_MAX
239 ¤Ç¤¢¤ê¡¢
240 .I <limits.h>
241 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
242 ¤³¤Î¥É¥­¥å¥á¥ó¥È¤ò½ñ¤¤¤¿»þÅÀ¤Ç¤ÎÃͤϠ1024 ¤Ç¤¢¤ë¡£
243 .\"O .SH SEE ALSO
244 .SH ´ØÏ¢¹àÌÜ
245 .BR splice (2),
246 .BR tee (2),
247 .BR feature_test_macros (7)