rdchk(S) 6 January 1993 rdchk(S) Name rdchk - checks to see if there is data to be read Syntax cc ... -lx int rdchk(fdes) 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 the process will not block when a read is attempted 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 when the pro- cess will block if it issues a read and 1 if it is okay to read. EBADF is returned if a rdchk is used on a semaphore file or if the file speci- fied does not exist. See also read(S) Standards conformance rdchk is not part of any currently supported standard; it is an extension of AT&T System V provided by the Santa Cruz Operation.