OSDN Git Service

fa9109a246f0214ebb60a793fc656a7a9c1e1529
[linuxjm/LDP_man-pages.git] / release / 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 .SH Ì¾Á°
32 vmsplice \- ¥æ¡¼¥¶¡¦¥Ú¡¼¥¸¤ò¥Ñ¥¤¥×¤Ë·Ñ¤®¹ç¤ï¤»¤ë
33 .SH ½ñ¼°
34 .nf
35 .BR "#define _GNU_SOURCE" "         /* feature_test_macros(7) »²¾È */"
36 .B #include <fcntl.h>
37 .B #include <sys/uio.h>
38
39 .BI "ssize_t vmsplice(int " fd ", const struct iovec *" iov ,
40 .BI "                 unsigned long " nr_segs ", unsigned int " flags );
41 .fi
42 .\" Return type was long before glibc 2.7
43 .SH ÀâÌÀ
44 .\" Linus: vmsplice() system call to basically do a "write to
45 .\" the buffer", but using the reference counting and VM traversal
46 .\" to actually fill the buffer. This means that the user needs to
47 .\" be careful not to reuse the user-space buffer it spliced into
48 .\" the kernel-space one (contrast this to "write()", which copies
49 .\" the actual data, and you can thus reuse the buffer immediately
50 .\" after a successful write), but that is often easy to do.
51 .BR vmsplice ()
52 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢
53 .I iov
54 ¤Ç»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¡¦¥á¥â¥ê¤Î
55 .I nr_segs
56 ¤ÎÈϰϤò¥Ñ¥¤¥×¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¡£
57 .I fd
58 ¤Ï¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
59
60 ¥Ý¥¤¥ó¥¿
61 .I iov
62 ¤Ï
63 .I iovec
64 ¹½Â¤ÂΤÎÇÛÎó¤ò»Ø¤¹¡£
65 .I iovec
66 ¹½Â¤ÂΤÏ
67 .I <sys/uio.h>
68 ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
69
70 .in +4n
71 .nf
72 struct iovec {
73     void  *iov_base;            /* ³«»Ï¥¢¥É¥ì¥¹ */
74     size_t iov_len;             /* ¥Ð¥¤¥È¿ô */
75 };
76 .in
77 .fi
78
79 .I flags
80 °ú¤­¿ô¤Ë¤Ï¡¢°Ê²¼¤ÎÃͤΠ0 ¸Ä°Ê¾å¤ò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýϤηÁ¤Ç»ØÄꤹ¤ë¡£
81 .TP 1.9i
82 .B SPLICE_F_MOVE
83 .BR vmsplice ()
84 ¤Ç¤Ï̤»ÈÍÑ¡£
85 .BR splice (2)
86 »²¾È¡£
87 .TP
88 .B SPLICE_F_NONBLOCK
89 .\" Not used for vmsplice
90 .\" May be in the future -- therefore EAGAIN
91 Æþ½ÐÎϤÇÄä»ß (block) ¤·¤Ê¤¤¡£¾ÜºÙ¤Ï
92 .BR splice (2)
93 »²¾È¡£
94 .TP
95 .B SPLICE_F_MORE
96 ¸½ºß¤Î¤È¤³¤í
97 .BR vmsplice ()
98 ¤Ç¤Ï²¿¤Î¸ú²Ì¤â¤Ê¤¤¤¬¡¢¾­ÍèŪ¤Ë¤Ï¼ÂÁõ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
99 .BR splice (2)
100 »²¾È¡£
101 .TP
102 .B SPLICE_F_GIFT
103 ¥æ¡¼¥¶¡¦¥Ú¡¼¥¸¤¬¥«¡¼¥Í¥ë¤ØÅϤ¹¤â¤Î (gift) ¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£
104 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤Î¥á¥â¥ê¤òÀäÂФËÊѹ¹¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
105 .\" FIXME Explain the following line in a little more detail:
106 ¤µ¤â¤Ê¤±¤ì¤Ð¡¢¥Ú¡¼¥¸¥­¥ã¥Ã¥·¥å¤È¥Ç¥£¥¹¥¯¾å¤Î¥Ç¡¼¥¿¤Ï
107 °ìÃפ·¤Ê¤¯¤Ê¤ë¤À¤í¤¦¡£
108 ¥Ú¡¼¥¸¤ò¥«¡¼¥Í¥ë¤ËÅϤ¹¤È¡¢¤³¤Î¼¡¤Î
109 .BR splice (2)
110 .B SPLICE_F_MOVE
111 ¤Ç¤½¤Î¥Ú¡¼¥¸¤Î°ÜÆ°¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£
112 ¤³¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¤³¤Î¼¡¤Î
113 .BR splice (2)
114 .B SPLICE_F_MOVE
115 ¤Ç¤½¤Î¥Ú¡¼¥¸¤Î¥³¥Ô¡¼¤ò¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
116 ¥Ç¡¼¥¿¤Ï¥á¥â¥ê¾å¤Ç¥Ú¡¼¥¸¶­³¦¤Ë¤¢¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢
117 Ťµ¤â¥Ú¡¼¥¸¶­³¦¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
118 .\" .... if we expect to later SPLICE_F_MOVE to the cache.
119 .SH ÊÖ¤êÃÍ
120 À®¸ù¤·¤Æ´°Î»¤¹¤ë¤È¡¢
121 .BR vmsplice ()
122 ¤Ï¥Ñ¥¤¥×¤ËžÁ÷¤·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
123 ¥¨¥é¡¼¤Î¾ì¹ç¡¢
124 .BR vmplice ()
125 ¤Ï \-1 ¤òÊÖ¤·¡¢
126 .I errno
127 ¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£
128 .SH ¥¨¥é¡¼
129 .TP
130 .B EBADF
131 .I fd
132 ¤¬Í­¸ú¤Ç¤Ê¤¤¡¢¤â¤·¤¯¤Ï¥Ñ¥¤¥×¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£
133 .TP
134 .B EINVAL
135 .I nr_segs
136 ¤¬ 0 ¤â¤·¤¯¤Ï
137 .B IOV_MAX
138 ¤è¤ê¤âÂ礭¤¤¡£¤Þ¤¿¤Ï
139 .B SPLICE_F_GIFT
140 ¤¬ÀßÄꤵ¤ì¤¿¤¬¥á¥â¥ê¤¬¥Ú¡¼¥¸¶­³¦¤Ë¤¢¤Ã¤Æ¤¤¤Ê¤¤¡£
141 .TP
142 .B ENOMEM
143 ¥á¥â¥êÉÔ­¡£
144 .SH ¥Ð¡¼¥¸¥ç¥ó
145 .BR vmsplice ()
146 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6.17 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
147 .SH ½àµò
148 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£
149 .SH È÷¹Í
150 »ØÄꤵ¤ì¤¿¥»¥°¥á¥ó¥È¿ô¤¬¾å¸Â¤Ë㤷¤¿¾ì¹ç¡¢
151 .BR vmsplice ()
152 ¤Ï¾¤Î¥Ù¥¯¥È¥ë·Á¼°¤Î read/write ¤ò¹Ô¤¦´Ø¿ô¤ÈƱ¤¸Æ°ºî¤ò¤¹¤ë¡£
153 ¾å¸Â¤Ï
154 .B IOV_MAX
155 ¤Ç¤¢¤ê¡¢
156 .I <limits.h>
157 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
158 ¤³¤Î¥É¥­¥å¥á¥ó¥È¤ò½ñ¤¤¤¿»þÅÀ¤Ç¤ÎÃͤϠ1024 ¤Ç¤¢¤ë¡£
159 .SH ´ØÏ¢¹àÌÜ
160 .BR splice (2),
161 .BR tee (2)