BSD 3 development
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Wed, 21 Nov 1979 19:57:48 +0000 (11:57 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Wed, 21 Nov 1979 19:57:48 +0000 (11:57 -0800)
Work on file usr/man/man2/read.2

Synthesized-from: 3bsd

usr/man/man2/read.2 [new file with mode: 0644]

diff --git a/usr/man/man2/read.2 b/usr/man/man2/read.2
new file mode 100644 (file)
index 0000000..60a4fba
--- /dev/null
@@ -0,0 +1,54 @@
+.TH READ 2 
+.SH NAME
+read \- read from file
+.SH SYNOPSIS
+.B read(fildes, buffer, nbytes)
+.br
+.B char *buffer;
+.SH DESCRIPTION
+A file descriptor is a word
+returned from a successful
+.I "open, creat, dup,"
+or
+.I pipe
+call.
+.I Buffer
+is the location of
+.I nbytes
+contiguous
+bytes into which the input will be placed.
+It is not guaranteed
+that all
+.I nbytes
+bytes will be read; for example
+if the file refers to a typewriter at most one line
+will be returned.
+In any event the number of characters read is returned.
+.PP
+If the returned value is 0, then
+end-of-file has been reached.
+.PP
+If very large data files are to be accessed randomly, see
+.I vread (2)
+.SH "SEE ALSO"
+open(2), creat(2), dup(2), pipe(2), vread(2)
+.SH DIAGNOSTICS
+As mentioned,
+0 is returned when the end of the file has been reached.
+If the read was otherwise unsuccessful
+the return value is \-1.
+Many conditions
+can generate an error:
+physical I/O errors, bad buffer address,
+preposterous
+.I nbytes,
+file descriptor not that of
+an input file.
+.SH "ASSEMBLER (PDP-11)"
+(read = 3.)
+.br
+(file descriptor in r0)
+.br
+.B sys read; buffer; nbytes
+.br
+(byte count in r0)