zRead

Reads from an open file object.

Service:File System Services (64-Bit)
Version:OES 2

Syntax

#include <zPublics.h>

STATUS zRead(
   Key_t   key,
   Xid_t   xid,
   QUAD    startingOffset,
   NINT    bytesToRead,
   void   *retBuffer,
   NINT   *retBytesRead);

Parameters

key

(IN) Specifies the file object (as returned by zOpen or zCreate) that is to be read.

xid

(IN) Specifies the transaction to which the request is bound. If the requested action is not part of a transaction, pass zNILXID.

startingOffset

(IN) Specifies which logical byte offset to begin reading in the file.

bytesToRead

(IN) Specifies the number of bytes to read from the file.

retBuffer

(OUT) Points to the data that was read.

retBytesRead

(OUT) Points to the number of bytes that were read.

Return Values

zOK

The operation completed successfully.

non-0

An error occurred (see Section 4.1, Return Values for a description).

Remarks

zRead reads the number of bytes specified by bytesToRead bytes, starting at the startingOffset from the file identified by key. The actual number of bytes read might be smaller than the requested number of bytes to be read. The retBuffer is supplied by the caller and must be large enough to hold the requested data.

See Also

zClose, zCreate, zFlush, zOpen, zWrite