Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — UMIPS/BSD System Programmer's Package 2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

 

read − read input

cc = read(d, buf, nbytes)
int cc, d;
char *buf;
int nbytes;

attempts to read of data from the object referenced by the descriptor into the buffer pointed to by On objects capable of seeking, the starts at a position given by the pointer associated with (see Upon return from the pointer is incremented by the number of bytes actually read.  Objects that are not capable of seeking always read from the current position.  The value of the pointer associated with such an object is undefined.  Upon successful completion, returns the number of bytes actually read and placed in the buffer.  The system guarantees to read the number of bytes requested if the descriptor references a normal file that has that many bytes left before the end-of-file, but in no other case.  If the returned value is 0, then end-of-file has been reached.  If successful, the number of bytes actually read is returned.  Otherwise, a −1 is returned and the global variable is set to indicate the error. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026