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
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" This manpage is Copyright (C) 1992 Drew Eckhardt;
.\" 1993 Michael Haardt, Ian Jackson.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Modified Sat Jul 24 00:06:00 1993 by Rik Faith <faith@cs.unc.edu>
.\" Modified Wed Jan 17 16:02:32 1996 by Michael Haardt
.\" <michael@cantor.informatik.rwth-aachen.de>
.\" Modified Thu Apr 11 19:26:35 1996 by Andries Brouwer <aeb@cwi.nl>
.\" Modified Sun Jul 21 18:59:33 1996 by Andries Brouwer <aeb@cwi.nl>
.\" Modified Fri Jan 31 16:47:33 1997 by Eric S. Raymond <esr@thyrsus.com>
.\" 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 Sun Feb 23 20:01:28 JST 1997
.\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Modified Sun Sep 28 20:00:05 JST 1997
.\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\"
.\"WORD: descriptor ǥץ
.\"WORD: buffer Хåե
.\"WORD: signal ʥ
.\"WORD: process group ץ롼
.\"WORD: backgraound Хå
.\"WORD: orphan Ω
.\"WORD: open ץ
.\"WORD: directory ǥ쥯ȥ
.\"WORD: object ֥
.\"
.TH READ 2 "July 12, 1997" "Linux 2.0.32" "Linux Programmer's Manual"
.SH ̾
read \- ե롦ǥץɤ߹
.SH
.nf
.B #include <unistd.h>
.sp
.BI "ssize_t read(int " fd ", void *" buf ", size_t " count );
.fi
.SH
.B read()
ϥե롦ǥץ(file descriptor)
.I fd
.I count
ХȤ
.IR buf
ǻϤޤХåեɤ߹⤦Ȥ롣
.PP
.I count
ʤС\fBread()\fP ϥ֤¾˲ⵯʤ
.I count
SSIZE_MAX 礭С̤Ǥʤ
.PP
.SH ֤
硢ɤ߹Хȿ֤(ϥեν̣)
ե֤Ϥοʤ롣
οᤷ꾮äȤƤ⥨顼ǤϤʤ;
㤨кˤϼºݤˤοʤ(եκǸ˶ᤤΤ
ʤѥ(pipe)ü(terminal)ɤ߹Ǥ뤫⤷ʤ)
\fBread()\fP ʥ(signal)ˤäƳޤ줿ˤϵ
롣
顼ξϡ\-1 ֤졢
.I errno
Ŭڤꤵ롣ξϥե֤ѹ뤫ɤ
Ǥ롣
.SH 顼
.TP
.B EINTR
Υǡɤ߹ޤʤ˥ʥ˳ޤ줿
.TP
.B EAGAIN
.B O_NONBLOCK
Ѥ(Non-blocking) I/O Ƥꡢ
˥ǡɤ߹߲ǽǤʤä
.TP
.B EIO
I/O 顼㤨ХץХåɡץ롼פǡ
椷Ƥ tty ɤߤ⤦ȤSIGTTIN ̵(ignore)ޤ
ػ(blocking)Ƥ䡢Υץ롼פΩ(orphan)
˵롣ޤǥơפɤǤ٥ I/O 顼
ȯˤⵯ롣
.TP
.B EISDIR
.I fd
ǥ쥯ȥȤƤ롣
.TP
.B EBADF
.I fd
ͭʥե롦ǥץǤʤɤ߹ߤΤ
ץ(open)Ƥʤ
.TP
.B EINVAL
.I fd
ɤ߹ߤŬƤʤ֥ȤȤƤ롣
.TP
.B EFAULT
.I buf
ǽʥɥ쥹֤γˤ롣
.PP
.IR fd
³Ƥ륪֥ȤˤäƤ¾Υ顼ⵯꤨ롣
POSIX Ǥϡ
餫Υǡɤ˳ߤä硢
.B read
(
.I errno
EINTR ꤷ) \-1 ֤Ƥ褤
ɤ߹Хȿ֤Ƥ褤
.SH
SVr4, SVID, AT&T, POSIX, X/OPEN, BSD 4.3
.SH
NFS ˤơ̤Υǡɤ߹硢ǽλΤߤ˥ࡦ
פ졢³ǤϹʤ
ϥ饤¦°ΥåԤʤǤ롣
ʤʤС⤷Ƥ NFS 饤Ȥ atime()ι
С餺饤¦ǥåɤळȤƤС
С¦Ǥ read ȯʤΤ atime ιϹԤʤʤ
UNIX Ǥϡ饤¦°Υå̵ˤ뤳Ȥǡ
뤳ȤǤ롣ۤȤɤξǤϤ³С
٤äѥեޥ㲼⤿餹
.SH Ϣ
.BR close (2),
.BR fcntl (2),
.BR ioctl (2),
.BR lseek (2),
.BR readdir (2),
.BR readlink (2),
.BR select (2),
.BR write (2),
.BR fread (3)
|