1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" This manpage is Copyright (C) 2006 Jens Axboe
.\" and Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI
.\" all rights reserved.
.\" Translated 2007-02-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\"
.TH VMSPLICE 2 2006-04-28 "Linux" "Linux Programmer's Manual"
.SH ̾
vmsplice \- 桼ڡѥפ˷Ѥ碌
.SH
.nf
.B #define _GNU_SOURCE
.B #include <fcntl.h>
.B #include <sys/uio.h>
.BI "long vmsplice(int " fd ", const struct iovec *" iov ,
.BI " unsigned long " nr_segs ", unsigned int " flags );
.fi
.SH
.\" Linus: vmsplice() system call to basically do a "write to
.\" the buffer", but using the reference counting and VM traversal
.\" to actually fill the buffer. This means that the user needs to
.\" be careful not to re-use the user-space buffer it spliced into
.\" the kernel-space one (contrast this to "write()", which copies
.\" the actual data, and you can thus re-use the buffer immediately
.\" after a successful write), but that is often easy to do.
.BR vmsplice ()
ƥॳϡ
.I iov
ǻꤵ줿桼
.I nr_segs
ϰϤѥפ˥ޥåԥ롣
.I fd
ϥѥפȤƤʤФʤʤ
ݥ
.I iov
.I iovec
¤Τؤ
.I iovec
¤Τ
.I <sys/uio.h>
ǰʲΤ褦Ƥ:
.in +4n
.nf
struct iovec {
void *iov_base; /* ϥɥ쥹 */
size_t iov_len; /* Хȿ */
};
.in
.fi
.I flags
ˤϡʲͤ 0 İʾӥå¤ηǻꤹ롣
.TP 1.9i
.B SPLICE_F_MOVE
.BR vmsplice ()
Ǥ̤ѡ
.BR splice (2)
ȡ
.TP
.B SPLICE_F_NONBLOCK
.\" Not used for vmsplice
.\" May be in the future -- therefore EAGAIN
Ϥ (block) ʤܺ٤
.BR splice (2)
ȡ
.TP
.B SPLICE_F_MORE
ߤΤȤ
.BR vmsplice ()
Ǥϲθ̤ʤŪˤϼǽ롣
.BR splice (2)
ȡ
.TP
.B SPLICE_F_GIFT
桼ڡͥϤ (gift) Ǥ뤳Ȥ
ץꥱϤΥФѹƤϤʤʤ
.\" FIXME Explain the following line in a little more detail:
ʤСڡåȥǥΥǡ
פʤʤ
ڡͥϤȡμ
.BR splice (2)
.B SPLICE_F_MOVE
ǤΥڡΰưԤȤǤ롣
Υե饰ꤵʤä硢μ
.BR splice (2)
.B SPLICE_F_MOVE
ǤΥڡΥԡԤʤФʤʤ
ǡϥǥڡˤäƤʤФʤ餺
ĹڡܿǤʤФʤʤ
.\" .... if we expect to later SPLICE_F_MOVE to the cache.
.SH ֤
ƴλȡ
.BR vmsplice ()
ϥѥפžХȿ֤
顼ξ硢
.BR vmplice ()
\-1 ֤
.I errno
顼ͤꤹ롣
.SH 顼
.TP
.B EBADF
.I fd
ͭǤʤ⤷ϥѥפȤƤʤ
.TP
.B EINVAL
.I nr_segs
0 ⤷
.B IOV_MAX
礭ޤ
.B SPLICE_F_GIFT
ꤵ줿꤬ڡˤäƤʤ
.TP
.B ENOMEM
.SH С
.BR vmsplice ()
ƥॳ Linux 2.6.17 ǽо줷
.SH
Υƥॳ Linux ͭǤ롣
.SH
ꤵ줿ȿ¤ã硢
.BR vmsplice ()
¾Υ٥ȥ read/write ԤؿƱư롣
¤
.B IOV_MAX
Ǥꡢ
.I <limits.h>
Ƥ롣
ΥɥȤǤͤ 1024 Ǥ롣
.SH Ϣ
.BR splice (2),
.BR tee (2),
.BR feature_test_macros (7)
|