NXReadEx

Performs a full-featured, parameter-block read.

Library:LibC
Classification:NKS
Service:File and Directory I/O

Syntax

  #include <nks/fsio.h> 
  
  int NXReadEx (
     NXIo_t        *ioInfo, 
     NXAsyncId_t   *ioAsyncId); 
  

Parameters

ioInfo

(IN) Points to the operation information on which the function executes the read operation.

ioAsyncId

(OUT) Points to the identity of the asynchronous operation. Not currently supported.

Return Values

If successful, returns 0, and in the ioProcessed field, returns a non-negative integer indicating the number of bytes actually read. Otherwise, returns one of the following error codes:

Decimal

Hex

Constant

Description

4

0x04

NX_EBADF

ioHandle is not a valid file handle or descriptor open for reading

24

0x18

NX_EAGAIN

Resource exhaustion prevents successful completion of the call.

28

0x1C

NX_EIO

A physical I/O error has occurred. This can indicate either a failure to read from a local volume or failure of connection to a remote file volume link.

105

0x69

NX_ENOCONTEXT

The calling thread has no NKS context.

Remarks

NXReadEx attempts to read from a file and to fill one or more record buffers in a vector list.

The NXIo_t structure is used for both reading and writing. NXIo_t contains a general description of all the fields. You can use the macro, ioBytesRead, to read the results in the ioProcessed field.

The reading of data proceeds from the position in the file indicated by ioOffset and proceeds for the length maintained in each I/O record by offset. Each buffer is read completely before the next buffer is attempted. If a call to NXReadEx requests that more bytes be read than there exist in the file, as many bytes as there are will be read.

An NXReadEx operation also updates the last accessed time unless the file had been opened by NXFileOpenEx with the NX_OFLAG_BACKUP flag.

See Also