OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man2 / read.2
index 14732a4..b699484 100644 (file)
 .\" Modified Sat Jul 12 20:45:39 1997 by Michael Haardt
 .\"   <michael@cantor.informatik.rwth-aachen.de>
 .\"
-.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
-.\"         all rights reserved.
-.\" Translated 1997-02-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
-.\" Modified 1997-09-28, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
-.\" Updated & Modified 2005-02-24, Yuichi SATO <ysato444@yahoo.co.jp>
-.\" Updated 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
-.\" Updated 2005-10-14, Akihiro MOTOKI
-.\" Updated 2008-02-10, Akihiro MOTOKI, LDP v2.77
-.\" Updated 2009-04-13, Akihiro MOTOKI, LDP v3.20
+.\"*******************************************************************
 .\"
-.\"WORD:       descriptor              ディスクリプター
-.\"WORD:       buffer                  バッファー
-.\"WORD:       signal                  シグナル
-.\"WORD:       process group           プロセス・グループ
-.\"WORD:       backgraound             バックグランド
-.\"WORD:       orphan                  孤立
-.\"WORD:       open                    オープン
-.\"WORD:       directory               ディレクトリ
-.\"WORD:       object                  オブジェクト
+.\" This file was generated with po4a. Translate the source file.
 .\"
-.TH READ 2 2009-02-23 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
+.\"*******************************************************************
+.TH READ 2 2009\-02\-23 Linux "Linux Programmer's Manual"
 .SH 名前
-.\"O read \- read from a file descriptor
 read \- ファイル・ディスクリプターから読み込む
-.\"O .SH SYNOPSIS
 .SH 書式
 .nf
-.B #include <unistd.h>
+\fB#include <unistd.h>\fP
 .sp
-.BI "ssize_t read(int " fd ", void *" buf ", size_t " count );
+\fBssize_t read(int \fP\fIfd\fP\fB, void *\fP\fIbuf\fP\fB, size_t \fP\fIcount\fP\fB);\fP
 .fi
-.\"O .SH DESCRIPTION
 .SH 説明
-.\"O .BR read ()
-.\"O attempts to read up to
-.\"O .I count
-.\"O bytes from file descriptor
-.\"O .I fd
-.\"O into the buffer starting at
-.\"O .IR buf .
-.BR read ()
-はファイル・ディスクリプター (file descriptor)
-.I fd
-から最大
-.I count
-バイトを
-.I buf
+\fBread\fP()  はファイル・ディスクリプター (file descriptor)  \fIfd\fP から最大 \fIcount\fP バイトを \fIbuf\fP
 で始まるバッファーへ読み込もうとする。
 .PP
-.\"O If
-.\"O .I count
-.\"O is zero,
-.\"O .BR read ()
-.\"O returns zero and has no other results.
-.\"O If
-.\"O .I count
-.\"O is greater than
-.\"O .BR SSIZE_MAX ,
-.\"O the result is unspecified.
-.I count
-が 0 ならば、
-.BR read ()
-は 0 を返し、他に何も起きない。
-.I count
-が
-.B SSIZE_MAX
+\fIcount\fP が 0 ならば、 \fBread\fP()  は 0 を返し、他に何も起きない。 \fIcount\fP が \fBSSIZE_MAX\fP
 より大きければ、結果は特定できない。
-.\"O .SH "RETURN VALUE"
 .SH 返り値
-.\"O On success, the number of bytes read is returned (zero indicates end of
-.\"O file), and the file position is advanced by this number.
-.\"O It is not an error if this number is smaller than the number of bytes
-.\"O requested; this may happen for example because fewer bytes are actually
-.\"O available right now (maybe because we were close to end-of-file, or
-.\"O because we are reading from a pipe, or from a terminal), or because
-.\"O .BR read ()
-.\"O was interrupted by a signal.
-成功した場合、読み込んだバイト数を返す (0 はファイルの終りを意味する)。
-ファイル位置はこの数だけ進められる。
-この数が要求した数より小さかったとしてもエラーではない;
-例えば今すぐには実際にそれだけの数しかない場合 (ファイルの最後に近いのかも
-しれないし、パイプ (pipe) や端末 (terminal) から読み込んでいるかもしれない) や
-.BR read ()
-がシグナル (signal) によって割り込まれた場合にこれは起こりえる。
-.\"O On error, \-1 is returned, and
-.\"O .I errno
-.\"O is set appropriately.
-.\"O In this case it is left unspecified whether
-.\"O the file position (if any) changes.
-エラーの場合は、\-1 が返され、
-.I errno
-が適切に設定される。この場合はファイル位置が変更されるかどうかは
-不定である。
+成功した場合、読み込んだバイト数を返す (0 はファイルの終りを意味する)。 ファイル位置はこの数だけ進められる。
+この数が要求した数より小さかったとしてもエラーではない; 例えば今すぐには実際にそれだけの数しかない場合 (ファイルの最後に近いのかも
+しれないし、パイプ (pipe) や端末 (terminal) から読み込んでいるかもしれない) や \fBread\fP()  がシグナル (signal)
+によって割り込まれた場合にこれは起こりえる。 エラーの場合は、\-1 が返され、 \fIerrno\fP
+が適切に設定される。この場合はファイル位置が変更されるかどうかは 不定である。
 .SH エラー
-.TP
-.B EAGAIN
-.\"O The file descriptor
-.\"O .I fd
-.\"O refers to a file other than a socket and has been marked nonblocking
-.\"O .RB ( O_NONBLOCK ),
-.\"O and the read would block.
-ファイル・ディスクリプター
-.I fd
-がソケット以外のファイルを参照していて、
-非停止 (nonblocking) モード
-.RB ( O_NONBLOCK )
-に設定されており、読み込みを行うと停止する状況にある。
-.TP
-.\"O .BR EAGAIN " or " EWOULDBLOCK
-.BR EAGAIN " または " EWOULDBLOCK
+.TP 
+\fBEAGAIN\fP
+ファイル・ディスクリプター \fIfd\fP がソケット以外のファイルを参照していて、 非停止 (nonblocking) モード
+(\fBO_NONBLOCK\fP)  に設定されており、読み込みを行うと停止する状況にある。
+.TP 
+\fBEAGAIN\fP または \fBEWOULDBLOCK\fP
 .\" Actually EAGAIN on Linux
-.\"O The file descriptor
-.\"O .I fd
-.\"O refers to a socket and has been marked nonblocking
-.\"O .RB ( O_NONBLOCK ),
-.\"O and the read would block.
-.\"O POSIX.1-2001 allows either error to be returned for this case,
-.\"O and does not require these constants to have the same value,
-.\"O so a portable application should check for both possibilities.
-ファイル・ディスクリプター
-.I fd
-がソケットを参照していて、非停止 (nonblocking) モード
-.RB ( O_NONBLOCK )
-に設定されており、読み込みを行うと停止する状況にある。
-POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、
-これら 2 つの定数が同じ値を持つことも求めていない。
-したがって、移植性が必要なアプリケーションでは、両方の可能性を
-確認すべきである。
-.TP
-.B EBADF
-.\"O .I fd
-.\"O is not a valid file descriptor or is not open for reading.
-.I fd
-が有効なファイル・ディスクリプターでないか、読み込みのために
-オープン (open) されていない。
-.TP
-.B EFAULT
-.\"O .I buf
-.\"O is outside your accessible address space.
-.I buf
-がアクセス可能なアドレス空間の外にある。
-.TP
-.B EINTR
-.\"O The call was interrupted by a signal before any data was read; see
-.\"O .BR signal (7).
-何のデータも読み込まないうちにシグナルに割り込まれた。
-.BR signal (7)
-参照。
-.TP
-.B EINVAL
-.\"O .I fd
-.\"O is attached to an object which is unsuitable for reading;
-.\"O or the file was opened with the
-.\"O .B O_DIRECT
-.\"O flag, and either the address specified in
-.\"O .IR buf ,
-.\"O the value specified in
-.\"O .IR count ,
-.\"O or the current file offset is not suitably aligned.
-.I fd
-は読み込みに適していないオブジェクトを参照している。
-もしくは、ファイルが
-.B O_DIRECT
-フラグを指定してオープンされているが、
-.I buf
-に指定されたアドレス、
-.I count
-に指定された値、
-現在のファイルオフセットのいずれかの
-アラインメントが不適切である。
-.TP
-.B EINVAL
-.\"O .I fd
-.\"O was created via a call to
-.\"O .BR timerfd_create (2)
-.\"O and the wrong size buffer was given to
-.\"O .BR read ();
-.\"O see
-.\"O .BR timerfd_create (2)
-.\"O for further information.
-.I fd
-が
-.BR timerfd_create (2)
-の呼び出しで作成されたが、
-.BR read ()
-に間違ったサイズのバッファが渡された。
-さらなる情報は
-.BR timerfd_create (2)
-を参照のこと。
-.TP
-.B EIO
-.\"O I/O error.
-.\"O This will happen for example when the process is in a
-.\"O background process group, tries to read from its controlling tty,
-.\"O and either it is ignoring or blocking
-.\"O .B SIGTTIN
-.\"O or its process group
-.\"O is orphaned.
-.\"O It may also occur when there is a low-level I/O error
-.\"O while reading from a disk or tape.
-I/O エラー。これは例えばプロセスがバックグランド・プロセス・グループで、
-それを制御している tty から読み込もうとし、
-.B SIGTTIN
-が無視 (ignore) または禁止 (blocking) されている場合や、
-そのプロセス・グループが孤立 (orphan) している場合に起こる。
-またディスクやテープを読んでいる時に低レベル I/O エラー
-が発生した場合にも起こる。
-.TP
-.B EISDIR
-.\"O .I fd
-.\"O refers to a directory.
-.I fd
-がディレクトリを参照している。
+ファイル・ディスクリプター \fIfd\fP がソケットを参照していて、非停止 (nonblocking) モード (\fBO_NONBLOCK\fP)
+に設定されており、読み込みを行うと停止する状況にある。 POSIX.1\-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2
+つの定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、両方の可能性を 確認すべきである。
+.TP 
+\fBEBADF\fP
+\fIfd\fP が有効なファイル・ディスクリプターでないか、読み込みのために オープン (open) されていない。
+.TP 
+\fBEFAULT\fP
+\fIbuf\fP がアクセス可能なアドレス空間の外にある。
+.TP 
+\fBEINTR\fP
+何のデータも読み込まないうちにシグナルに割り込まれた。 \fBsignal\fP(7)  参照。
+.TP 
+\fBEINVAL\fP
+\fIfd\fP は読み込みに適していないオブジェクトを参照している。 もしくは、ファイルが \fBO_DIRECT\fP フラグを指定してオープンされているが、
+\fIbuf\fP に指定されたアドレス、 \fIcount\fP に指定された値、 現在のファイルオフセットのいずれかの アラインメントが不適切である。
+.TP 
+\fBEINVAL\fP
+\fIfd\fP が \fBtimerfd_create\fP(2)  の呼び出しで作成されたが、 \fBread\fP()  に間違ったサイズのバッファが渡された。
+さらなる情報は \fBtimerfd_create\fP(2)  を参照のこと。
+.TP 
+\fBEIO\fP
+I/O エラー。これは例えばプロセスがバックグランド・プロセス・グループで、 それを制御している tty から読み込もうとし、 \fBSIGTTIN\fP
+が無視 (ignore) または禁止 (blocking) されている場合や、 そのプロセス・グループが孤立 (orphan) している場合に起こる。
+またディスクやテープを読んでいる時に低レベル I/O エラー が発生した場合にも起こる。
+.TP 
+\fBEISDIR\fP
+\fIfd\fP がディレクトリを参照している。
 .PP
-.\"O Other errors may occur, depending on the object connected to
-.\"O .IR fd .
-.I fd
-が接続しているオブジェクトによっては他のエラーも起こりえる。
-.\"O POSIX allows a
-.\"O .BR read ()
-.\"O that is interrupted after reading some data
-.\"O to return \-1 (with
-.\"O .I errno
-.\"O set to
-.\"O .BR EINTR )
-.\"O or to return the number of bytes already read.
-POSIX では、
-いくらかのデータを読んだ後に割り込みが起こった場合、
-.BR read ()
-は
-.RI ( errno
-に
-.B EINTR
-を設定して) \-1 を返してもよいし、
-既に読み込んだバイト数を返してもよい。
-.\"O .SH "CONFORMING TO"
+\fIfd\fP が接続しているオブジェクトによっては他のエラーも起こりえる。 POSIX では、 いくらかのデータを読んだ後に割り込みが起こった場合、
+\fBread\fP()  は (\fIerrno\fP に \fBEINTR\fP を設定して) \-1 を返してもよいし、 既に読み込んだバイト数を返してもよい。
 .SH 準拠
-SVr4, 4.3BSD, POSIX.1-2001.
-.\"O .SH NOTES
+SVr4, 4.3BSD, POSIX.1\-2001.
 .SH 注意
-.\"O On NFS file systems, reading small amounts of data will only update the
-.\"O timestamp the first time, subsequent calls may not do so.
-.\"O This is caused
-.\"O by client side attribute caching, because most if not all NFS clients
-.\"O leave st_atime (last file access time)
-.\"O updates to the server and client side reads satisfied from the
-.\"O client's cache will not cause st_atime updates on the server as there are no
-.\"O server side reads.
-.\"O UNIX semantics can be obtained by disabling client
-.\"O side attribute caching, but in most situations this will substantially
-.\"O increase server load and decrease performance.
-NFS において。少量のデータを読み込む場合、最初の時のみにタイム
-スタンプが更新され、続くコールでは更新されないだろう。
-これはクライアント側で属性のキャッシングを行なうためである。
-なぜならば、もし全ての NFS クライアントが st_atime (最終ファイルアクセス時刻)
-の更新をサーバーに送らず、クライアント側でキャッシュを読むことに満足して
-いれば、サーバー側での read は発生しないので st_atime の更新は行なわれからだ。
-UNIX の方式では、クライアント側の属性のキャッシングを無効にすることで、
-これを得ることができる。しかしほとんどの状況ではこれは続くサーバーの
-負荷を増加させ、パフォーマンスの低下をもたらす。
+NFS において。少量のデータを読み込む場合、最初の時のみにタイム スタンプが更新され、続くコールでは更新されないだろう。
+これはクライアント側で属性のキャッシングを行なうためである。 なぜならば、もし全ての NFS クライアントが st_atime
+(最終ファイルアクセス時刻)  の更新をサーバーに送らず、クライアント側でキャッシュを読むことに満足して いれば、サーバー側での read
+は発生しないので st_atime の更新は行なわれからだ。 UNIX の方式では、クライアント側の属性のキャッシングを無効にすることで、
+これを得ることができる。しかしほとんどの状況ではこれは続くサーバーの 負荷を増加させ、パフォーマンスの低下をもたらす。
 .PP
-.\"O Many file systems and disks were considered to be fast enough that the
-.\"O implementation of
-.\"O .B O_NONBLOCK
-.\"O was deemed unnecessary.
-.\"O So,
-.\"O .B O_NONBLOCK
-.\"O may not be available on files
-.\"O and/or disks.
-多くのファイルシステムやディスクは
-.B O_NONBLOCK
-の実装はしなくても済むくらいに十分に高速であると考えられている。
-それでそのようなファイルやディスクには
-.B O_NONBLOCK
-は利用できないかもしれない。
-.\"O .SH "SEE ALSO"
+多くのファイルシステムやディスクは \fBO_NONBLOCK\fP の実装はしなくても済むくらいに十分に高速であると考えられている。
+それでそのようなファイルやディスクには \fBO_NONBLOCK\fP は利用できないかもしれない。
 .SH 関連項目
-.BR close (2),
-.BR fcntl (2),
-.BR ioctl (2),
-.BR lseek (2),
-.BR open (2),
-.BR pread (2),
-.BR readdir (2),
-.BR readlink (2),
-.BR readv (2),
-.BR select (2),
-.BR write (2),
-.BR fread (3)
+\fBclose\fP(2), \fBfcntl\fP(2), \fBioctl\fP(2), \fBlseek\fP(2), \fBopen\fP(2), \fBpread\fP(2),
+\fBreaddir\fP(2), \fBreadlink\fP(2), \fBreadv\fP(2), \fBselect\fP(2), \fBwrite\fP(2),
+\fBfread\fP(3)