OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man2 / pread.2
1 .\" Copyright (C) 1999 Joseph Samuel Myers.
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 .\"
23 .\"*******************************************************************
24 .\"
25 .\" This file was generated with po4a. Translate the source file.
26 .\"
27 .\"*******************************************************************
28 .TH PREAD 2 2010\-11\-21 Linux "Linux Programmer's Manual"
29 .SH 名前
30 pread, pwrite \- 指定したオフセットでファイルディスクリプタを読み書きする
31 .SH 書式
32 \fB#include <unistd.h>\fP
33 .sp
34 \fBssize_t pread(int \fP\fIfd\fP\fB, void *\fP\fIbuf\fP\fB, size_t \fP\fIcount\fP\fB, off_t
35 \fP\fIoffset\fP\fB);\fP
36 .sp
37 \fBssize_t pwrite(int \fP\fIfd\fP\fB, const void *\fP\fIbuf\fP\fB, size_t \fP\fIcount\fP\fB,
38 off_t \fP\fIoffset\fP\fB);\fP
39 .sp
40 .in -4n
41 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
42 .in
43 .PD 0
44 .ad l
45 .sp
46 \fBpread\fP(), \fBpwrite\fP():
47 .RS 4
48 _XOPEN_SOURCE\ >=\ 500
49 .br
50 || /* glibc 2.12 以降: */ _POSIX_C_SOURCE\ >=\ 200809L
51 .RE
52 .ad
53 .PD
54 .SH 説明
55 \fBpread\fP()  は、ファイルディスクリプタ \fIfd\fP の (ファイルの先頭からの) オフセット \fIoffset\fP から最大 \fIcount\fP
56 バイトをバッファ \fIbuf\fP へ読み込む。ファイル・オフセットは変化しない。
57 .PP
58 \fBpwrite\fP()  は、バッファ \fIbuf\fP から最大 \fIcount\fP バイトをファイルディスクリプタ \fIfd\fP のオフセット
59 \fIoffset\fP に書き込む。ファイル・オフセットは変化しない。
60 .PP
61 \fIfd\fP で参照されるファイルはシーク (seek) 可能でなければならない。
62 .SH 返り値
63 成功した場合、読み書きを行ったバイト数が返される (ゼロは、 \fBpwrite\fP()  の場合には何も書かれなかったことを意味し、 \fBpread\fP()
64 の場合にはファイル の末尾に達したことを意味する)。 エラーの場合は \-1 が返され、 \fIerrno\fP がそのエラーを示すように設定される。
65 .SH エラー
66 \fBpread\fP()  では、 \fBread\fP(2)  および \fBlseek\fP(2)  で規定された全てのエラーが発生する可能性があり、
67 \fIerror\fP にはエラーを示す値が設定される。 \fBpwrite\fP()  では、 \fBwrite\fP(2)  および \fBlseek\fP(2)
68 で規定された全てのエラーが発生する可能性があり、 \fIerror\fP にはエラーを示す値が設定される。
69 .SH バージョン
70 システムコール \fBpread\fP()  と \fBpwrite\fP()  は Linux にバージョン 2.1.60 で追加された。 i386
71 のシステムコールのエントリは 2.1.69 で追加された。 (システムコールを持たない古いカーネルでの \fBlseek\fP(2)
72 を使ったエミュレーションを含めると)  C ライブラリにおけるサポートは glibc 2.1 で追加された。
73 .SH 準拠
74 POSIX.1\-2001.
75 .SH 注意
76 Linux では、裏で呼び出されるシステムコールの名前がカーネル 2.6 で変更された。
77 \fBpread\fP() は \fBpread64\fP() になり、 \fBpwrite\fP() は \fBpwrite64\fP() になった。
78 システムコールの番号は変更されていない。
79 glibc の \fBpread\fP() と \fBpwrite\fP() のラッパー関数はこれらの変更を吸収している。
80 .SH 関連項目
81 \fBlseek\fP(2), \fBread\fP(2), \fBreadv\fP(2), \fBwrite\fP(2)