Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (r) read64_(2)
No data transfer occurs past the current end-of-file (EOF). If the starting position is at or after the
end-of-file, 0 (zero) is returned.
If a write( ), write64_(),orwritev() call contains so much data that the file system needs to
resize a pipe or FIFO buffer, a read from that pipe or FIFO file can return up to 52 kilobytes of
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 read64_() 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 read64_() 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 read64_() 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 read64_() function blocks until data becomes
available or an error occurs.
• If the O_NONBLOCK flag is set, the read64_() function returns the value -1 and sets
errno to [EWOULDBLOCK].
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 read64_() function blocks until data becomes
available or an error occurs.
• If the O_NONBLOCK flag is set, the read64_() function returns the value -1 and sets
errno to [EAGAIN].
If the read64_() function is interrupted by a signal before it reads any data, it returns the value -1
with errno set to [EINTR]. If the read64_() function is interrupted by a signal after it has suc-
cessfully read some data, it returns the number of bytes read.
The read64_() function returns the number of bytes with the value 0 (zero) for any unwritten
portion of a regular file prior to EOF.
When reading from a device special file, the return of EOF has no effect on subsequent calls to
the read64_() function. When modem disconnect is detected, an EOF is returned. The errno
variable is not set to [EIO].
Upon successful completion, the read64_() 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.
527186-023 Hewlett-Packard Company 6−9