Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

read64_(2) OSS System Calls Reference Manual
NAME
read64_ - Reads from a file
LIBRARY
H-series and J-series OSS processes: implicit libraries
32-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/zputdll
64-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/yputdll
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <unistd.h>
long long read64_(
int filedes,
void _ptr64 *buffer,
unsigned long long nbytes);
PARAMETERS
filedes Specifies an open file descriptor obtained from a successful call to the accept(),
creat(), creat64(), dup(), dup2( ), fcntl(), open(), open64(), pipe(), socket(),
or socketpair() function.
buffer Points to the buffer to receive data read.
nbytes Specifies the number of bytes to read from the file associated with the filedes
parameter.
If the value of nbytes is 0 (zero), the read64_() function returns 0 (zero). There
are no other results.
If the value of nbytes is greater than SSIZE_MAX, the read64_() function
returns -1 and sets errno to [EINVAL].
DESCRIPTION
The read64_() function attempts to read nbytes bytes of data from the file associated with the
filedes parameter into the buffer pointed to by the buffer parameter.
To pass a 32-bit pointer from a 32-bit Guardian or OSS client, read() or read64_() may be
called with a 32-bit pointer argument.
To pass a 64-bit pointer from a 32-bit Guardian or OSS client, read64_() must be called with a
64-bit pointer argument.
32-bit Guardian and 64-bit OSS clients can pass 32-bit pointers and 64-bit pointers to read64_().
On regular files and devices capable of seeking, the read64_() function starts at a position in the
file given by the file pointer associated with the filedes parameter. Upon return from the
read64_() function, the file pointer is incremented by the number of bytes actually read.
Devices that are incapable of seeking always read from the current position. For such devices,
the value of the file pointer after a call to the read64_() function is always 0 (zero).
Upon successful completion, the read64_() function returns the number of bytes actually read
and placed in the buffer. This number is never greater than the value of the nbytes parameter.
The value returned can be less than nbytes if the number of bytes left in the file is less than
nbytes, if the read64_() request was interrupted by a signal, or if the file is a pipe, FIFO file,
socket, or special file and has fewer than nbytes bytes immediately available for reading. For
example, a read64_() from a file associated with a terminal might return one typed line of data.
68 Hewlett-Packard Company 527186-023