posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
_XOPEN_STREAMS

XSI Streams (_XOPEN_STREAMS) option. More...

Macros

#define RS_HIPRI   BIT(0)
 Flag: message carries high-priority data.
 

Functions

int putmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr, int flags)
 Send a STREAMS message downstream.
 
int fdetach (const char *path)
 Detach a STREAMS-based file descriptor from a mount point.
 
int fattach (int fildes, const char *path)
 Attach a STREAMS file descriptor to a pathname in the filesystem.
 
int getmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
 Receive the next message from a STREAMS file descriptor.
 
int getpmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *bandp, int *flagsp)
 Receive a priority-banded message from a STREAMS file descriptor.
 
int isastream (int fildes)
 Test whether a file descriptor refers to a STREAMS file.
 

Detailed Description

XSI Streams (_XOPEN_STREAMS) option.

See also
XSI_STREAMS (_XOPEN_STREAMS)

Macro Definition Documentation

◆ RS_HIPRI

#define RS_HIPRI   BIT(0)

Flag: message carries high-priority data.

Definition at line 28 of file stropts.h.

Function Documentation

◆ fattach()

int fattach ( int  fildes,
const char *  path 
)

Attach a STREAMS file descriptor to a pathname in the filesystem.

Parameters
fildesSTREAMS file descriptor to attach.
pathExisting pathname to attach the STREAMS fd to.
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fattach.html

◆ fdetach()

int fdetach ( const char *  path)

Detach a STREAMS-based file descriptor from a mount point.

Parameters
pathPathname previously used with fattach().
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdetach.html

◆ getmsg()

int getmsg ( int  fildes,
struct strbuf ctlptr,
struct strbuf dataptr,
int *  flagsp 
)

Receive the next message from a STREAMS file descriptor.

Parameters
fildesSTREAMS file descriptor.
ctlptrOutput: control part buffer, or NULL.
dataptrOutput: data part buffer, or NULL.
flagspInput/output: 0 or RS_HIPRI to request high-priority messages only.
Returns
0 if complete message received, 1 if more to follow, -1 on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getmsg.html

◆ getpmsg()

int getpmsg ( int  fildes,
struct strbuf ctlptr,
struct strbuf dataptr,
int *  bandp,
int *  flagsp 
)

Receive a priority-banded message from a STREAMS file descriptor.

Parameters
fildesSTREAMS file descriptor.
ctlptrOutput: control part buffer, or NULL.
dataptrOutput: data part buffer, or NULL.
bandpInput/output: priority band.
flagspInput/output: message flags.
Returns
0 if complete message received, 1 if more to follow, -1 on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpmsg.html

◆ isastream()

int isastream ( int  fildes)

Test whether a file descriptor refers to a STREAMS file.

Parameters
fildesFile descriptor to test.
Returns
1 if fildes is a STREAMS file, 0 if not, -1 with errno set on error.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/isastream.html

◆ putmsg()

int putmsg ( int  fildes,
const struct strbuf ctlptr,
const struct strbuf dataptr,
int  flags 
)

Send a STREAMS message downstream.

Parameters
fildesSTREAMS file descriptor.
ctlptrControl part of the message, or NULL.
dataptrData part of the message, or NULL.
flags0 or RS_HIPRI.
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/putmsg.html