<!DOCTYPE html PUBLIC "‐//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">     <html
xmlns="http://www.w3.org/1999/xhtml"> <head>
    <link            rel="stylesheet"             type="text/css"
href="../../../style.css" title="style" />
    <link  rel="stylesheet"  type="text/css"  href="../style.css"
title="style" />
    <meta             http‐equiv="content‐type"              con‐
tent="text/html;charset=utf‐8" />

    <title>stropts.h.0p ‐ Linux manual page</title> </head>

<body>

<div        class="page‐top"><a       id="top_of_page"></a></div>
<!‐‐%%%TOP_BAR%%%‐‐> <!‐‐%%%PAGE_START%%%‐‐>

<table class="sec‐table"> <tr>
    <td>
        <p class="section‐dir"> <a href="#PROLOG">PROLOG</a> | <a
href="#NAME">NAME</a>  |  <a  href="#SYNOPSIS">SYNOPSIS</a>  | <a
href="#DESCRIPTION">DESCRIPTION</a> |  <a  href="#APPLICATION_US‐
AGE">APPLICATION&nbsp;USAGE</a>   |  <a  href="#RATIONALE">RATIO‐
NALE</a>   |   <a    href="#FUTURE_DIRECTIONS">FUTURE&nbsp;DIREC‐
TIONS</a>    |   <a   href="#SEE_ALSO">SEE&nbsp;ALSO</a>   |   <a
href="#COPYRIGHT">COPYRIGHT</a>
        </p>
    </td>
    <td class="search‐box">
        <div class="man‐search‐box">

            <form                method="get"                 ac‐
tion="http://www.google.com/search">
                <fieldset class="man‐search">
                    <input    type="text"    name="q"   size="10"
maxlength="255" value="" />
                    <input type="hidden"  name="sitesearch"  val‐
ue="man7.org/linux/man‐pages" />
                    <input  type="submit" name="sa" value="Search
online pages" />
                </fieldset>
            </form>

        </div>
    </td>
    <td> </td> </tr> </table>

<pre> <span class="headline">stropts.h(0P)             POSIX Pro‐
grammer’s  Manual             stropts.h(0P)</span>  </pre> <h2><a
id="PROLOG" href="#PROLOG"></a>PROLOG  &nbsp; &nbsp; &nbsp;  &nb‐
sp;        <a        href="#top_of_page"><span        class="top‐
link">top</span></a></h2><pre>
       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 be‐
havior), or
       the interface may not be  implemented  on  Linux.   </pre>
<h2><a id="NAME" href="#NAME"></a>NAME  &nbsp; &nbsp; &nbsp; &nb‐
sp;        <a        href="#top_of_page"><span        class="top‐
link">top</span></a></h2><pre>
       stropts.h  —  STREAMS  interface  (<b>STREAMS</b>)  </pre>
<h2><a id="SYNOPSIS" href="#SYNOPSIS"></a>SYNOPSIS  &nbsp; &nbsp;
&nbsp;    &nbsp;    <a    href="#top_of_page"><span   class="top‐
link">top</span></a></h2><pre>
       #include &lt;stropts.h&gt; </pre> <h2><a  id="DESCRIPTION"
href="#DESCRIPTION"></a>DESCRIPTION   &nbsp; &nbsp; &nbsp; &nbsp;
<a             href="#top_of_page"><span              class="top‐
link">top</span></a></h2><pre>
       The   <i>&lt;stropts.h&gt;</i>  header  shall  define  the
<b>bandinfo </b>structure, which
       shall include at least the following members:

           <b>int            bi_flag  </b>Flushing type.
           unsigned char  bi_pri   Priority band.

       The  <i>&lt;stropts.h&gt;</i>  header  shall  define   the
<b>strpeek </b>structure, which
       shall include at least the following members:

           <b>struct  strbuf  ctlbuf   </b>The control portion of
the message.
           struct strbuf  databuf  The data portion of  the  mes‐
sage.
           t_uscalar_t    flags    RS_HIPRI or 0.

       The   <i>&lt;stropts.h&gt;</i>  header  shall  define  the
<b>strbuf </b>structure, which shall
       include at least the following members:

           <b>char  *buf     </b>Pointer to buffer.
           <b>int    len     </b>Length of data.
           <b>int    maxlen  </b>Maximum buffer length.

       The  <i>&lt;stropts.h&gt;</i>  header  shall  define   the
<b>strfdinsert </b>structure, which
       shall include at least the following members:

           <b>struct  strbuf  ctlbuf   </b>The control portion of
the message.
           struct strbuf  databuf  The data portion of  the  mes‐
sage.
           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   <i>&lt;stropts.h&gt;</i>  header  shall  define  the
<b>strioctl </b>structure, which
       shall include at least the following members:

           <b>int    ic_cmd     </b><i>ioctl</i>() command.
           char  *ic_dp      Pointer to buffer.
           int    ic_len     Length of data.
           int    ic_timout  Timeout for response.

       The  <i>&lt;stropts.h&gt;</i>  header  shall  define   the
<b>strrecvfd </b>structure, which
       shall include at least the following members:

           <b>int    fd   </b>Received file descriptor.
           gid_t  gid  GID of sender.
           uid_t  uid  UID of sender.

       The   <i>&lt;stropts.h&gt;</i>  header  shall  define  the
<b>uid_t </b>and <b>gid_t </b>types through
       <b>typedef</b>,          as          described          in
<i>&lt;sys/types.h&gt;</i>.

       The   <i>&lt;stropts.h&gt;</i>  header  shall  define  the
<b>t_scalar_t </b>and <b>t_uscalar_t</b>
       types, respectively, as signed and unsigned  opaque  types
of equal
       length of at least 32 bits.

       The   <i>&lt;stropts.h&gt;</i>  header  shall  define  the
<b>str_list </b>structure, which
       shall include at least the following members:

           <b>struct str_mlist  *sl_modlist   </b>STREAMS  module
names.
           int                 sl_nmods    Number of STREAMS mod‐
ule names.

       The  <i>&lt;stropts.h&gt;</i>  header  shall  define   the
<b>str_mlist </b>structure, which
       shall include at least the following member:

           <b>char    l_name[FMNAMESZ+1]   </b>A  STREAMS  module
name.

       The <i>&lt;stropts.h&gt;</i> header shall define at  least
the following symbolic
       constants  for  use  as  the  <i>request</i>  argument  to
<i>ioctl</i>():

       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 <i>ioctl</i>().

       I_SWROPT    Set the write mode.

       I_UNLINK    Disconnect two STREAMs.

       The  <i>&lt;stropts.h&gt;</i> header shall define at least
the following symbolic
       constant for use with I_LOOK:

       FMNAMESZ    The minimum size in bytes of  the  buffer  re‐
ferred to by
                   the <i>arg</i> argument.

       The  <i>&lt;stropts.h&gt;</i> 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 <i>&lt;stropts.h&gt;</i> 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  <i>&lt;stropts.h&gt;</i> header shall define at least
the following symbolic
       constant for use with I_PEEK:

       RS_HIPRI    Only look for high‐priority messages.

       The <i>&lt;stropts.h&gt;</i> 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 <i>read</i>().

       RPROTDIS    Discard the control part of a message,  deliv‐
ering any
                   data   part,   when   a   process   issues   a
<i>read</i>().

       RPROTNORM   Fail <i>read</i>() with <b>[EBADMSG] </b>if  a
message containing a
                   control  part  is  at  the front of the STREAM
head read
                   queue.

       The <i>&lt;stropts.h&gt;</i> header shall define at  least
the following symbolic
       constant for use with I_SWOPT:

       SNDZERO      Send  a zero‐length message downstream when a
<i>write</i>() of 0
                   bytes occurs.

       The <i>&lt;stropts.h&gt;</i> 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 <i>&lt;stropts.h&gt;</i> header shall define at  least
the following symbolic
       constant for use with I_UNLINK:

       MUXID_ALL    Unlink all STREAMs linked to the STREAM asso‐
ciated with
                   <i>fildes</i>.

       The <i>&lt;stropts.h&gt;</i> header shall define the  fol‐
lowing symbolic constants
       for  <i>getmsg</i>(),  <i>getpmsg</i>(),  <i>putmsg</i>(),
and <i>putpmsg</i>():

       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 <i>&lt;stropts.h&gt;</i> header may make  visible  all
of the symbols from
       <i>&lt;unistd.h&gt;</i>.

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

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

       <i>The  following  sections  are  informative.</i>  </pre>
<h2><a  id="APPLICATION_USAGE"  href="#APPLICATION_USAGE"></a>AP‐
PLICATION    USAGE     &nbsp;    &nbsp;    &nbsp;    &nbsp;    <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       None.    </pre>   <h2><a   id="RATIONALE"    href="#RATIO‐
NALE"></a>RATIONALE     &nbsp;    &nbsp;    &nbsp;    &nbsp;   <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       None.   </pre>  <h2><a  id="FUTURE_DIRECTIONS"  href="#FU‐
TURE_DIRECTIONS"></a>FUTURE DIRECTIONS  &nbsp; &nbsp; &nbsp; &nb‐
sp;        <a        href="#top_of_page"><span        class="top‐
link">top</span></a></h2><pre>
       None.    </pre>   <h2><a   id="SEE_ALSO"    href="#SEE_AL‐
SO"></a>SEE    ALSO     &nbsp;    &nbsp;    &nbsp;    &nbsp;   <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       <a href="../man0/sys_types.h.0p.html">sys_types.h(0p)</a>,
<a href="../man0/unistd.h.0p.html">unistd.h(0p)</a>

       The  System  Interfaces   volume   of   POSIX.1‐2008,   <a
href="../man3/close.3p.html">close(3p)</a>, <a href="../man3/fat‐
tach.3p.html">fattach(3p)</a>,
       <a     href="../man3/fcntl.3p.html">fcntl(3p)</a>,      <a
href="../man3/fdetach.3p.html">fdetach(3p)</a>,                <a
href="../man3/getmsg.3p.html">getmsg(3p)</a>,                  <a
href="../man3/ioctl.3p.html">ioctl(3p)</a>,                    <a
href="../man3/isastream.3p.html">isastream(3p)</a>,
       <a      href="../man3/open.3p.html">open(3p)</a>,       <a
href="../man3/pipe.3p.html">pipe(3p)</a>,                      <a
href="../man3/read.3p.html">read(3p)</a>,                      <a
href="../man3/poll.3p.html">poll(3p)</a>,                      <a
href="../man3/putmsg.3p.html">putmsg(3p)</a>,                  <a
href="../man3/signal.3p.html">signal(3p)</a>,
       <a    href="../man3/write.3p.html">write(3p)</a>    </pre>
<h2><a  id="COPYRIGHT"  href="#COPYRIGHT"></a>COPYRIGHT    &nbsp;
&nbsp;  &nbsp;  &nbsp;  <a  href="#top_of_page"><span class="top‐
link">top</span></a></h2><pre>
       Portions of this text  are  reprinted  and  reproduced  in
electronic form
       from  IEEE Std 1003.1, 2013 Edition, Standard for Informa‐
tion
       Technology ‐‐ Portable Operating System Interface (POSIX),
The Open
       Group  Base  Specifications Issue 7, Copyright (C) 2013 by
the
       Institute of Electrical and Electronics Engineers, Inc and
The Open
       Group.  (This is POSIX.1‐2008 with the 2013 Technical Cor‐
rigendum 1
       applied.) In the event of  any  discrepancy  between  this
version and
       the  original IEEE and The Open Group Standard, the origi‐
nal IEEE and
       The Open Group Standard is the referee document. The orig‐
inal
       Standard     can     be     obtained    online    at    <a
href="http://www.unix.org/online.html">http://www.unix.org/on‐
line.html</a> .

       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
       <a      href="https://www.kernel.org/doc/man‐pages/report‐
ing_bugs.html">https://www.kernel.org/doc/man‐pages/report‐
ing_bugs.html</a> .

<span class="footline">IEEE/The Open  Group                  2013
stropts.h(0P)</span> </pre>

<hr class="end‐man‐text" />

<hr class="start‐footer" />

<div class="footer">

<table class="colophon‐table">
    <tr>
    <td class="pub‐info">
        <p>
            HTML rendering created 2019‐08‐02
            by  <a  href="http://man7.org/mtk/index.html">Michael
Kerrisk</a>,
            author of
            <a  href="http://man7.org/tlpi/"><em>The  Linux  Pro‐
gramming Interface</em></a>,
            maintainer of the
            <a href="https://www.kernel.org/doc/man‐pages/">Linux
<em>man‐pages</em> project</a>.
        </p>
        <p>
            For details of in‐depth
            <strong>Linux/UNIX system programming training  cour‐
ses</strong>
            that  I  teach,  look <a href="http://man7.org/train‐
ing/">here</a>.
        </p>
        <p>
            Hosting   by    <a    href="http://www.jambit.com/in‐
dex_en.html">jambit GmbH</a>.
        </p>
        <p>
            <a href="http://validator.w3.org/check?uri=referer">
            <img src="http://www.w3.org/Icons/valid‐xhtml11"
                alt="Valid XHTML 1.1" height="31" width="88" />
            </a>
        </p>
    </td>
    <td class="colophon‐divider">
    </td>
    <td class="tlpi‐cover">
        <a                      href="http://man7.org/tlpi/"><img
src="http://man7.org/tlpi/cover/TLPI‐front‐cover‐vsmall.png"
alt="Cover of TLPI" /></a>
    </td>
    </tr> </table>

</div>

<hr class="end‐footer" />

</body> </html>