1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" This manpage is Copyright (C) 2006 Jens Axboe
4 .\" and Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
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.
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.
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
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
26 .\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI
27 .\" all rights reserved.
28 .\" Translated 2007-02-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
30 .TH VMSPLICE 2 2009-09-15 "Linux" "Linux Programmer's Manual"
32 .\"O vmsplice \- splice user pages into a pipe
34 vmsplice \- ¥æ¡¼¥¶¡¦¥Ú¡¼¥¸¤ò¥Ñ¥¤¥×¤Ë·Ñ¤®¹ç¤ï¤»¤ë
38 .B #define _GNU_SOURCE
40 .B #include <sys/uio.h>
42 .BI "ssize_t vmsplice(int " fd ", const struct iovec *" iov ,
43 .BI " unsigned long " nr_segs ", unsigned int " flags );
45 .\" Return type was long before glibc 2.7
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.
59 .\"O ranges of user memory described by
62 .\"O The file descriptor
64 .\"O must refer to a pipe.
68 ¤Ç»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¡¦¥á¥â¥ê¤Î
70 ¤ÎÈϰϤò¥Ñ¥¤¥×¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¡£
72 ¤Ï¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
76 .\"O points to an array of
78 .\"O structures as defined in
79 .\"O .IR <sys/uio.h> :
88 ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
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; /* ¥Ð¥¤¥È¿ô */
103 .\"O argument is a bit mask that is composed by ORing together
104 .\"O zero or more of the following values:
106 °ú¤¿ô¤Ë¤Ï¡¢°Ê²¼¤ÎÃͤΠ0 ¸Ä°Ê¾å¤ò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýϤηÁ¤Ç»ØÄꤹ¤ë¡£
110 .\"O .BR vmsplice ();
119 .\" Not used for vmsplice
120 .\" May be in the future -- therefore EAGAIN
121 .\"O Do not block on I/O; see
123 .\"O for further details.
124 Æþ½ÐÎϤÇÄä»ß (block) ¤·¤Ê¤¤¡£¾ÜºÙ¤Ï
129 .\"O Currently has no effect for
130 .\"O .BR vmsplice (),
131 .\"O but may be implemented in the future; see
135 ¤Ç¤Ï²¿¤Î¸ú²Ì¤â¤Ê¤¤¤¬¡¢¾ÍèŪ¤Ë¤Ï¼ÂÁõ¤µ¤ì¤ë²ÄǽÀ¤¬¤¢¤ë¡£
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
151 .\"O .B SPLICE_F_MOVE
152 .\"O can successfully move the pages;
153 ¥Ú¡¼¥¸¤ò¥«¡¼¥Í¥ë¤ËÅϤ¹¤È¡¢¤³¤Î¼¡¤Î
156 ¤Ç¤½¤Î¥Ú¡¼¥¸¤Î°ÜÆ°¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤¤ë¡£
157 .\"O if this flag is not specified, then a subsequent
159 .\"O .B SPLICE_F_MOVE
160 .\"O must copy the pages.
161 ¤³¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¤³¤Î¼¡¤Î
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
171 .\"O Upon successful completion,
173 .\"O returns the number of bytes transferred to the pipe.
178 .\"O is set to indicate the error.
181 ¤Ï¥Ñ¥¤¥×¤ËžÁ÷¤·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
186 ¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£
192 .\"O either not valid, or doesn't refer to a pipe.
194 ¤¬Í¸ú¤Ç¤Ê¤¤¡¢¤â¤·¤¯¤Ï¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£
198 .\"O is 0 or greater than
200 .\"O or memory not aligned if
201 .\"O .B SPLICE_F_GIFT
208 ¤¬ÀßÄꤵ¤ì¤¿¤¬¥á¥â¥ê¤¬¥Ú¡¼¥¸¶³¦¤Ë¤¢¤Ã¤Æ¤¤¤Ê¤¤¡£
217 .\"O system call first appeared in Linux 2.6.17.
219 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6.17 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
220 .\"O .SH "CONFORMING TO"
222 .\"O This system call is Linux-specific.
223 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇͤǤ¢¤ë¡£
227 .\"O follows the other vectorized read/write type functions when it comes to
228 .\"O limitations on number of segments being passed in.
232 .\"O .IR <limits.h> .
233 .\"O At the time of this writing, that limit is 1024.
234 »ØÄꤵ¤ì¤¿¥»¥°¥á¥ó¥È¿ô¤¬¾å¸Â¤Ë㤷¤¿¾ì¹ç¡¢
236 ¤Ï¾¤Î¥Ù¥¯¥È¥ë·Á¼°¤Î read/write ¤ò¹Ô¤¦´Ø¿ô¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¡£
242 ¤³¤Î¥É¥¥å¥á¥ó¥È¤ò½ñ¤¤¤¿»þÅÀ¤Ç¤ÎÃÍ¤Ï 1024 ¤Ç¤¢¤ë¡£
247 .BR feature_test_macros (7)