pxfread(3F)
PXFREAD - Read a file
As shipped in IRIX 6.5.22. Added in IRIX 6.5.19.
NAME PXFREAD - Read a file SYNOPSIS SUBROUTINE PXFREAD (ifildes, buf, nbyte, nread, ierror) INTEGER ifildes, nbyte, nread, ierror CHARACTER BUF(*) DESCRIPTION PXFREAD uses the read(2) function to read from a file associated with ifildes into a buffer. Return the actual number of bytes read and return the error status. The following are valid arguments for this routine: ifildes Default integer input variable containing a file descriptor. buf Output character variable containing the data read. nbyte Default input integer variable specifying the number of bytes to be read. nread Default output integer variable containing the number of bytes actually read. ierror Default integer output variable that contains zero if the operation was successful or nonzero if the operation was not successful. PXFREAD may return one of the following error values: EAGAIN Mandatory file and record locking was set, O_NDELAY was set, and there was a blocking record lock. EBADF If ifildes is not a valid file descriptor open for reading. EDEADLK If the read was going to go to sleep and would cause a deadlock situation to occur. EFAULT If buf points outside the allocated process address space. EINTR If read was interrupted by a signal. EINVAL If the call contains an argument that is not valid. ENOLCK If the sytem record lock table was full, the read could not go to sleep until the block record lock was removed. ENOMEM If PXFREAD is unable to obtain memory to create an internal buffer. ENXIO If the device associated with ifildes is a character special file that does not exist or the file pointer is out of range. On IRIX systems, PXFREAD may also return: EACCES If ifildes is open to a dynamic device and read permission is denied. EBADMSG If the message waiting to be read on a stream is not a data message. EIO If a physical I/O error has occurred, or the read cannot access the device or if ifildes has O_DIRECT or FDIRECT set and nbytes is greater than the number of bytes between the current file pointer position and the end of file. NOTES The PXF_DEFINITIONS module can be used by Fortran 90 users to enable caller-callee interface checking. In FORTRAN 77, a variable was not an array. Therefore, buf cannot be more than a character scalar in the 1003.9 standard. Fortran 90 extended the definition of variable to include an array. PXFREAD allows nbyte to be greater than the size of buf in order to allow buf to be an array. A subroutine interface does not pass the number of elements in the array and overindexing is legal in Fortran. Sections will be contiguous when passed. SEE ALSO read(2)