NXIoSetBlockingState

Sets the blocking state of I/O operations for the specified FIFO handle.

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

Syntax

  #include <nks/fsio.h> 
  
  int NXIoSetBlockingState (
     NXHandle_t   handle, 
     NXBool_t     blocking);
  

Parameters

handle

(IN) Specifies a handle (or descriptor) from a previously opened object.

blocking

(IN) Specifies whether the object is allowed to block:

  • TRUE I/O on the object is allowed to block
  • FALSE I/O on the object is not allowed to block

Return Values

If successful, returns 0. Otherwise, returns one of the following error codes:

Decimal

Hex

Constant

Description

4

0x04

NX_EBADF

handle no longer specifies an open object.

19

0x13

NX_EWRNGKND

The object is not a FIFO.

105

0x69

NX_ENOCONTEXT

The calling thread has no NKS context.

Remarks

The NXIoSetBlockingState function can be used to change the blocking state of I/O operations on the FIFO specified by the handle. For FIFOs, each end is identified by a separate handle. Consequently, the blocking state is independent for each end.

If a thread is already blocked for read or write on the object corresponding to a handle when the state is changed from blocking to non-blocking, it will be unblocked to return NX_EAGAIN.

See Also

NXFifoOpen