Research V3 development
authorKen Thompson <ken@research.uucp>
Thu, 15 Feb 1973 15:46:50 +0000 (10:46 -0500)
committerKen Thompson <ken@research.uucp>
Thu, 15 Feb 1973 15:46:50 +0000 (10:46 -0500)
Work on file man/man2/read.2

Co-Authored-By: Dennis Ritchie <dmr@research.uucp>
Synthesized-from: v3

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

diff --git a/man/man2/read.2 b/man/man2/read.2
new file mode 100644 (file)
index 0000000..e06998f
--- /dev/null
@@ -0,0 +1,42 @@
+.pa 1
+.he 'READ (II)'3/15/72'READ (II)'
+.ti 0
+NAME           read  --  read from file
+.sp
+.ti 0
+SYNOPSIS       (file descriptor in r0)
+.br
+sys read; buffer; nbytes  / read = 3.
+.br
+(nread in r0)
+.sp
+.ti 0
+DESCRIPTION    A file descriptor is a word
+returned from a successful open\b\b\b\b____ or creat\b\b\b\b\b_____ call.
+.sp
+Buffer\b\b\b\b\b\b______ is the location of nbytes\b\b\b\b\b\b______ contiguous
+bytes into which the input will be placed.  It is not guaranteed
+that all nbytes\b\b\b\b\b\b______ 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
+in r0.
+.sp
+If r0 returns with value 0, then
+end-of-file has been reached.
+.sp
+.ti 0
+SEE ALSO       open(II), creat(II)
+.sp
+.ti 0
+DIAGNOSTICS    As mentioned,
+r0 is 0 on return when the end of the file has been reached.
+If the read was other\ 6wise unsuccessful
+the error bit (c-bit) is set.  Many conditions,
+can generate an error:
+physical I/O errors, bad buffer address,
+preposterous nbytes\b\b\b\b\b\b______, file descriptor not that of
+an input file.
+.sp
+.ti 0
+BUGS           --