OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[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 .\"O .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
39 .BR "#define _GNU_SOURCE" "         /* feature_test_macros(7) 参照 */"
40 .B #include <fcntl.h>
41 .B #include <sys/uio.h>
42
43 .BI "ssize_t vmsplice(int " fd ", const struct iovec *" iov ,
44 .BI "                 unsigned long " nr_segs ", unsigned int " flags );
45 .fi
46 .\" Return type was long before glibc 2.7
47 .\"O .SH DESCRIPTION
48 .SH 説明
49 .\" Linus: vmsplice() system call to basically do a "write to
50 .\" the buffer", but using the reference counting and VM traversal
51 .\" to actually fill the buffer. This means that the user needs to
52 .\" be careful not to reuse the user-space buffer it spliced into
53 .\" the kernel-space one (contrast this to "write()", which copies
54 .\" the actual data, and you can thus reuse the buffer immediately
55 .\" after a successful write), but that is often easy to do.
56 .\"O The
57 .\"O .BR vmsplice ()
58 .\"O system call maps
59 .\"O .I nr_segs
60 .\"O ranges of user memory described by
61 .\"O .I iov
62 .\"O into a pipe.
63 .\"O The file descriptor
64 .\"O .I fd
65 .\"O must refer to a pipe.
66 .BR vmsplice ()
67 システムコールは、
68 .I iov
69 で指定されたユーザ・メモリの
70 .I nr_segs
71 の範囲をパイプにマッピングする。
72 .I fd
73 はパイプを参照していなければならない。
74
75 .\"O The pointer
76 .\"O .I iov
77 .\"O points to an array of
78 .\"O .I iovec
79 .\"O structures as defined in
80 .\"O .IR <sys/uio.h> :
81 ポインタ
82 .I iov
83
84 .I iovec
85 構造体の配列を指す。
86 .I iovec
87 構造体は
88 .I <sys/uio.h>
89 で以下のように定義されている:
90
91 .in +4n
92 .nf
93 struct iovec {
94 .\"O     void  *iov_base;            /* Starting address */
95 .\"O     size_t iov_len;             /* Number of bytes */
96     void  *iov_base;            /* 開始アドレス */
97     size_t iov_len;             /* バイト数 */
98 };
99 .in
100 .fi
101
102 .\"O The
103 .\"O .I flags
104 .\"O argument is a bit mask that is composed by ORing together
105 .\"O zero or more of the following values:
106 .I flags
107 引き数には、以下の値の 0 個以上をビット毎の論理和の形で指定する。
108 .TP 1.9i
109 .B SPLICE_F_MOVE
110 .\"O Unused for
111 .\"O .BR vmsplice ();
112 .\"O see
113 .\"O .BR splice (2).
114 .BR vmsplice ()
115 では未使用。
116 .BR splice (2)
117 参照。
118 .TP
119 .B SPLICE_F_NONBLOCK
120 .\" Not used for vmsplice
121 .\" May be in the future -- therefore EAGAIN
122 .\"O Do not block on I/O; see
123 .\"O .BR splice (2)
124 .\"O for further details.
125 入出力で停止 (block) しない。詳細は
126 .BR splice (2)
127 参照。
128 .TP
129 .B SPLICE_F_MORE
130 .\"O Currently has no effect for
131 .\"O .BR vmsplice (),
132 .\"O but may be implemented in the future; see
133 .\"O .BR splice (2).
134 現在のところ
135 .BR vmsplice ()
136 では何の効果もないが、将来的には実装される可能性がある。
137 .BR splice (2)
138 参照。
139 .TP
140 .B SPLICE_F_GIFT
141 .\"O The user pages are a gift to the kernel.
142 .\"O The application may not modify this memory ever,
143 .\"O .\" FIXME Explain the following line in a little more detail:
144 .\"O or page cache and on-disk data may differ.
145 ユーザ・ページがカーネルへ渡すもの (gift) であることを示す。
146 アプリケーションはこのメモリを絶対に変更してはならない。
147 .\" FIXME Explain the following line in a little more detail:
148 さもなければ、ページキャッシュとディスク上のデータは
149 一致しなくなるだろう。
150 .\"O Gifting pages to the kernel means that a subsequent
151 .\"O .BR splice (2)
152 .\"O .B SPLICE_F_MOVE
153 .\"O can successfully move the pages;
154 ページをカーネルに渡すと、この次の
155 .BR splice (2)
156 .B SPLICE_F_MOVE
157 でそのページの移動を行うことができる。
158 .\"O if this flag is not specified, then a subsequent
159 .\"O .BR splice (2)
160 .\"O .B SPLICE_F_MOVE
161 .\"O must copy the pages.
162 このフラグが指定されなかった場合、この次の
163 .BR splice (2)
164 .B SPLICE_F_MOVE
165 でそのページのコピーを行わなければならない。
166 .\"O Data must also be properly page aligned, both in memory and length.
167 データはメモリ上でページ境界にあっていなければならず、
168 長さもページ境界の倍数でなければならない。
169 .\" .... if we expect to later SPLICE_F_MOVE to the cache.
170 .\"O .SH RETURN VALUE
171 .SH 返り値
172 .\"O Upon successful completion,
173 .\"O .BR vmsplice ()
174 .\"O returns the number of bytes transferred to the pipe.
175 .\"O On error,
176 .\"O .BR vmsplice ()
177 .\"O returns \-1 and
178 .\"O .I errno
179 .\"O is set to indicate the error.
180 成功して完了すると、
181 .BR vmsplice ()
182 はパイプに転送したバイト数を返す。
183 エラーの場合、
184 .BR vmplice ()
185 は \-1 を返し、
186 .I errno
187 をエラーを示す値に設定する。
188 .\"O .SH ERRORS
189 .SH エラー
190 .TP
191 .B EBADF
192 .\"O .I fd
193 .\"O either not valid, or doesn't refer to a pipe.
194 .I fd
195 が有効でない、もしくはパイプを参照していない。
196 .TP
197 .B EINVAL
198 .\"O .I nr_segs
199 .\"O is 0 or greater than
200 .\"O .BR IOV_MAX ;
201 .\"O or memory not aligned if
202 .\"O .B SPLICE_F_GIFT
203 .\"O set.
204 .I nr_segs
205 が 0 もしくは
206 .B IOV_MAX
207 よりも大きい。または
208 .B SPLICE_F_GIFT
209 が設定されたがメモリがページ境界にあっていない。
210 .TP
211 .B ENOMEM
212 .\"O Out of memory.
213 メモリ不足。
214 .\"O .SH VERSIONS
215 .SH バージョン
216 .\"O The
217 .\"O .BR vmsplice ()
218 .\"O system call first appeared in Linux 2.6.17.
219 .BR vmsplice ()
220 システムコールは Linux 2.6.17 で初めて登場した。
221 .\"O .SH "CONFORMING TO"
222 .SH 準拠
223 .\"O This system call is Linux-specific.
224 このシステムコールは Linux 固有である。
225 .\"O .SH NOTES
226 .SH 備考
227 .\"O .BR vmsplice ()
228 .\"O follows the other vectorized read/write type functions when it comes to
229 .\"O limitations on number of segments being passed in.
230 .\"O This limit is
231 .\"O .B IOV_MAX
232 .\"O as defined in
233 .\"O .IR <limits.h> .
234 .\"O At the time of this writing, that limit is 1024.
235 指定されたセグメント数が上限に達した場合、
236 .BR vmsplice ()
237 は他のベクトル形式の read/write を行う関数と同じ動作をする。
238 上限は
239 .B IOV_MAX
240 であり、
241 .I <limits.h>
242 で定義されている。
243 このドキュメントを書いた時点での値は 1024 である。
244 .\"O .SH SEE ALSO
245 .SH 関連項目
246 .BR splice (2),
247 .BR tee (2)