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 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
|
.\" This man page is Copyright (C) 1998 Pawel Krawczyk.
.\" Permission is granted to distribute possibly modified copies
.\" of this page provided the header is included verbatim,
.\" and in case of nontrivial modification author and date
.\" of the modification is added to the header.
.\" $Id: sendfile.2,v 1.5 1999/05/18 11:54:11 freitag Exp $
.\" 2000-11-19 bert hubert <ahu@ds9a.nl>: in_fd cannot be socket
.\"
.\" 2004-12-17, mtk
.\" updated description of in_fd and out_fd for 2.6
.\" Various wording and formatting changes
.\"
.\" 2005-03-31 Martin Pool <mbp@sourcefrog.net> mmap() improvements
.\"
.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
.\" all rights reserved.
.\" Translated 1999-06-26, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Updated 2001-02-16, Kentaro Shirakata <argrath@ub32.org>
.\" Updated 2003-09-08, Kentaro Shirakata <argrath@ub32.org>
.\" Updated 2005-03-14, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\" Updated 2005-04-17, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\"
.\"WORD: descriptor ǥץ
.\"WORD: socket å
.\"WORD: lock å
.\"
.TH SENDFILE 2 2004-12-17 "Linux" "Linux Programmer's Manual"
.SH ̾
sendfile \- ե롦ǥץ֤ǥǡž
.SH
.B #include <sys/sendfile.h>
.sp
.BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \
offset ", size_t" " count" );
.\" ʲϡޤˤ glibc СˤĤƤΥȤ
.\" ֥إåפǤϤʤաפ˽Ƥ
.\"
.\" .B #include <features.h>
.\" .br
.\" .B #if (__GLIBC__==2 && __GLIBC_MINOR__>=1) || __GLIBC__>2
.\" .br
.\" .B #include <sys/sendfile.h>
.\" .br
.\" #else
.\" .br
.\" .B #include <sys/types.h>
.\" .br
.\" .B /* No system prototype before glibc 2.1. */
.\" .br
.\" .BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \
.\" offset ", size_t" " count" )
.\" .br
.\" .B #endif
.\"
.SH
.BR sendfile ()
ϡե롦ǥץ̤
ե롦ǥץؤΥǡΥԡԤ
ΥԡϥͥǹԤΤǡ
.BR sendfile ()
ϡ
.BR read (2)
.BR write (2)
Ȥ߹碌Ψ褤
.BR read (2)
.BR write (2)
Ǥϥ桼֤Ȥδ֤ǥǡžɬפȤʤ뤫Ǥ롣
.I in_fd
ɤ߹ߤΤ˥ץ줿ե롦ǥץ
.I out_fd
ϽߤΤ˥ץ줿ǥץǤʤФʤʤ
.I offset
NULL Ǥʤ硢
.I offset
.BR sendfile ()
.I in_fd
ΤɤǡɤϤ뤫ե롦եåȤݻѿؤ
ݥǤ롣
.BR sendfile ()
ѿ˺Ǹɤ߹ХȤ
ΥХȤΥեåȤࡣ
.I offset
NULL Ǥʤ硢
.BR sendfile ()
.I in_fd
Υե롦եåȤθͤѹʤ
NULL ξϡե롦եåȤθͤ
.I in_fd
ɤ߹ХȿȿǤ֤Ĵ롣
.I count
ϡե롦ǥץ֤ǥԡХȿǤ롣
ΤȤ (Linux 2.6.9 Ǥ)
.I in_fd
.BR mmap (2)
ǤեؤƤʤФʤʤ
(åȤؤƤϤʤʤ)ޤ
.I out_fd
ϥåȤؤƤʤФʤʤ
.BR sendfile ()
.B EINVAL
.B ENOSYS
ǼԤ褦ʾϡ
ץꥱ
.BR read (2)/ write (2)
᤹ȤͤƤ褤⤷ʤ
.SH ֤
ž硢
.I out_fd
˽ޤ줿Хȿ֤顼ξ硢\-1 ֤
.I errno
Ŭڤͤꤹ롣
.SH 顼
.TP
.B EAGAIN
.B O_NONBLOCK
Ѥ֥å I/O 줿ߤ֥å줿
.TP
.B EBADF
ϥե뤬ɤ߹ߤΤ˥ץƤʤ
ϥե뤬ߤΤ˥ץƤʤ
.TP
.B EFAULT
ɥ쥹
.TP
.B EINVAL
ǥץͭǤʤåƤ롣⤷
.BR mmap (2)
.I in_fd
ǤѤǤʤ
.TP
.B EIO
.I in_fd
ɤ߹Ǥ뤦ͽʤ顼ä
.TP
.B ENOMEM
.I in_fd
ɤ߹िνʬʥ꤬ʤ
.SH С
.B sendfile
Linux 2.2 οǽǤ롣
롼ɥե
.I <sys/sendfile.h>
glibc 2.1 ¸ߤƤ롣
.SH
POSIX.1-2001 ¾ɸǤϵꤵƤʤ
¾ Unix ƥǤϡۤʤäץȥפ
.BR sendfile ()
Ƥ롣ܿθץǤϻѤ٤ǤϤʤ
.SH
.BR sendfile ()
Ȥä TCP åȤ˥եȤƤơ
եƤ˥إåǡդäɬפϡ
ѥåȿǾˤǽ夲뤿
.BR tcp (7)
˵ҤƤ
.B TCP_CORK
ץȤȤ
Linux 2.4 ȤΥСǤϡ
.I out_fd
̾ΥեȤǤ
.BR sendfile ()
ϤΥեΥեåȤθͤѹƤ
.SH Ϣ
.BR open (2),
.BR mmap (2),
.BR socket (2),
.BR splice (2)
|