NXWriteEx

Performs a full featured, parameter-block write.

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

Syntax

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

Parameters

ioInfo

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

ioAsyncId

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

Return Values

If successful, returns zero, and in the ioProcessed field of the NXIo_t structure, returns a non‑negative integer indicating the number of bytes actually written. Otherwise, returns one of the following error codes:

Decimal

Hex

Constant

Description

4

0x04

NX_EBADF

The ioHandle is not a valid file handle or descriptor opened for writing

9

0x09

NX_EINVAL

The ioVector is invalid.

12

0x0C

NX_ENOSPC

During the write operation, there is no free space left on the device.

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 a connection to a remote file.

71

0x47

NX_EFBIG

The NXWrite function attempted to extend the size of the file beyond the system specified limits.

105

0x69

NX_ENOCONTEXT

The calling thread has no NKS context.

Remarks

The NXIo_t structure is used for both reading and writing. NXIo_t contains a general description of all the fields.

The writing 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 written completely before the next buffer is attempted. If a call to NXWriteEx requests that more bytes be written than there is room for-for example, if the call would exceed the system file size limit or the free space on the device-only as many bytes as there is room for will be written.An NXWriteEx operation also updates the modification time and the last accessed time unless the file had been created by NXFileOpenEx with the NX_OFLAG_BACKUP flag.

See Also