Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

close(2)

fcntl(2)

getmsg(2)

ioctl(2)

open(2)

pipe(2)

poll(2)

putmsg(2)

read(2)

signal(2)

write(2)

stropts(5)                                                       stropts(5)

NAME
     stropts - STREAMS interface

SYNOPSIS
     #include <stropts.h>

DESCRIPTION
     The <stropts.h> header defines the bandinfo structure that includes at
     least the following members:

     unsigned char bipri
     int           biflag

     The <stropts.h> header defines the strpeek structure that includes at
     least the following members:

     struct strbuf ctlbuf
     struct strbuf databuf
     long          flags

     The <stropts.h> header defines the strbuf structure that includes at
     least the following members:

     int           maxlen     maximum buffer length
     int           len        length of data
     char         *buf        pointer to buffer

     The <stropts.h> header defines the strfdinsert structure that includes
     at least the following members:

     struct strbuf ctlbuf
     struct strbuf databuf
     long          flags
     int           fildes
     int           offset

     The <stropts.h> header defines the strioctl structure that includes at
     least the following members:

     int           iccmd
     int           ictimout
     int           iclen
     char         *icdp

     The <stropts.h> header defines the strrecvfd structure that includes
     at least the following members:

     int           fd
     uidt         uid
     gidt         gid





Page 1                       Reliant UNIX 5.44                Printed 11/98

stropts(5)                                                       stropts(5)

     The uidt and gidt types are defined through typedef as described in
     <sys/types.h>.

     The <stropts.h> header defines the strlist structure that includes at
     least the following members:

     int               slnmods
     struct strmlist *slmodlist

     The <stropts.h> header defines the strmlist structure that includes
     at least the following member:

     char          lname[FMNAMESZ+1]

     At least the following macros are defined for use as the request argu-
     ment to ioctl():

     IPUSH           Push STREAMS module onto the top of the current
                      STREAM, just below the STREAM head.

     IPOP            Remove STREAMS module from just below the STREAM
                      head.

     ILOOK           Retrieve the name of the module just below the STREAM
                      head and place it in a character string. At least the
                      following macros are defined for use as the arg argu-
                      ment:

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

     IFLUSH          This request flushes all input and/or output queues,
                      depending on the value of the arg argument. At least
                      the following macros are defined for use as the arg
                      argument:

                      FLUSHR       Flush read queues.

                      FLUSHW       Flush write queues.

                      FLUSHRW      Flush read and write queues.

     IFLUSHBAND      Flush only band specified.

     ISETSIG         Informs the STREAM head that the process wants the
                      SIGPOLL signal issued [see signal(2) and signal(5)]
                      when a particular event has occurred on the STREAM.

                      The header <stropts.h> defines these possible values
                      for arg when ISETSIG is specified:




Page 2                       Reliant UNIX 5.44                Printed 11/98

stropts(5)                                                       stropts(5)

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

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

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

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

                      SOUTPUT     The write queue for normal data (prior-
                                   ity 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.

                      SWRNORM     Same as SOUTPUT.

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

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

                      SERROR      Notification of an error condition
                                   reaches the STREAM head.

                      SHANGUP     Notification of a hangup reaches the
                                   STREAM head.

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

     IGETSIG         Returns the events for which the calling process is
                      currently registered to be sent a SIGPOLL signal.

     IFIND           Compares the names of all modules currently present
                      in the STREAM to the name pointed to by arg.






Page 3                       Reliant UNIX 5.44                Printed 11/98

stropts(5)                                                       stropts(5)

     IPEEK           Allows a process to retrieve the information in the
                      first message on the STREAM head read queue without
                      taking the message off the queue. At least the fol-
                      lowing macros are defined for use as the arg argu-
                      ment:

                      RSHIPRI     Only look for high-priority messages.

     ISRDOPT         Sets the read mode. At least the following macros are
                      defined for use as the arg argument:

                      RNORM        Byte-STREAM mode, the default.

                      RMSGD        Message-discard mode.

                      RMSGN        Message-nondiscard mode.

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

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

     IGRDOPT         Returns the current read mode setting.

     INREAD          Counts the number of data bytes in data blocks in the
                      first message on the STREAM head read queue.

     IFDINSERT       Creates a message from the specified buffer(s), adds
                      information about another STREAM, and sends the mes-
                      sage downstream.

     ISTR            Constructs an internal STREAMS ioctl() message and
                      sends that message downstream.

     ISWROPT         Sets the write mode. At least the following macros
                      are defined for use as the arg argument:

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

     IGWROPT         Returns the current write mode setting.

     ISENDFD         Requests the STREAM associated with fd to send a mes-
                      sage, containing a file pointer, to the STREAM head
                      at the other end of a STREAMS pipe.



Page 4                       Reliant UNIX 5.44                Printed 11/98

stropts(5)                                                       stropts(5)

     IRECVFD         Retrieves the file descriptor associated with the
                      message sent by an ISENDFD ioctl() over a STREAMS
                      pipe.

     ILIST           This request allows the process to list all the
                      module names on the STREAM, up to and including the
                      topmost driver name.

     IATMARK         This request allows the process to see if the current
                      message on the STREAM head read queue is "marked" by
                      some module downstream. At least the following macros
                      are defined for use as the arg argument:

                      ANYMARK      Check if the message is marked.

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

     ICKBAND         Check if the message of a given priority band exists
                      on the STREAM head read queue.

     IGETBAND        Return the priority band of the first message on the
                      STREAM head read queue.

     ICANPUT         Check if a certain band is writable.

     ISETCLTIME      Allows the process to set the time the STREAM head
                      will delay when a STREAM is closing and there is data
                      on the write queues.

     IGETCLTIME      Returns the close time delay.

     ILINK           Connects two STREAMs.

     IUNLINK         Disconnects the two STREAMs. The header defines at
                      least the following value for all:

                      MUXIDALL    Unlink all STREAMs linked to the STREAM
                                   associated with fd.

     IPLINK          Connects two STREAMs with a persistent link.

     IPUNLINK        Disconnects the two STREAMs that were connected with
                      a persistent link.

     The following macros are defined for getmsg(), getpmsg(), putmsg() and
     putpmsg():

     MSGANY          Receive any message.

     MSGBAND         Receive message from specified band.



Page 5                       Reliant UNIX 5.44                Printed 11/98

stropts(5)                                                       stropts(5)

     MSGHIPRI        Send/Receive high priority message.

     MORECTL          More control information is left in message.

     MOREDATA         More data is left in message.

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

     The following are declared as functions in the <stropts.h> header and
     may also be defined as macros:

     int  isastream(int fildes);
     int  getmsg(int fd, struct strbuf *ctlptr, struct strbuf *dataptr,
               int *flagsp);
     int  getpmsg(int fd, struct strbuf *ctlptr, struct strbuf *dataptr,
               int *bandp, int *flagsp);
     int  ioctl(int fildes, int request, ... );
     int  putmsg(int fd, const struct strbuf *ctlptr,
               const struct strbuf *dataptr, int flags);
     int  putpmsg(int fd, const struct strbuf *ctlptr,
               const struct strbuf *dataptr, int band, int flags);
     int  fattach(int fildes, const char *path);
     int  fdetach(const char *path);

SEE ALSO
     close(2), fcntl(2), getmsg(2), ioctl(2), open(2), pipe(2), poll(2),
     putmsg(2), read(2), signal(2), write(2).


























Page 6                       Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026