stropts.h(0P)
π stropts.h β STREAMS interface (STREAMS) π
okay bestie, welcome to the POSIX Programmer's Manual, this one's about stropts.h, and it's literally the STREAMS header, no cap. it's giving β¨interfaceβ¨ and it's a whole vibe. let's get into it π«Ά
πΈ 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.
fr fr, read that twice. Linux might do its own thing, or might not even have it. don't come for me, come for your kernel π
β¨ NAME β¨
stropts.h β STREAMS interface (STREAMS)
π SYNOPSIS π
#include <stropts.h>
that's it. that's the whole synopsis. iconic behavior honestly π
π DESCRIPTION π
okay so this header is basically a little family of structs and constants and function prototypes, and we're gonna meet every single one of them. no skipping. i said what i said.
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. yes, opaque. mysterious. main character energy π₯
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 symbolic constants for the ioctl() request argument π
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 viaI_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 STREAMSioctl().I_SWROPTβ Set the write mode.I_UNLINKβ Disconnect two STREAMs.
π constants for use with I_LOOK π
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.
πΈ constants for use with I_FLUSH πΈ
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.
β¨ constants for use with I_SETSIG β¨
The <stropts.h> header shall define at least the following symbolic constants for use with I_SETSIG:
S_BANDURGβ When used in conjunction withS_RDBAND,SIGURGis generated instead ofSIGPOLLwhen 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 theSIGPOLLsignal 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 toS_OUTPUT.
π¦ constant for use with I_PEEK π¦
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.
π
constants for use with I_SRDOPT π
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 aread().RPROTDISβ Discard the control part of a message, delivering any data part, when a process issues aread().RPROTNORMβ Failread()with[EBADMSG]if a message containing a control part is at the front of the STREAM head read queue.
π constant for use with I_SWOPT π
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 awrite()of 0 bytes occurs.
β constants for use with I_ATMARK β
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.
π constant for use with I_UNLINK π
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.
π constants for getmsg(), getpmsg(), putmsg(), and putpmsg() π
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 vibes-y optional bits π§
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 function declarations π₯
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.
bestie. it said None. that's the whole section. we move π
π RATIONALE π
None.
again. nothing. beautiful. iconic. β¨
π 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()
like. go read those too. they're all connected, iykyk π¦
π 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 .
okay that's the whole page, we ate and left no crumbs π this was IEEE/The Open Group, 2017, and the page is stropts.h(0P) β mwah, love u, go read <sys/types.h> next πβ¨π
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms