Open System Services System Calls Reference Manual (G06.28+, H06.05+)
spt_readx(2) OSS System Calls Reference Manual
data, regardless of the size of PIPE_BUF. If the buffer cannot be resized for the write operation,
a read from the pipe or FIFO file does not return more than 8192 bytes per call, regardless of the
setting of O_NONBLOCK.
When attempting to read from an empty pipe (or FIFO file):
— If no process has the pipe open for writing, the spt_readx() function returns the
value 0 (zero) to indicate EOF.
— If some process has the pipe open for writing:
— If the O_NONBLOCK flag is not set, the spt_readx() function blocks
until either some data is written or the pipe is closed by all processes that
had opened the pipe for writing.
— If the O_NONBLOCK flag is set, the spt_readx() function returns the
value -1 and sets errno to [EAGAIN].
When attempting to read from a socket and no data is currently available:
— If the O_NONBLOCK flag is not set, the spt_readx() function blocks until data
becomes available.
— If the O_NONBLOCK flag is set, the spt_readx() function returns the value -1
and sets errno to [EAGAIN]. The O_NONBLOCK flag has no effect if data is
available.
When attempting to read from a character special file that supports nonblocking reads,
such as a terminal, and no data is currently available:
— If the O_NONBLOCK flag is not set, the spt_readx() function blocks until data
becomes available.
— If the O_NONBLOCK flag is set, the spt_readx() function returns the value -1
and sets errno to [EAGAIN]. The O_NONBLOCK flag has no effect if data is
available.
If it is interrupted by a signal before it reads any data, the read() function returns the
value -1 with errno set to [EINTR]. If it is interrupted by a signal after it has success-
fully read some data, the read() function returns the number of bytes read.
The spt_readx() function returns the number of bytes with the value 0 (zero) for any
unwritten portion of a regular file before the EOF indication.
When reading from a device special file, the return of EOF has no effect on subsequent
calls to the spt_readx() function. When modem disconnect is detected, an EOF indica-
tion is returned. The errno variable is not set to [EIO].
Upon successful completion, the spt_readx() function marks the st_atime field of the
file for update.
Use on Guardian Objects
After a call to the fork(), tdm_fork( ),ortdm_spawn( ) function, the initial position within a
Guardian EDIT file (a file in /G with file code 101) is the same for both parent and child
processes. However, the position is not shared. Moving the current position from within one
process does not move it in the other process.
7−264 Hewlett-Packard Company 527186-007