stropts.h(3)               POSIX Programmer's Manual              stropts.h(3)



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

NNAAMMEE
       stropts.h -- STREAMS interface (SSTTRREEAAMMSS)

SSYYNNOOPPSSIISS
       #include <stropts.h>

DDEESSCCRRIIPPTTIIOONN
       The _<_s_t_r_o_p_t_s_._h_> header shall define the bbaannddiinnffoo structure, which shall
       include at least the following members:


           int            bi_flag  Flushing type.
           unsigned char  bi_pri   Priority band.

       The _<_s_t_r_o_p_t_s_._h_> header shall define the ssttrrppeeeekk 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 _<_s_t_r_o_p_t_s_._h_> header shall define the ssttrrbbuuff 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 _<_s_t_r_o_p_t_s_._h_> header shall define the ssttrrffddiinnsseerrtt 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 _<_s_t_r_o_p_t_s_._h_> header shall define the ssttrriiooccttll structure, which shall
       include at least the following members:


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

       The _<_s_t_r_o_p_t_s_._h_> header shall define the ssttrrrreeccvvffdd 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 _<_s_t_r_o_p_t_s_._h_> header shall define the uuiidd__tt and ggiidd__tt types through
       ttyyppeeddeeff, as described in _<_s_y_s_/_t_y_p_e_s_._h_>.

       The _<_s_t_r_o_p_t_s_._h_> header shall define the tt__ssccaallaarr__tt and tt__uussccaallaarr__tt
       types, respectively, as signed and unsigned opaque types of equal
       length of at least 32 bits.

       The _<_s_t_r_o_p_t_s_._h_> header shall define the ssttrr__lliisstt 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 _<_s_t_r_o_p_t_s_._h_> header shall define the ssttrr__mmlliisstt structure, which
       shall include at least the following member:


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

       The _<_s_t_r_o_p_t_s_._h_> header shall define at least the following symbolic
       constants for use as the _r_e_q_u_e_s_t argument to _i_o_c_t_l():

       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_o_c_t_l().

       I_SWROPT    Set the write mode.

       I_UNLINK    Disconnect two STREAMs.

       The _<_s_t_r_o_p_t_s_._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
                   _a_r_g argument.

       The _<_s_t_r_o_p_t_s_._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 _<_s_t_r_o_p_t_s_._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 _<_s_t_r_o_p_t_s_._h_> header shall define at least the following symbolic
       constant for use with I_PEEK:

       RS_HIPRI    Only look for high-priority messages.

       The _<_s_t_r_o_p_t_s_._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 _r_e_a_d().

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

       RPROTNORM   Fail _r_e_a_d() with [[EEBBAADDMMSSGG]] if a message containing a
                   control part is at the front of the STREAM head read queue.

       The _<_s_t_r_o_p_t_s_._h_> header shall define at least the following symbolic
       constant for use with I_SWOPT:

       SNDZERO     Send a zero-length message downstream when a _w_r_i_t_e() of 0
                   bytes occurs.

       The _<_s_t_r_o_p_t_s_._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 _<_s_t_r_o_p_t_s_._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
                   _f_i_l_d_e_s.

       The _<_s_t_r_o_p_t_s_._h_> header shall define the following symbolic constants
       for _g_e_t_m_s_g(), _g_e_t_p_m_s_g(), _p_u_t_m_s_g(), and _p_u_t_p_m_s_g():

       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 _<_s_t_r_o_p_t_s_._h_> header may make visible all of the symbols from
       _<_u_n_i_s_t_d_._h_>.

       The _<_s_t_r_o_p_t_s_._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);

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       None.

RRAATTIIOONNAALLEE
       None.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       <<ssyyss__ttyyppeess..hh>>, <<uunniissttdd..hh>>

       The System Interfaces volume of POSIX.1-2017, _c_l_o_s_e(), _f_a_t_t_a_c_h(),
       _f_c_n_t_l(), _f_d_e_t_a_c_h(), _g_e_t_m_s_g(), _i_o_c_t_l(), _i_s_a_s_t_r_e_a_m(), _o_p_e_n(), _p_i_p_e(),
       _r_e_a_d(), _p_o_l_l(), _p_u_t_m_s_g(), _s_i_g_n_a_l(), _w_r_i_t_e()

CCOOPPYYRRIIGGHHTT
       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 .



IEEE/The Open Group                  2017                         stropts.h(3)
