NXFifoOpen

Opens an existing FIFO or creates a new one.

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

Syntax

  #include <nks/fsio.h> 
  
  int NXFifoOpen (
     NXPathCtx_t   pathCtx,
     const void   *pathname,
     NXMode_t      mode,
     size_t        fifoSize,
     NXHandle_t   *fifoHandle); 
  

Parameters

pathCtx

(IN) Specifies a path context. On NetWare, this parameter is ignored so set it to 0.

pathname

(IN) Points to a null-terminated Unicode or ASCII string, which specifies the name of the FIFO to open (or create).

mode

(IN) Specifies how the FIFO is used (see NKS Open Modes).

fifoSize

(IN) Specifies the maximum amount of data that can be held in the FIFO. If zero is passed, a buffer of NX_FIFO_BUFSIZE is used.

fifoHandle

(OUT) Points to the handle of the opened or created FIFO.

Return Values

If successful, returns 0 and a FIFO handle in the fifoHandle parameter. Otherwise, returns one of the following error codes and -1 in the fifoHandle parameter.

Decimal

Hex

Constant

Description

1

0x01

NX_ENOENT

A component of the path prefix (as specified by the pathname parameter) does not exist, or the pathname parameter is NULL.

4

0x04

NX_EBADF

Invalid path context.

9

0x09

NX_EINVAL

The pathCtx parameter was specified, but the pathname parameter indicates a full path.

64

0x40

NX_EISDIR

A directory object that has the same name as the specified file exists.

65

0x41

NX_ENAMETOOLONG

The contents of the pathname parameter are longer than the system-permitted name length.

Remarks

For more information about FIFOs, see FIFOs.

Each time a FIFO is opened, the mode flags determine whether the open is for reading or writing, never both. By default, FIFOs are opened in a blocking state. To set the FIFO in a nonblocking state, OR the nonblocking flag to the read or write flag.

See Also