Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

AWAIT(2)  —  Kubota Pacfic Computer Inc. (System Calls)

NAME

await − wait for asynchronous read to complete

SYNOPSYS

int await(fildes) int fildes;

DESCRIPTION

fildes is a file descriptor obtained from a creat(2), open(2), fcntl(2), or pipe(2) system call.

await suspends execution of the process until no asynchronous file read is pending on the specified file descriptor. 

Upon return from the call, and if the file was opened with the O_BASYNC flag, the number of bytes actually read is returned if the read is successful.  A 0 is returned if end of file was encountered, and a -1 is returned if an error was encountered. 

If the file was not opened with the O_BASYNC flag, return from the await is immediate, and a 1 is returned. 

await fails if one or more of the following are true:

[EBADF] fildes is not a valid file descriptor open for reading. 

[EINTR] A signal was caught during the await system call. 

RETURN VALUE

In asynchronous mode, upon return, a non-negative integer is returned indicating the number of bytes actually read. A 0 is returned for end of file, and a -1 is returned to indicate an error condition, and errno is set to indicate the exact error.  SEE ALSO creat(2), fcntl(2), open(2), read(2), astat(2)

September 02, 1992

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