v7 man page for read

Query: read

OS: v7

Section: 2

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

READ(2) 							System Calls Manual							   READ(2)

NAME
read - read from file
SYNOPSIS
read(fildes, buffer, nbytes) char *buffer;
DESCRIPTION
A file descriptor is a word returned from a successful open, creat, dup, or pipe call. Buffer is the location of nbytes contiguous bytes into which the input will be placed. It is not guaranteed that all nbytes bytes will be read; for example if the file refers to a type- writer at most one line will be returned. In any event the number of characters read is returned. If the returned value is 0, then end-of-file has been reached.
SEE ALSO
open(2), creat(2), dup(2), pipe(2)
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 nbytes, file descriptor not that of an input file.
ASSEMBLER
(read = 3.) (file descriptor in r0) sys read; buffer; nbytes (byte count in r0) READ(2)
Related Man Pages
dup(2) - hpux
read(2) - freebsd
preadv(2) - debian
preadv(2) - freebsd
pread(2) - freebsd
Similar Topics in the Unix Linux Community
Measure thread execution (in C, unix)
How to read values and store in array?
How to read and Split a file?
UNIX Shell Scripting (Solaris) for File Checking
Forum Display - Thread Preview Text Animation