---
name: "stropts.h"
section: "0p"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/stropts.h"
---

# stropts.h(0p)

STREAMS interface (STREAMS)

## PROLOG

This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME

stropts.h — STREAMS interface (**STREAMS**)

## SYNOPSIS

```
#include <stropts.h>
```

## DESCRIPTION

The *\<stropts.h\>* header shall define the **bandinfo** structure, which shall include at least the following members:

```
int            bi_flag  Flushing type.
unsigned char  bi_pri   Priority band.
```

The *\<stropts.h\>* header shall define the **strpeek** structure, which shall include at least the following members:

```
struct strbuf  ctlbuf   The control portion of the message.
struct strbuf  databuf  The data portion of the message.
t_uscalar_t    flags    RS_HIPRI or 0.
```

The *\<stropts.h\>* header shall define the **strbuf** structure, which shall include at least the following members:

```
char  *buf     Pointer to buffer.
int    len     Length of data.
int    maxlen  Maximum buffer length.
```

The *\<stropts.h\>* header shall define the **strfdinsert** structure, which shall include at least the following members:

```
struct strbuf  ctlbuf   The control portion of the message.
struct strbuf  databuf  The data portion of the message.
int            fildes   File descriptor of the other STREAM.
t_uscalar_t    flags    RS_HIPRI or 0.
int            offset   Relative location of the stored value.
```

The *\<stropts.h\>* header shall define the **strioctl** structure, which shall include at least the following members:

```
int    ic_cmd     ioctl() command.
char  *ic_dp      Pointer to buffer.
int    ic_len     Length of data.
int    ic_timout  Timeout for response.
```

The *\<stropts.h\>* header shall define the **strrecvfd** structure, which shall include at least the following members:

```
int    fd   Received file descriptor.
gid_t  gid  GID of sender.
uid_t  uid  UID of sender.
```

The *\<stropts.h\>* header shall define the **uid\_t** and **gid\_t** types through **typedef**, as described in *\<sys/types.h\>*.

The *\<stropts.h\>* header shall define the **t\_scalar\_t** and **t\_uscalar\_t** types, respectively, as signed and unsigned opaque types of equal length of at least 32 bits.

The *\<stropts.h\>* header shall define the **str\_list** structure, which shall include at least the following members:

```
struct str_mlist  *sl_modlist  STREAMS module names.
int                sl_nmods    Number of STREAMS module names.
```

The *\<stropts.h\>* header shall define the **str\_mlist** structure, which shall include at least the following member:

```
char  l_name[FMNAMESZ+1]  A STREAMS module name.
```

The *\<stropts.h\>* header shall define at least the following symbolic constants for use as the *request* argument to *ioctl*():

- I\_ATMARK

  Is the top message \`\`marked''?

- I\_CANPUT

  Is a band writable?

- I\_CKBAND

  See if any messages exist in a band.

- I\_FDINSERT

  Send implementation-defined information about another STREAM.

- I\_FIND

  Look for a STREAMS module.

- I\_FLUSH

  Flush a STREAM.

- I\_FLUSHBAND

  Flush one band of a STREAM.

- I\_GETBAND

  Get the band of the top message on a STREAM.

- I\_GETCLTIME

  Get close time delay.

- I\_GETSIG

  Retrieve current notification signals.

- I\_GRDOPT

  Get the read mode.

- I\_GWROPT

  Get the write mode.

- I\_LINK

  Connect two STREAMs.

- I\_LIST

  Get all the module names on a STREAM.

- I\_LOOK

  Get the top module name.

- I\_NREAD

  Size the top message.

- I\_PEEK

  Peek at the top message on a STREAM.

- I\_PLINK

  Persistently connect two STREAMs.

- I\_POP

  Pop a STREAMS module.

- I\_PUNLINK

  Dismantle a persistent STREAMS link.

- I\_PUSH

  Push a STREAMS module.

- I\_RECVFD

  Get a file descriptor sent via I\_SENDFD.

- I\_SENDFD

  Pass a file descriptor through a STREAMS pipe.

- I\_SETCLTIME

  Set close time delay.

- I\_SETSIG

  Ask for notification signals.

- I\_SRDOPT

  Set the read mode.

- I\_STR

  Send a STREAMS *ioctl*().

- I\_SWROPT

  Set the write mode.

- I\_UNLINK

  Disconnect two STREAMs.

The *\<stropts.h\>* header shall define at least the following symbolic constant for use with I\_LOOK:

- FMNAMESZ

  The minimum size in bytes of the buffer referred to by the *arg* argument.

The *\<stropts.h\>* header shall define at least the following symbolic constants for use with I\_FLUSH:

- FLUSHR

  Flush read queues.

- FLUSHRW

  Flush read and write queues.

- FLUSHW

  Flush write queues.

The *\<stropts.h\>* header shall define at least the following symbolic constants for use with I\_SETSIG:

- S\_BANDURG

  When used in conjunction with S\_RDBAND, SIGURG is generated instead of SIGPOLL when a priority message reaches the front of the STREAM head read queue.

- S\_ERROR

  Notification of an error condition reaches the STREAM head.

- S\_HANGUP

  Notification of a hangup reaches the STREAM head.

- S\_HIPRI

  A high-priority message is present on a STREAM head read queue.

- S\_INPUT

  A message, other than a high-priority message, has arrived at the head of a STREAM head read queue.

- S\_MSG

  A STREAMS signal message that contains the SIGPOLL signal reaches the front of the STREAM head read queue.

- S\_OUTPUT

  The write queue for normal data (priority band 0) just below the STREAM head is no longer full. This notifies the process that there is room on the queue for sending (or writing) normal data downstream.

- S\_RDBAND

  A message with a non-zero priority band has arrived at the head of a STREAM head read queue.

- S\_RDNORM

  A normal (priority band set to 0) message has arrived at the head of a STREAM head read queue.

- S\_WRBAND

  The write queue for a non-zero priority band just below the STREAM head is no longer full.

- S\_WRNORM

  Equivalent to S\_OUTPUT.

The *\<stropts.h\>* header shall define at least the following symbolic constant for use with I\_PEEK:

- RS\_HIPRI

  Only look for high-priority messages.

The *\<stropts.h\>* header shall define at least the following symbolic constants for use with I\_SRDOPT:

- RMSGD

  Message-discard mode.

- RMSGN

  Message-non-discard mode.

- RNORM

  Byte-STREAM mode, the default.

- RPROTDAT

  Deliver the control part of a message as data when a process issues a *read*().

- RPROTDIS

  Discard the control part of a message, delivering any data part, when a process issues a *read*().

- RPROTNORM

  Fail *read*() with **\[EBADMSG\]** if a message containing a control part is at the front of the STREAM head read queue.

The *\<stropts.h\>* header shall define at least the following symbolic constant for use with I\_SWOPT:

- SNDZERO

  Send a zero-length message downstream when a *write*() of 0 bytes occurs.

The *\<stropts.h\>* header shall define at least the following symbolic constants for use with I\_ATMARK:

- ANYMARK

  Check if the message is marked.

- LASTMARK

  Check if the message is the last one marked on the queue.

The *\<stropts.h\>* header shall define at least the following symbolic constant for use with I\_UNLINK:

- MUXID\_ALL

  Unlink all STREAMs linked to the STREAM associated with *fildes*.

The *\<stropts.h\>* header shall define the following symbolic constants for *getmsg*(), *getpmsg*(), *putmsg*(), and *putpmsg*():

- MORECTL

  More control information is left in message.

- MOREDATA

  More data is left in message.

- MSG\_ANY

  Receive any message.

- MSG\_BAND

  Receive message from specified band.

- MSG\_HIPRI

  Send/receive high-priority message.

The *\<stropts.h\>* header may make visible all of the symbols from *\<unistd.h\>*.

The *\<stropts.h\>* header may also define macros for message types using names that start with *M\_*.

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

```
int    fattach(int, const char *);
int    fdetach(const char *);
int    getmsg(int, struct strbuf *restrict, struct strbuf *restrict,
           int *restrict);
int    getpmsg(int, struct strbuf *restrict, struct strbuf *restrict,
           int *restrict, int *restrict);
int    ioctl(int, int, ...);
int    isastream(int);
int    putmsg(int, const struct strbuf *, const struct strbuf *, int);
int    putpmsg(int, const struct strbuf *, const struct strbuf *, int,
           int);
```

*The following sections are informative.*

## APPLICATION USAGE

None.

## RATIONALE

None.

## FUTURE DIRECTIONS

None.

## SEE ALSO

***\<sys\_types.h\>***, ***\<unistd.h\>***

The System Interfaces volume of POSIX.1‐2017, *close()*, *fattach()*, *fcntl()*, *fdetach()*, *getmsg()*, *ioctl()*, *isastream()*, *open()*, *pipe()*, *read()*, *poll()*, *putmsg()*, *signal()*, *write()*

## COPYRIGHT

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting\_bugs.html .
