OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man2 / splice.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 .\" Updated 2008-11-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.13
30 .\" 
31 .TH SPLICE 2 2009-09-15 "Linux" "Linux Programmer's Manual"
32 .\"O .SH NAME
33 .SH Ì¾Á°
34 .\"O splice \- splice data to/from a pipe
35 splice \- ¥Ñ¥¤¥×¤È¤Î´Ö¤Ç¥Ç¡¼¥¿¤ò·Ñ¤®¹ç¤ï¤»¤ë
36 .\"O .SH SYNOPSIS
37 .SH ½ñ¼°
38 .nf
39 .B #define _GNU_SOURCE
40 .B #include <fcntl.h>
41
42 .BI "ssize_t splice(int " fd_in ", loff_t *" off_in ", int " fd_out ,
43 .BI "               loff_t *" off_out ", size_t " len \
44 ", unsigned int " flags );
45 .fi
46 .\" Return type was long before glibc 2.7
47 .\"O .SH DESCRIPTION
48 .SH ÀâÌÀ
49 .\"O .BR splice ()
50 .\"O moves data between two file descriptors
51 .\"O without copying between kernel address space and user address space.
52 .\"O It transfers up to
53 .\"O .I len
54 .\"O bytes of data from the file descriptor
55 .\"O .I fd_in
56 .\"O to the file descriptor
57 .\"O .IR fd_out ,
58 .\"O where one of the descriptors must refer to a pipe.
59 .BR splice ()
60 ¤Ï¡¢¥«¡¼¥Í¥ë¥¢¥É¥ì¥¹¶õ´Ö¤È¥æ¡¼¥¶¥¢¥É¥ì¥¹¶õ´Ö¤È¤Î´Ö¤Î¥³¥Ô¡¼¤òȼ¤ï¤º¤Ë¡¢
61 2 ¤Ä¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿´Ö¤Ç¥Ç¡¼¥¿¤Î°ÜÆ°¤ò¹Ô¤¦¡£
62 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
63 .I fd_in
64 ¤«¤é¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
65 .I fd_out
66 ¤ØºÇÂç
67 .I len
68 ¥Ð¥¤¥È¤òžÁ÷¤¹¤ë¡£
69 2 ¤Ä¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤¦¤Á°ì¤Ä¤Ï
70 ¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
71 .PP
72 .\"O If
73 .\"O .I fd_in
74 .\"O refers to a pipe, then
75 .\"O .I off_in
76 .\"O must be NULL.
77 .I fd_in
78 ¤¬¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢
79 .I off_in
80 ¤Ï NULL ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
81 .\"O If
82 .\"O .I fd_in
83 .\"O does not refer to a pipe and
84 .\"O .I off_in
85 .\"O is NULL, then bytes are read from
86 .\"O .I fd_in
87 .\"O starting from the current file offset,
88 .\"O and the current file offset is adjusted appropriately.
89 .I fd_in
90 ¤¬¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤ª¤é¤º¡¢
91 .I off_in
92 ¤¬ NULL ¤Î¾ì¹ç¡¢
93 .I fd_in
94 ¤Î¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤«¤é»Ï¤Þ¤ë¥Ð¥¤¥È¤òÆɤ߽Ф¹¡£
95 ¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ÏŬÀÚ¤ËÄ´À°¤µ¤ì¤ë¡£
96 .\"O If
97 .\"O .I fd_in
98 .\"O does not refer to a pipe and
99 .\"O .I off_in
100 .\"O is not NULL, then
101 .\"O .I off_in
102 .\"O must point to a buffer which specifies the starting
103 .\"O offset from which bytes will be read from
104 .\"O .IR fd_in ;
105 .\"O in this case, the current file offset of
106 .\"O .I fd_in
107 .\"O is not changed.
108 .I fd_in
109 ¤¬¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤ª¤é¤º¡¢
110 .I off_in
111 ¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢
112 .I off_in
113 ¤Ï
114 .I fd_in
115 ¤«¤é¤Î¥Ç¡¼¥¿Æɤ߽Ф·¤ò³«»Ï¤¹¤ëÀèƬ¥ª¥Õ¥»¥Ã¥È¤ò³ÊǼ¤·¤¿¥Ð¥Ã¥Õ¥¡
116 ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤Î¾ì¹ç¡¢
117 .I fd_in
118 ¤Î¸½ºß¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£
119 .\"O Analogous statements apply for
120 .\"O .I fd_out
121 .\"O and
122 .\"O .IR off_out .
123 .I fd_out
124 ¤È
125 .I off_out
126 ¤Ë´Ø¤·¤Æ¤âƱÍͤǤ¢¤ë¡£
127 .PP
128 .\"O The
129 .\"O .I flags
130 .\"O argument is a bit mask that is composed by ORing together
131 .\"O zero or more of the following values:
132 .I flags
133 °ú¤­¿ô¤Ë¤Ï¡¢°Ê²¼¤ÎÃͤΠ0 ¸Ä°Ê¾å¤Î¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýϤò
134 ¤È¤Ã¤¿¤â¤Î¤ò»ØÄꤹ¤ë:
135 .TP 1.9i
136 .B SPLICE_F_MOVE
137 .\"O Attempt to move pages instead of copying.
138 .\"O This is only a hint to the kernel:
139 .\"O pages may still be copied if the kernel cannot move the
140 .\"O pages from the pipe, or if
141 .\"O the pipe buffers don't refer to full pages.
142 ¥Ú¡¼¥¸¤Î¥³¥Ô¡¼¤Ç¤Ê¤¯°ÜÆ°¤ò»î¤ß¤ë¡£
143 ¤³¤ì¤Ï¥«¡¼¥Í¥ë¤ËÂФ¹¤ë¥Ò¥ó¥È¤Ç¤·¤«¤Ê¤¤¡£
144 ¤Ä¤Þ¤ê¡¢¥«¡¼¥Í¥ë¤¬¥Ñ¥¤¥×¤«¤é¥Ú¡¼¥¸¤ò°ÜÆ°¤Ç¤­¤Ê¤¤¾ì¹ç¤ä¡¢
145 ¥Ñ¥¤¥×¥Ð¥Ã¥Õ¥¡¤¬¥Ú¡¼¥¸Á´Éô¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢
146 ¥Ú¡¼¥¸¤Î¥³¥Ô¡¼¤¬¹Ô¤ï¤ì¤ë¤³¤È¤â¤¢¤ë¡£
147 .\"O The initial implementation of this flag was buggy:
148 .\"O therefore starting in Linux 2.6.21 it is a no-op
149 .\"O (but is still permitted in a
150 .\"O .BR splice ()
151 .\"O call);
152 .\"O in the future, a correct implementation may be restored.
153 ¤³¤Î¥Õ¥é¥°¤ÎºÇ½é¤Î¼ÂÁõ¤Ë¤Ï¥Ð¥°¤¬¤¢¤Ã¤¿¡£¤½¤Î¤¿¤á¡¢
154 Linux 2.6.21 °Ê¹ß¤Ç¤Ï¤³¤Î¥Õ¥é¥°¤ÎÁàºî¤Ï¤Ç¤­¤Ê¤¤¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë
155 (¤¿¤À¤·¡¢
156 .BR splice ()
157 ¥³¡¼¥ë¤Ç¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤Ïº£¤âǧ¤á¤é¤ì¤Æ¤¤¤ë)¡£
158 ¾­Íè¡¢Àµ¤·¤¤¼ÂÁõ¤¬¹Ô¤ï¤ì¤ë¤³¤È¤À¤í¤¦¡£
159 .TP
160 .B SPLICE_F_NONBLOCK
161 .\"O Do not block on I/O.
162 .\"O This makes the splice pipe operations nonblocking, but
163 .\"O .BR splice ()
164 .\"O may nevertheless block because the file descriptors that
165 .\"O are spliced to/from may block (unless they have the
166 .\"O .B O_NONBLOCK
167 .\"O flag set).
168 Æþ½ÐÎÏ»þ¤ËÄä»ß (block) ¤·¤Ê¤¤¡£
169 ¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢
170 splice ¤Ë¤è¤ë¥Ñ¥¤¥×Áàºî¤òÈóÄä»ß¥â¡¼¥É (nonblocking) ¤Ç
171 ¹Ô¤ª¤¦¤È¤¹¤ë¤¬¡¢¤½¤Î¾ì¹ç¤Ç¤â
172 .BR splice ()
173 ¤ÏÄä»ß¤¹¤ë¤³¤È¤â¤¢¤ë¡£¤Ê¤¼¤Ê¤é¡¢¥Ç¡¼¥¿¤Î¤ä¤ê¼è¤ê¤ò¹Ô¤¦
174 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï
175 .RB ( O_NONBLOCK
176 ¥Õ¥é¥°¤ò¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç) Ää»ß¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¤«¤é¤Ç¤¢¤ë¡£
177 .TP
178 .B SPLICE_F_MORE
179 .\"O More data will be coming in a subsequent splice.
180 .\"O This is a helpful hint when
181 .\"O the
182 .\"O .I fd_out
183 .\"O refers to a socket (see also the description of
184 .\"O .B MSG_MORE
185 .\"O in
186 .\"O .BR send (2),
187 .\"O and the description of
188 .\"O .B TCP_CORK
189 .\"O in
190 .\"O .BR tcp (7))
191 ¤³¤Î¸å¤Î splice ¤Ç¤µ¤é¤ËžÁ÷¤µ¤ì¤ë¥Ç¡¼¥¿¤¬¤¢¤ë¤³¤È¤ò¼¨¤¹¡£
192 ¤³¤Î¥Õ¥é¥°¤Ï
193 .I fd_out
194 ¤¬¥½¥±¥Ã¥È¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤ËÍ­ÍѤʥҥó¥È¤È¤Ê¤ë
195 .RB ( send (2)
196 ¤Î
197 .B MSG_MORE
198 ¤ä
199 .BR tcp (7)
200 ¤Î
201 .B TCP_CORK
202 ¤ÎÀâÌÀ¤â»²¾È)¡£
203 .TP
204 .B SPLICE_F_GIFT
205 .\"O Unused for
206 .\"O .BR splice ();
207 .\"O see
208 .\"O .BR vmsplice (2).
209 .BR splice ()
210 ¤Ç¤Ï»ÈÍѤ·¤Ê¤¤¡£
211 .BR vmsplice (2)
212 »²¾È¡£
213 .\"O .SH RETURN VALUE
214 .SH ÊÖ¤êÃÍ
215 .\"O Upon successful completion,
216 .\"O .BR splice ()
217 .\"O returns the number of bytes
218 .\"O spliced to or from the pipe.
219 .\"O A return value of 0 means that there was no data to transfer,
220 .\"O and it would not make sense to block, because there are no
221 .\"O writers connected to the write end of the pipe referred to by
222 .\"O .IR fd_in .
223 À®¸ù¤·¤Æ´°Î»¤¹¤ë¤È¡¢
224 .BR splice ()
225 ¤Ï¥Ñ¥¤¥×¤«¤é½Ð¤·Æþ¤ì¤·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
226 ÊÖ¤êÃÍ 0 ¤Ï¥Ç¡¼¥¿¤ÎžÁ÷¤¬¹Ô¤ï¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤¹¡£
227 ¤³¤Î¾ì¹ç¡¢½èÍý¤òÄä»ß (block) ¤·¤Æ¤â̵°ÕÌ£¤Ç¤¢¤ë¡£
228 ¤Ê¤¼¤Ê¤é¡¢
229 .I fd_in
230 ¤¬»²¾È¤¹¤ë¥Ñ¥¤¥×¤Î½ñ¤­¹þ¤ß¦¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¼Ô¤¬¤¤¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£
231 .PP
232 .\"O On error,
233 .\"O .BR splice ()
234 .\"O returns \-1 and
235 .\"O .I errno
236 .\"O is set to indicate the error.
237 ¥¨¥é¡¼¤Î¾ì¹ç¡¢
238 .BR splice ()
239 ¤Ï \-1 ¤òÊÖ¤·¡¢
240 .I errno
241 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
242 .\"O .SH ERRORS
243 .SH ¥¨¥é¡¼
244 .TP
245 .B EBADF
246 .\"O One or both file descriptors are not valid,
247 .\"O or do not have proper read-write mode.
248 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î°ìÊý¤Þ¤¿¤ÏξÊý¤¬Í­¸ú¤Ç¤Ï¤Ê¤¤¡¢
249 ¤â¤·¤¯¤ÏŬÀڤʠread-write ¥â¡¼¥É¤Ç¤Ï¤Ê¤¤¡£
250 .TP
251 .B EINVAL
252 .\"O Target file system doesn't support splicing;
253 .\"O target file is opened in append mode;
254 .\"O .\" The append-mode error is given since 2.6.27; in earlier kernels,
255 .\"O .\" splice() in append mode was broken
256 .\"O neither of the descriptors refers to a pipe; or
257 .\"O offset given for nonseekable device.
258 ÂоݤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ splice ¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤¡¢
259 ¤Þ¤¿¤ÏÂоݤΥե¡¥¤¥ë¤¬Äɵ­¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¡¢
260 .\" Äɵ­¥â¡¼¥É¤Ç¤Î¥¨¥é¡¼¤Ï 2.6.27 °Ê¹ß¤ÇȯÀ¸¤¹¤ë¡£
261 .\" ¤½¤ì¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤ÏÄɵ­¥â¡¼¥É¤Ç¤Î splice() ¤ÏÀµ¤·¤¯Æ°ºî¤·¤Ê¤¤¡£
262 ¤Þ¤¿¤Ï¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¤É¤Á¤é¤â¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡¢
263 ¤Þ¤¿¤Ï seek ¤Ç¤­¤Ê¤¤¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ¥ª¥Õ¥»¥Ã¥È¤¬»ØÄꤵ¤ì¤¿¡£
264 .TP
265 .B ENOMEM
266 .\"O Out of memory.
267 ¥á¥â¥êÉÔ­¡£
268 .TP
269 .B ESPIPE
270 .\"O Either
271 .\"O .I off_in
272 .\"O or
273 .\"O .I off_out
274 .\"O was not NULL, but the corresponding file descriptor refers to a pipe.
275 .I off_in
276 ¤«
277 .I off_out
278 ¤Î¤¤¤º¤ì¤«¤¬ NULL ¤Ç¤Ï¤Ê¤¤¤¬¡¢Âбþ¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬
279 ¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤ë¡£
280 .\"O .SH VERSIONS
281 .SH ¥Ð¡¼¥¸¥ç¥ó
282 .\"O The
283 .\"O .BR splice ()
284 .\"O system call first appeared in Linux 2.6.17.
285 .BR splice ()
286 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6.17 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
287 .\"O .SH "CONFORMING TO"
288 .SH ½àµò
289 .\"O This system call is Linux-specific.
290 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£
291 .\"O .SH NOTES
292 .SH Ãí°Õ
293 .\"O The three system calls
294 .\"O .BR splice (),
295 .\"O .BR vmsplice (2),
296 .\"O and
297 .\"O .BR tee (2),
298 .\"O provide userspace programs with full control over an arbitrary
299 .\"O kernel buffer, implemented within the kernel using the same type
300 .\"O of buffer that is used for a pipe.
301 3 ¤Ä¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë
302 .RB ( splice (),
303 .BR vmsplice (2),
304 .BR tee (2))
305 ¤ò»È¤¦¤È¡¢¥æ¡¼¥¶¶õ´Ö¥×¥í¥°¥é¥à¤ÏǤ°Õ¤Î¥«¡¼¥Í¥ë¥Ð¥Ã¥Õ¥¡¤ËÂФ¹¤ë
306 ´°Á´¤ÊÀ©¸æ¤¬¤Ç¤­¤ë¡£¥«¡¼¥Í¥ë¥Ð¥Ã¥Õ¥¡¤Ï¡¢¥Ñ¥¤¥×¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¤Î¤È
307 Ʊ¼ï¤Î¥Ð¥Ã¥Õ¥¡¤ò»È¤Ã¤Æ¥«¡¼¥Í¥ëÆâ¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
308 .\"O In overview, these system calls perform the following tasks:
309 Âç¤Þ¤«¤Ë¤¤¤¦¤È¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï°Ê²¼¤Î»Å»ö¤ò¹Ô¤¦:
310 .TP 1.2i
311 .BR splice ()
312 .\"O moves data from the buffer to an arbitrary file descriptor, or vice versa,
313 .\"O or from one buffer to another.
314 ¥Ð¥Ã¥Õ¥¡¤«¤éǤ°Õ¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ä¡¢¤½¤ÎµÕÊý¸þ¡¢
315 ¤â¤·¤¯¤Ï¤¢¤ë¥Ð¥Ã¥Õ¥¡¤«¤éÊ̤ΥХåե¡¤Ø¤Î¡¢¥Ç¡¼¥¿°ÜÆ°¤ò¹Ô¤¦¡£
316 .TP
317 .BR tee (2)
318 .\"O "copies" the data from one buffer to another.
319 ¤¢¤ë¥Ð¥Ã¥Õ¥¡¤«¤éÊ̤ΥХåե¡¤Ø¤Î¥Ç¡¼¥¿¡Ö¥³¥Ô¡¼¡×¤ò¹Ô¤¦¡£
320 .TP
321 .BR vmsplice (2)
322 .\"O "copies" data from user space into the buffer.
323 ¥æ¡¼¥¶¶õ´Ö¤«¤é¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ç¡¼¥¿¡Ö¥³¥Ô¡¼¡×¤ò¹Ô¤¦¡£
324 .PP
325 .\"O Though we talk of copying, actual copies are generally avoided.
326 .\"O The kernel does this by implementing a pipe buffer as a set
327 .\"O of reference-counted pointers to pages of kernel memory.
328 .\"O The kernel creates "copies" of pages in a buffer by creating new
329 .\"O pointers (for the output buffer) referring to the pages,
330 .\"O and increasing the reference counts for the pages:
331 .\"O only pointers are copied, not the pages of the buffer.
332 ¤³¤³¤Ç¤Ï¥³¥Ô¡¼¤ÎÏäò¤·¤Æ¤¤¤ë¤¬¡¢¼ÂºÝ¤Î¥³¥Ô¡¼¤Ï°ìÈÌŪ¤Ë²óÈò¤µ¤ì¤ë¡£
333 ¥«¡¼¥Í¥ë¤Ï¡¢¥Ñ¥¤¥×¡¦¥Ð¥Ã¥Õ¥¡¤ò¥«¡¼¥Í¥ë¥á¥â¥ê¤Î¥Ú¡¼¥¸¤Ø¤Î¥Ý¥¤¥ó¥¿½¸¹ç¤È¤·¤Æ
334 ¼ÂÁõ¤·¡¢¥Ú¡¼¥¸¤Ø¤Î»²¾È²ó¿ô¤ò´ÉÍý¤¹¤ë¤³¤È¤Ç¡¢¤³¤ì¤ò¼Â¸½¤·¤Æ¤¤¤ë¡£
335 ¥«¡¼¥Í¥ë¤Ï¡¢ÂоݤȤʤë¥Ú¡¼¥¸¤ò»²¾È¤¹¤ë (½ÐÎϥХåե¡ÍѤÎ) ¥Ý¥¤¥ó¥¿¤ò
336 ¿·µ¬¤ËºîÀ®¤¹¤ë¤³¤È¤Ç¥Ð¥Ã¥Õ¥¡Æâ¤Î¥Ú¡¼¥¸¤Î¡Ö¥³¥Ô¡¼¡×¤òºîÀ®¤·¡¢
337 ¤½¤Î¥Ú¡¼¥¸¤Î»²¾È²ó¿ô¤òÁý¤ä¤¹¡£¤Ä¤Þ¤ê¡¢¥Ý¥¤¥ó¥¿¤À¤±¤¬¥³¥Ô¡¼¤µ¤ì¡¢
338 ¥Ð¥Ã¥Õ¥¡¤Î¥Ú¡¼¥¸¤Ï¥³¥Ô¡¼¤µ¤ì¤Ê¤¤¡£
339 .\"
340 .\" Linus: Now, imagine using the above in a media server, for example.
341 .\" Let's say that a year or two has passed, so that the video drivers
342 .\" have been updated to be able to do the splice thing, and what can
343 .\" you do? You can:
344 .\"
345 .\" - splice from the (mpeg or whatever - let's just assume that the video
346 .\"   input is either digital or does the encoding on its own - like they
347 .\"   pretty much all do) video input into a pipe (remember: no copies - the
348 .\"   video input will just DMA directly into memory, and splice will just
349 .\"   set up the pages in the pipe buffer)
350 .\" - tee that pipe to split it up
351 .\" - splice one end to a file (ie "save the compressed stream to disk")
352 .\" - splice the other end to a real-time video decoder window for your
353 .\"   real-time viewing pleasure.
354 .\"
355 .\" Linus: Now, the advantage of splice()/tee() is that you can
356 .\" do zero-copy movement of data, and unlike sendfile() you can
357 .\" do it on _arbitrary_ data (and, as shown by "tee()", it's more
358 .\" than just sending the data to somebody else: you can duplicate
359 .\" the data and choose to forward it to two or more different
360 .\" users - for things like logging etc.).
361 .\"
362 .\"O .SH EXAMPLE
363 .SH Îã
364 .\"O See
365 .\"O .BR tee (2).
366 .BR tee (2)
367 »²¾È¡£
368 .\"O .SH SEE ALSO
369 .SH ´ØÏ¢¹àÌÜ
370 .BR sendfile (2),
371 .BR tee (2),
372 .BR vmsplice (2),
373 .BR feature_test_macros (7)