OSDN Git Service

(split) Convert contrib and obsolete pages to UTF-8.
[linuxjm/LDP_man-pages.git] / obsolete / man3 / readv.3
1 .\" (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one
11 .\" 
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\" 
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\" License.
23 .\" Modified Sat Jul 24 18:34:44 1993 by Rik Faith (faith@cs.unc.edu)
24 .\"
25 .\" Japanese Version Copyright (c) 1998 Shigeru Tada
26 .\"     all rights reserved.
27 .\" Translated Mon, 25 May 1998 
28 .\"     by Shigeru Tada <stada@mech.titech.ac.jp>
29 .\"
30 .TH READV 3  "April 25, 1993" "GNU" "Linux Programmer's Manual"
31 .SH 名前
32 readv, writev \- 複数のバッファーを用いたファイル入出力
33 .SH 書式
34 .nf
35 .B #include <sys/uio.h>
36 .sp
37 .BI "int readv(int " filedes ", const struct iovec *" vector ,
38 .BI "          size_t " count );
39 .sp
40 .BI "int writev(int " filedes ", const struct iovec *" vector ,
41 .BI "          size_t " count );
42 .fi
43 .SH 説明
44 .B readv()
45 関数はファイル・ディスクリプター\fIfiledes\fPに連結されたファイルから
46 \fIcount\fPブロックを、\fIvector\fPで指定された複数のバッファーに読
47 み込む。
48 .PP
49 \fBwritev()\fP関数はファイル・ディスクリプター\fIfiledes\fP
50 に連結されたファイルに\fIvector\fPポインタで指定された最大
51 \fIcount\fPブロックまでをバッファーから書き込む。
52 .PP
53 .I vector
54 ポインタは
55 .PP
56 .br
57 .nf
58 .in 10
59 struct iovec {
60 .in 14
61 void *iov_base;   /* Starting address */
62 size_t iov_len;   /* Number of bytes */
63 .in 10
64 } ;
65 .fi
66 .PP
67 のように\fB<sys/uio.h>\fPの中で定義される構造体\fBiovec\fPを指す。
68 .PP
69 バッファは
70 .IR "vector[0]" ", " vector[1] ", ... " "vector[count-1]" .
71 の順で処理される。
72 .PP
73 \fBreadv()\fP関数は複数のバッファーに読み込むということを除けば、
74 \fBread(2)\fPとまったく同じように動作する。
75 .PP
76 \fBwritev()\fP関数は複数のバッファーから書き込むということを除けば、
77 \fBwrite(2)\fPとまったく同じように動作する。
78 .SH 返り値
79 \fBreadv()\fP関数は書き込まれたバイト数を返す。
80 エラーの場合は \-1 を返す。
81 \fBwritev()\fP関数は読み込まれたバイト数を返す。
82 エラーの場合は \-1 を返す。
83 .SH エラー
84 \fBreadv()\fPと\fBwritev()\fP関数は失敗した場合\fIerrno\fPを以下の値に
85 設定する。
86 .TP
87 .B EBADDF
88 \fI fd\fPが有効なファイル・ディスクリプターではない
89 .TP
90 .B EINVAL
91 \fI fd\fPが(\fBR readv()\fPの場合)読み込めないか、
92 (\fBR writev()\fPの場合)書き込めない。
93 .TP
94 .B EFAULT
95 \fI buf\fPがアクセス可能なアドレス空間の外にある。
96 .TP
97 .B EAGAIN 
98 \fB open()\fP関数を呼び出す時に非停止(Non-blocking) I/O が選択されており、
99 すぐにデータが読み込み可能ではなかった。
100 .TP
101 .B EINTR
102 データが引き渡される前に、読みこみあるいは書き込みへの
103 割り込みがおこった。
104 .SH 準拠
105 不明
106 .SH バグ
107 \fBR readv() "あるいは" writev()\fPのようなファイル・ディスクリプターを
108 操作する関数を、stdioライブラリーから呼び出される関数と組み合わせて呼
109 び出すことは推奨できない。その結果は定義されないものであり,おそらく
110 期待した結果は得られない。
111 .SH 関連項目
112 .BR read (2),
113 .BR write (2)