Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ read(2) — Purdue Xinu

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

close(2)

control(2)

getc(2)

open(2)

putc(2)

seek(2)

write(2)

READ(2)

NAME

read − device independent input routine

SYNOPSIS

int read(dev, buffer, numchars)
int dev;
char ∗buffer;
int numchars;

DESCRIPTION

Read will read up to numchars bytes from the I/O device given by dev.  It returns SYSERR if dev is incorrect.  It returns the number of characters read if successful.  The number of bytes actually returned depends on the device.  For example, when reading from a device of type "tty", each read normally returns one line.  For a disk, however, each read returns one block and the argument numchars is taken to be the index of the disk block desired. 

SEE ALSO

close(2), control(2), getc(2), open(2), putc(2), seek(2), write(2)

December 01, 1986  —  Xinu Programmer’s Manual

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