Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rdchk(2) — Motorola System V 88k Release 4 Version 4.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

read(2)

rdchk(2)  —  SYSTEM CALLS

NAME

rdchk − check to see if there is data to be read

SYNOPSIS

cc [flag . . .] file . . . -lx
rdchk(int fdes);

DESCRIPTION

rdchk checks to see if a process will block if it attempts to read the file designated by fdes.  rdchk returns 1 if there is data to be read or if it is the end of the file (EOF).  In this context, the proper sequence of calls using rdchk is:

if(rdchk(fildes) > 0)
    read(fildes, buffer, nbytes);

DIAGNOSTICS

rdchk returns -1 if an error occurs (for example, EBADF), 0 if the process will block if it issues a read and 1 if it is okay to read.  EBADF is returned if a rdchk is done on a semaphore file or if the file specified doesn’t exist. 

SEE ALSO

read(2)

  —  Application Compatibility Package

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