OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / release / man2 / sendfile.2
1 .\" This man page is Copyright (C) 1998 Pawel Krawczyk.
2 .\" Permission is granted to distribute possibly modified copies
3 .\" of this page provided the header is included verbatim,
4 .\" and in case of nontrivial modification author and date
5 .\" of the modification is added to the header.
6 .\" $Id: sendfile.2,v 1.5 1999/05/18 11:54:11 freitag Exp $
7 .\" 2000-11-19 bert hubert <ahu@ds9a.nl>: in_fd cannot be socket
8 .\"
9 .\" 2004-12-17, mtk
10 .\"     updated description of in_fd and out_fd for 2.6
11 .\"     Various wording and formatting changes
12 .\"
13 .\" 2005-03-31 Martin Pool <mbp@sourcefrog.net> mmap() improvements
14 .\"
15 .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
16 .\"         all rights reserved.
17 .\" Translated 1999-06-26, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
18 .\" Updated 2001-02-16, Kentaro Shirakata <argrath@ub32.org>
19 .\" Updated 2003-09-08, Kentaro Shirakata <argrath@ub32.org>
20 .\" Updated 2005-03-14, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
21 .\" Updated 2005-04-17, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
22 .\" Updated 2010-04-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.24
23 .\"
24 .\"WORD:        descriptor              ¥Ç¥£¥¹¥¯¥ê¥×¥¿
25 .\"WORD:        socket                  ¥½¥±¥Ã¥È
26 .\"WORD:        lock                    ¥í¥Ã¥¯
27 .\"
28 .TH SENDFILE 2 2010-02-15 "Linux" "Linux Programmer's Manual"
29 .SH Ì¾Á°
30 sendfile \- ¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿´Ö¤Ç¥Ç¡¼¥¿¤òžÁ÷¤¹¤ë
31 .SH ½ñ¼°
32 .B #include <sys/sendfile.h>
33 .sp
34 .BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \
35                       offset ", size_t" " count" );
36 .\" °Ê²¼¤Ï¡¢¤¢¤Þ¤ê¤Ë¤â±ø¤¤¡£ glibc ¥Ð¡¼¥¸¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Î¥³¥á¥ó¥È¤Ï
37 .\" ¡Ö¥Ø¥Ã¥À¡×¤Ç¤Ï¤Ê¤¯¡¢¡ÖÃí°Õ¡×¤Ë½ñ¤¤¤Æ¤ª¤¯¡£
38 .\"
39 .\" .B #include <features.h>
40 .\" .br
41 .\" .B #if (__GLIBC__==2 && __GLIBC_MINOR__>=1) || __GLIBC__>2
42 .\" .br
43 .\" .B #include <sys/sendfile.h>
44 .\" .br
45 .\" #else
46 .\" .br
47 .\" .B #include <sys/types.h>
48 .\" .br
49 .\" .B /* No system prototype before glibc 2.1. */
50 .\" .br
51 .\" .BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \
52 .\"                       offset ", size_t" " count" )
53 .\" .br
54 .\" .B #endif
55 .\"
56 .SH ÀâÌÀ
57 .BR sendfile ()
58 ¤Ï¡¢¤¢¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÊ̤Î
59 ¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ø¤Î¥Ç¡¼¥¿¤Î¥³¥Ô¡¼¤ò¹Ô¤¦¡£
60 ¤³¤Î¥³¥Ô¡¼¤Ï¥«¡¼¥Í¥ëÆâ¤Ç¹Ô¤ï¤ì¤ë¤Î¤Ç¡¢
61 .BR sendfile ()
62 ¤Ï¡¢
63 .BR read (2)
64 ¤È
65 .BR write (2)
66 ¤òÁȤ߹ç¤ï¤»¤ë¤è¤ê¤â¸úΨ¤¬¤è¤¤¡£
67 .BR read (2)
68 ¤ä
69 .BR write (2)
70 ¤Ç¤Ï¥æ¡¼¥¶¶õ´Ö¤È¤Î´Ö¤Ç¥Ç¡¼¥¿¤ÎžÁ÷¤¬É¬ÍפȤʤ뤫¤é¤Ç¤¢¤ë¡£
71
72 .I in_fd
73 ¤ÏÆɤ߹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¢
74 .I out_fd
75 ¤Ï½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
76
77 .I offset
78 ¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢
79 .I offset
80 ¤Ï
81 .BR sendfile ()
82 ¤¬
83 .I in_fd
84 ¤Î¤É¤³¤«¤é¥Ç¡¼¥¿¤òÆɤ߻Ϥá¤ë¤«¤ò¼¨¤¹¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤òÊÝ»ý¤¹¤ëÊÑ¿ô¤Ø¤Î
85 ¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
86 .BR sendfile ()
87 ¤ÏÉüµ¢¤¹¤ë»þ¡¢¤³¤ÎÊÑ¿ô¤ËºÇ¸å¤ËÆɤ߹þ¤ó¤À¥Ð¥¤¥È¤Î
88 ¼¡¤Î¥Ð¥¤¥È¤Î¥ª¥Õ¥»¥Ã¥È¤ò½ñ¤­¹þ¤à¡£
89 .I offset
90 ¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢
91 .BR sendfile ()
92 ¤Ï
93 .I in_fd
94 ¤Î¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤Î¸½ºßÃͤòÊѹ¹¤·¤Ê¤¤¡£
95 NULL ¤Î¾ì¹ç¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤Î¸½ºßÃͤò
96 .I in_fd
97 ¤«¤éÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤òÈ¿±Ç¤·¤¿°ÌÃÖ¤ËÄ´À°¤¹¤ë¡£
98
99 .I offset
100 ¤¬ NULL ¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¤Ï
101 .I in_fd
102 ¤Î¸½ºß¤Î¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤«¤éÆɤ߽Фµ¤ì¡¢
103 ¥Õ¥¡¥¤¥ë¡¦¥ª¥Õ¥»¥Ã¥È¤Ï¤³¤Î¸Æ¤Ó½Ð¤·¤Ç¹¹¿·¤µ¤ì¤ë¡£
104
105 .I count
106 ¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿´Ö¤Ç¥³¥Ô¡¼¤¹¤ë¥Ð¥¤¥È¿ô¤Ç¤¢¤ë¡£
107
108 º£¤Î¤È¤³¤í (Linux 2.6.9 ¤Ç¤Ï)¡¢
109 .I in_fd
110 ¤Ï
111 .BR mmap (2)
112 É÷¤ÎÁàºî¤¬¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤
113 (¥½¥±¥Ã¥È¤ò»Ø¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤)¡£¤Þ¤¿¡¢
114 .I out_fd
115 ¤Ï¥½¥±¥Ã¥È¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
116
117 .BR sendfile ()
118 ¤¬
119 .B EINVAL
120 ¤ä
121 .B ENOSYS
122 ¤Ç¼ºÇÔ¤¹¤ë¤è¤¦¤Ê¾ì¹ç¤Ï¡¢
123 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï
124 .BR read (2)/ write (2)
125 ¤ËÌ᤹¤³¤È¤ò¹Í¤¨¤Æ¤â¤è¤¤¤«¤â¤·¤ì¤Ê¤¤¡£
126 .SH ÊÖ¤êÃÍ
127 žÁ÷¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢
128 .I out_fd
129 ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
130 .I errno
131 ¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£
132 .SH ¥¨¥é¡¼
133 .TP
134 .B EAGAIN
135 .B O_NONBLOCK
136 ¤òÍѤ¤¤ÆÈó¥Ö¥í¥Ã¥¯ I/O ¤¬ÁªÂò¤µ¤ì¤¿¤¬¡¢½ñ¤­¹þ¤ß¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¡£
137 .TP
138 .B EBADF
139 ÆþÎÏ¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢
140 ½ÐÎÏ¥Õ¥¡¥¤¥ë¤¬½ñ¤­¹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
141 .TP
142 .B EFAULT
143 ¥¢¥É¥ì¥¹¤¬¤ª¤«¤·¤¤¡£
144 .TP
145 .B EINVAL
146 ¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Í­¸ú¤Ç¤Ê¤¤¤«¡¢¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¡£¤â¤·¤¯¤Ï
147 .BR mmap (2)
148 É÷¤ÎÁàºî¤¬
149 .I in_fd
150 ¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£
151 .TP
152 .B EIO
153 .I in_fd
154 ¤«¤éÆɤ߹þ¤ó¤Ç¤¤¤ë¤¦¤Á¤Ëͽ´ü¤·¤Ê¤¤¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£
155 .TP
156 .B ENOMEM
157 .I in_fd
158 ¤«¤éÆɤ߹þ¤à¤¿¤á¤Î½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£
159 .SH ¥Ð¡¼¥¸¥ç¥ó
160 .B sendfile
161 ¤Ï Linux 2.2 ¤Î¿·¤·¤¤µ¡Ç½¤Ç¤¢¤ë¡£
162 ¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë
163 .I <sys/sendfile.h>
164 ¤Ï glibc 2.1 ¤«¤é¸ºß¤·¤Æ¤¤¤ë¡£
165 .SH ½àµò
166 POSIX.1-2001 ¤ä¾¤Îɸ½à¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
167
168 ¾¤Î Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢°Û¤Ê¤Ã¤¿Êý¼°¤ä¥×¥í¥È¥¿¥¤¥×¤Ç
169 .BR sendfile ()
170 ¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£°Ü¿¢À­¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£
171 .SH Ãí°Õ
172 .BR sendfile ()
173 ¤ò»È¤Ã¤Æ TCP ¥½¥±¥Ã¥È¤Ë¥Õ¥¡¥¤¥ë¤òÁ÷¤í¤¦¤È¤·¤Æ¤¤¤Æ¡¢
174 ¥Õ¥¡¥¤¥ë¤ÎÆâÍƤÎÁ°¤Ë¥Ø¥Ã¥À¡¦¥Ç¡¼¥¿¤òÉÕ¤±²Ã¤¨¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ï¡¢
175 ¥Ñ¥±¥Ã¥È¿ô¤òºÇ¾®¤Ë¤·¤ÆÀ­Ç½¤ò¾å¤²¤ë¤¿¤á¤Ë
176 .BR tcp (7)
177 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë
178 .B TCP_CORK
179 ¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¤¤¤¤¤À¤í¤¦¡£
180
181 Linux 2.4 ¤È¤½¤ì°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢
182 .I out_fd
183 ¤ÏÄ̾ï¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤Ç¤­¡¢
184 .BR sendfile ()
185 ¤Ï¤½¤Î¥Õ¥¡¥¤¥ë¤Î¥ª¥Õ¥»¥Ã¥È¤Î¸½ºßÃͤòÊѹ¹¤·¤Æ¤¤¤¿¡£
186 .SH ´ØÏ¢¹àÌÜ
187 .BR mmap (2),
188 .BR open (2),
189 .BR socket (2),
190 .BR splice (2)