OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man2 / vmsplice.2
1 .\" This manpage is Copyright (C) 2006 Jens Axboe
2 .\" and Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\"*******************************************************************
27 .\"
28 .\" This file was generated with po4a. Translate the source file.
29 .\"
30 .\"*******************************************************************
31 .\"
32 .\" Japanese Version Copyright (c) 2007  Akihiro MOTOKI
33 .\"         all rights reserved.
34 .\" Translated 2007-02-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
35 .\"
36 .TH VMSPLICE 2 2012\-05\-04 Linux "Linux Programmer's Manual"
37 .SH 名前
38 vmsplice \- ユーザ・ページをパイプに継ぎ合わせる
39 .SH 書式
40 .nf
41 \fB#define _GNU_SOURCE\fP         /* feature_test_macros(7) 参照 */
42 \fB#include <fcntl.h>\fP
43 \fB#include <sys/uio.h>\fP
44
45 \fBssize_t vmsplice(int \fP\fIfd\fP\fB, const struct iovec *\fP\fIiov\fP\fB,\fP
46 \fB                 unsigned long \fP\fInr_segs\fP\fB, unsigned int \fP\fIflags\fP\fB);\fP
47 .fi
48 .\" Return type was long before glibc 2.7
49 .SH 説明
50 .\" Linus: vmsplice() system call to basically do a "write to
51 .\" the buffer", but using the reference counting and VM traversal
52 .\" to actually fill the buffer. This means that the user needs to
53 .\" be careful not to reuse the user-space buffer it spliced into
54 .\" the kernel-space one (contrast this to "write()", which copies
55 .\" the actual data, and you can thus reuse the buffer immediately
56 .\" after a successful write), but that is often easy to do.
57 \fBvmsplice\fP()  システムコールは、 \fIiov\fP で指定されたユーザ・メモリの \fInr_segs\fP の範囲をパイプにマッピングする。
58 \fIfd\fP はパイプを参照していなければならない。
59
60 ポインタ \fIiov\fP は \fIiovec\fP 構造体の配列を指す。 \fIiovec\fP 構造体は \fI<sys/uio.h>\fP
61 で以下のように定義されている:
62
63 .in +4n
64 .nf
65 struct iovec {
66     void  *iov_base;            /* 開始アドレス */
67     size_t iov_len;             /* バイト数 */
68 };
69 .in
70 .fi
71
72 \fIflags\fP 引き数には、以下の値の 0 個以上をビット毎の論理和の形で指定する。
73 .TP  1.9i
74 \fBSPLICE_F_MOVE\fP
75 \fBvmsplice\fP()  では未使用。 \fBsplice\fP(2)  参照。
76 .TP 
77 \fBSPLICE_F_NONBLOCK\fP
78 .\" Not used for vmsplice
79 .\" May be in the future -- therefore EAGAIN
80 入出力で停止 (block) しない。詳細は \fBsplice\fP(2)  参照。
81 .TP 
82 \fBSPLICE_F_MORE\fP
83 現在のところ \fBvmsplice\fP()  では何の効果もないが、将来的には実装される可能性がある。 \fBsplice\fP(2)  参照。
84 .TP 
85 \fBSPLICE_F_GIFT\fP
86 .\" FIXME Explain the following line in a little more detail:
87 .\" .... if we expect to later SPLICE_F_MOVE to the cache.
88 ユーザ・ページがカーネルへ渡すもの (gift) であることを示す。 アプリケーションはこのメモリを絶対に変更してはならない。
89 さもなければ、ページキャッシュとディスク上のデータは 一致しなくなるだろう。 ページをカーネルに渡すと、この次の \fBsplice\fP(2)
90 \fBSPLICE_F_MOVE\fP でそのページの移動を行うことができる。 このフラグが指定されなかった場合、この次の \fBsplice\fP(2)
91 \fBSPLICE_F_MOVE\fP でそのページのコピーを行わなければならない。 データはメモリ上でページ境界にあっていなければならず、
92 長さもページ境界の倍数でなければならない。
93 .SH 返り値
94 成功して完了すると、 \fBvmsplice\fP()  はパイプに転送したバイト数を返す。 エラーの場合、 \fBvmplice\fP()  は \-1 を返し、
95 \fIerrno\fP をエラーを示す値に設定する。
96 .SH エラー
97 .TP 
98 \fBEBADF\fP
99 \fIfd\fP が有効でない、もしくはパイプを参照していない。
100 .TP 
101 \fBEINVAL\fP
102 \fInr_segs\fP が 0 もしくは \fBIOV_MAX\fP よりも大きい。または \fBSPLICE_F_GIFT\fP
103 が設定されたがメモリがページ境界にあっていない。
104 .TP 
105 \fBENOMEM\fP
106 メモリ不足。
107 .SH バージョン
108 \fBvmsplice\fP() システムコールは Linux 2.6.17 で初めて登場した。
109 ライブラリによるサポートは glibc バージョン 2.5 で追加された。
110 .SH 準拠
111 このシステムコールは Linux 固有である。
112 .SH 注意
113 指定されたセグメント数が上限に達した場合、 \fBvmsplice\fP()  は他のベクトル形式の read/write を行う関数と同じ動作をする。
114 上限は \fBIOV_MAX\fP であり、 \fI<limits.h>\fP で定義されている。 このドキュメントを書いた時点での値は 1024
115 である。
116 .SH 関連項目
117 \fBsplice\fP(2), \fBtee\fP(2)
118 .SH この文書について
119 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
120 である。プロジェクトの説明とバグ報告に関する情報は
121 http://www.kernel.org/doc/man\-pages/ に書かれている。