IOCTL(3P)
π ioctl β POSIX Programmer's Manual (3P) π
ok bestie, welcome to the POSIX Programmer's Manual page for ioctl, and it is long, so we're doing this in parts. grab a snack π. also this is the page for IOCTL(3P) β the POSIX one, not the Linux one, iykyk.
π 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. This is the POSIX spec, not a promise about your actual Linux box. If you're on Linux, go check the Linux manpage for what your kernel actually does. It might differ, or it might not even exist there at all. no cap.
β¨ NAME β¨
ioctl β control a STREAMS device (STREAMS)
π SYNOPSIS π
#include <stropts.h>
int ioctl(int fildes, int request, ... /* arg */);
πΈ DESCRIPTION πΈ
okay so here's the vibe: ioctl() performs a whole variety of control functions on STREAMS devices. and for non-STREAMS devices? the functions performed by this call are unspecified. so like, unspecified-unspecified. don't come crying to me. π
The request argument and an optional third argument (with varying type) shall be passed to and interpreted by the appropriate part of the STREAM associated with fildes.
The fildes argument is an open file descriptor that refers to a device.
The request argument selects the control function to be performed and shall depend on the STREAMS device being addressed.
The arg argument represents additional information that is needed by this specific STREAMS device to perform the requested function. The type of arg depends upon the particular control request, but it shall be either an integer or a pointer to a device-specific data structure. so it's giving "mystery box" energy, but legally. π
The ioctl() commands applicable to STREAMS, their arguments, and error conditions that apply to each individual command are described below.
The following ioctl() commands, with error values indicated, are applicable to all STREAMS files:
π¦ the commands π¦
I_PUSHβ Pushes the module whose name is pointed to byargonto the top of the current STREAM, just below the STREAM head. It then calls theopen()function of the newly-pushed module.
The ioctl() function with the I_PUSH command shall fail if:
EINVALβ Invalid module name.ENXIOβ Open function of new module failed.ENXIOβ Hangup received onfildes.
I_POPβ Removes the module just below the STREAM head of the STREAM pointed to byfildes. Theargargument should be0in anI_POPrequest.
The ioctl() function with the I_POP command shall fail if:
EINVALβ No module present in the STREAM.ENXIOβ Hangup received onfildes.
I_LOOKβ Retrieves the name of the module just below the STREAM head of the STREAM pointed to byfildes, and places it in a character string pointed to byarg. The buffer pointed to byargshould be at leastFMNAMESZ+1bytes long, whereFMNAMESZis defined in<stropts.h>. (size matters, bestie β give it room.)
The ioctl() function with the I_LOOK command shall fail if:
EINVALβ No module present in the STREAM.
I_FLUSHβ Flushes read and/or write queues, depending on the value ofarg. Validargvalues are:FLUSHRβ Flush all read queues.FLUSHWβ Flush all write queues.FLUSHRWβ Flush all read and all write queues.
The ioctl() function with the I_FLUSH command shall fail if:
EINVALβ Invalidargvalue.EAGAINorENOSRβ Unable to allocate buffers for flush message.ENXIOβ Hangup received onfildes.
I_FLUSHBANDβ Flushes a particular band of messages. Theargargument points to abandinfostructure. Thebi_flagmember may be one ofFLUSHR,FLUSHW, orFLUSHRWas described above. Thebi_primember determines the priority band to be flushed.I_SETSIGβ Requests that the STREAMS implementation send theSIGPOLLsignal to the calling process when a particular event has occurred on the STREAM associated withfildes.I_SETSIGsupports an asynchronous processing capability in STREAMS. The value ofargis a bitmask that specifies the events for which the process should be signaled. It is the bitwise-inclusive OR of any combination of the following constants:S_RDNORMβ A normal (priority band set to0) message has arrived at the head of a STREAM head read queue. A signal shall be generated even if the message is of zero length.S_RDBANDβ A message with a non-zero priority band has arrived at the head of a STREAM head read queue. A signal shall be generated even if the message is of zero length.S_INPUTβ A message, other than a high-priority message, has arrived at the head of a STREAM head read queue. A signal shall be generated even if the message is of zero length.S_HIPRIβ A high-priority message is present on a STREAM head read queue. A signal shall be generated even if the message is of zero length.S_OUTPUTβ The write queue for normal data (priority band0) 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_WRNORMβ Equivalent toS_OUTPUT.S_WRBANDβ The write queue for a non-zero priority band just below the STREAM head is no longer full. This notifies the process that there is room on the queue for sending (or writing) priority data downstream.S_MSGβ A STREAMS signal message that contains theSIGPOLLsignal has reached the front of the STREAM head read queue.S_ERRORβ Notification of an error condition has reached the STREAM head.S_HANGUPβ Notification of a hangup has reached the STREAM head.S_BANDURGβ When used in conjunction withS_RDBAND,SIGURGis generated instead ofSIGPOLLwhen a priority message reaches the front of the STREAM head read queue.
If arg is 0, the calling process shall be unregistered and shall not receive further SIGPOLL signals for the stream associated with fildes.
Processes that wish to receive SIGPOLL signals shall ensure that they explicitly register to receive them using I_SETSIG. If several processes register to receive this signal for the same event on the same STREAM, each process shall be signaled when the event occurs. (everyone gets a signal, it's not a group chat with read receipts.)
The ioctl() function with the I_SETSIG command shall fail if:
EINVALβ The value ofargis invalid.EINVALβ The value ofargis0and the calling process is not registered to receive theSIGPOLLsignal.EAGAINβ There were insufficient resources to store the signal request.
I_GETSIGβ Returns the events for which the calling process is currently registered to be sent aSIGPOLLsignal. The events are returned as a bitmask in anintpointed to byarg, where the events are those specified in the description ofI_SETSIGabove.
The ioctl() function with the I_GETSIG command shall fail if:
EINVALβ Process is not registered to receive theSIGPOLLsignal.
I_FINDβ Compares the names of all modules currently present in the STREAM to the name pointed to byarg, and returns1if the named module is present in the STREAM, or returns0if the named module is not present.
The ioctl() function with the I_FIND command shall fail if:
EINVALβargdoes not contain a valid module name.
I_PEEKβ Retrieves the information in the first message on the STREAM head read queue without taking the message off the queue. It is analogous togetmsg()except that this command does not remove the message from the queue. Theargargument points to astrpeekstructure. (look, don't touch. peek, don't yeet.)
The application shall ensure that the maxlen member in the ctlbuf and databuf strbuf structures is set to the number of bytes of control information and/or data information, respectively, to retrieve. The flags member may be marked RS_HIPRI or 0, as described by getmsg(). If the process sets flags to RS_HIPRI, for example, I_PEEK shall only look for a high-priority message on the STREAM head read queue.
I_PEEK returns 1 if a message was retrieved, and returns 0 if no message was found on the STREAM head read queue, or if the RS_HIPRI flag was set in flags and a high-priority message was not present on the STREAM head read queue. It does not wait for a message to arrive. On return, ctlbuf specifies information in the control buffer, databuf specifies information in the data buffer, and flags contains the value RS_HIPRI or 0.
I_SRDOPTβ Sets the read mode using the value of the argumentarg. Read modes are described inread(). Validargflags are:RNORMβ Byte-stream mode, the default.RMSGDβ Message-discard mode.RMSGNβ Message-nondiscard mode.
The bitwise-inclusive OR of RMSGD and RMSGN shall return [EINVAL]. The bitwise-inclusive OR of RNORM and either RMSGD or RMSGN shall result in the other flag overriding RNORM which is the default.
In addition, treatment of control messages by the STREAM head may be changed by setting any of the following flags in arg:
RPROTNORMβ Failread()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 aread().RPROTDISβ Discard the control part of a message, delivering any data portion, when a process issues aread().
The ioctl() function with the I_SRDOPT command shall fail if:
EINVALβ Theargargument is not valid. periodt π
I_GRDOPT π
okay so I_GRDOPT is literally the read-mode reveal. It returns the current read mode setting β as described above, bestie β into an int pointed to by the argument arg. The read modes themselves? They're described in read(). iykyk. β¨
I_NREAD π¬
I_NREAD counts the number of data bytes in the data part of the first message on the STREAM head read queue and places this value in the int pointed to by arg. The return value for the command shall be the number of messages on the STREAM head read queue. For example, if 0 is returned in arg, but the ioctl() return value is greater than 0, this indicates that a zero-length message is next on the queue. the way that math is mathing π
I_FDINSERT π οΈ
I_FDINSERT creates a message from specified buffer(s), adds information about another STREAM, and sends the message downstream. The message contains a control part and an optional data part. The data and control parts to be sent are distinguished by placement in separate buffers, as described below. The arg argument points to a strfdinsert structure. slay β¨
The application shall ensure that the len member in the ctlbuf strbuf structure is set to the size of a t_uscalar_t plus the number of bytes of control information to be sent with the message. The fildes member specifies the file descriptor of the other STREAM, and the offset member β which must be suitably aligned for use as a t_uscalar_t β specifies the offset from the start of the control buffer where I_FDINSERT shall store a t_uscalar_t whose interpretation is specific to the STREAM end. The application shall ensure that the len member in the databuf strbuf structure is set to the number of bytes of data information to be sent with the message, or to 0 if no data part is to be sent. so many members, so little time π
The flags member specifies the type of message to be created. A normal message is created if flags is set to 0, and a high-priority message is created if flags is set to RS_HIPRI. For non-priority messages, I_FDINSERT shall block if the STREAM write queue is full due to internal flow control conditions. For priority messages, I_FDINSERT does not block on this condition. For non-priority messages, I_FDINSERT does not block when the write queue is full and O_NONBLOCK is set. Instead, it fails and sets errno to [EAGAIN]. no cap π
I_FDINSERT also blocks, unless prevented by lack of internal resources, waiting for the availability of message blocks in the STREAM, regardless of priority or whether O_NONBLOCK has been specified. No partial message is sent. important! π¨
The ioctl() function with the I_FDINSERT command shall fail if:
EAGAINβ A non-priority message is specified, theO_NONBLOCKflag is set, and the STREAM write queue is full due to internal flow control conditions.EAGAINorENOSRβ Buffers cannot be allocated for the message that is to be created.EINVALβ One of the following:- The
fildesmember of thestrfdinsertstructure is not a valid, open STREAM file descriptor. - The size of a
t_uscalar_tplusoffsetis greater than thelenmember for the buffer specified throughctlbuf. - The
offsetmember does not specify a properly-aligned location in the data buffer. - An undefined value is stored in
flags.
- The
ENXIOβ Hangup received on the STREAM identified by either thefildesargument or thefildesmember of thestrfdinsertstructure.ERANGEβ Thelenmember for the buffer specified throughdatabufdoes not fall within the range specified by the maximum and minimum packet sizes of the topmost STREAM module; or thelenmember for the buffer specified throughdatabufis larger than the maximum configured size of the data part of a message; or thelenmember for the buffer specified throughctlbufis larger than the maximum configured size of the control part of a message.
I_STR π§΅
I_STR constructs an internal STREAMS ioctl() message from the data pointed to by arg, and sends that message downstream. go little message, go! β¨
This mechanism is provided to send ioctl() requests to downstream modules and drivers. It allows information to be sent with ioctl(), and returns to the process any information sent upstream by the downstream recipient. I_STR shall block until the system responds with either a positive or negative acknowledgement message, or until the request times out after some period of time. If the request times out, it shall fail with errno set to [ETIME]. timeout vibes β³
At most, one I_STR can be active on a STREAM. Further I_STR calls shall block until the active I_STR completes at the STREAM head. The default timeout interval for these requests is 15 seconds. The O_NONBLOCK flag has no effect on this call. the way it just ignores O_NONBLOCK π
To send requests downstream, the application shall ensure that arg points to a strioctl structure.
The ic_cmd member is the internal ioctl() command intended for a downstream module or driver and ic_timout is the number of seconds (-1=infinite, 0=use implementation-defined timeout interval, >0=as specified) an I_STR request shall wait for acknowledgement before timing out. ic_len is the number of bytes in the data argument, and ic_dp is a pointer to the data argument. The ic_len member has two uses: on input, it contains the length of the data argument passed in, and on return from the command, it contains the number of bytes being returned to the process (the buffer pointed to by ic_dp should be large enough to contain the maximum amount of data that any module or the driver in the STREAM can return). two uses? versatile icon π
The STREAM head shall convert the information pointed to by the strioctl structure to an internal ioctl() command message and send it downstream.
The ioctl() function with the I_STR command shall fail if:
EAGAINorENOSRβ Unable to allocate buffers for theioctl()message.EINVALβ Theic_lenmember is less than0or larger than the maximum configured size of the data part of a message, oric_timoutis less than-1.ENXIOβ Hangup received onfildes.ETIMEβ A downstreamioctl()timed out before acknowledgement was received.
An I_STR can also fail while waiting for an acknowledgement if a message indicating an error or a hangup is received at the STREAM head. In addition, an error code can be returned in the positive or negative acknowledgement message, in the event the ioctl() command sent downstream fails. For these cases, I_STR shall fail with errno set to the value in the message. so if it fails, errno is whatever the message says π«
I_SWROPT βοΈ
I_SWROPT sets the write mode using the value of the argument arg. Valid bit settings for arg are:
SNDZEROβ Send a zero-length message downstream when awrite()of0bytes occurs. To not send a zero-length message when awrite()of0bytes occurs, the application shall ensure that this bit is not set inarg(for example,argwould be set to0). zero-length message? iconic π
The ioctl() function with the I_SWROPT command shall fail if:
EINVALβargis not the above value.
I_GWROPT π
I_GWROPT returns the current write mode setting, as described above, in the int that is pointed to by the argument arg. mirror mirror on the wall πͺ
I_SENDFD π¨
I_SENDFD creates a new reference to the open file description associated with the file descriptor arg, and writes a message on the STREAMS-based pipe fildes containing this reference, together with the user ID and group ID of the calling process. sending files like a boss π
The ioctl() function with the I_SENDFD command shall fail if:
EAGAINβ The sending STREAM is unable to allocate a message block to contain the file pointer; or the read queue of the receiving STREAM head is full and cannot accept the message sent byI_SENDFD.EBADFβ Theargargument is not a valid, open file descriptor.EINVALβ Thefildesargument is not connected to a STREAM pipe.ENXIOβ Hangup received onfildes.
The ioctl() function with the I_SENDFD command may fail if:
EINVALβ Theargargument is equal to thefildesargument. awkward π
I_RECVFD π₯
I_RECVFD retrieves the reference to an open file description from a message written to a STREAMS-based pipe using the I_SENDFD command, and allocates a new file descriptor in the calling process that refers to this open file description. The arg argument is a pointer to a strrecvfd data structure as defined in <stropts.h>. header file realness β¨
The fd member is a file descriptor. The uid and gid members are the effective user ID and effective group ID, respectively, of the sending process.
If O_NONBLOCK is not set, I_RECVFD shall block until a message is present at the STREAM head. If O_NONBLOCK is set, I_RECVFD shall fail with errno set to [EAGAIN] if no message is present at the STREAM head. block or fail, no in-between π
okay so if the message chillin' at the STREAM head is one that an I_SENDFD sent over, then boom β a brand-new file descriptor gets allocated for the open file descriptor that message is referencing. That shiny new fd gets dropped right into the fd member of the strrecvfd structure that arg is pointing at. π
The ioctl() function with the I_RECVFD command shall fail if:
EAGAINβ there's no message sitting at the STREAM head read queue and theO_NONBLOCKflag is set. no vibes, no message, no waiting. πEBADMSGβ the message at the STREAM head read queue is not a message containing a passed file descriptor. wrong message bestie, not it.EMFILEβ all file descriptors available to the process are currently open. every single one. full house. π«ENXIOβ hangup received onfildes. π
I_LIST
Lets the process list every module name on the STREAM, all the way up to and including the topmost driver name. π
So here's the tea: if arg is a null pointer, the return value shall be the number of modules β driver included β that are on the STREAM pointed to by fildes. That's the little pre-game so your process can allocate enough space for all the module names. Otherwise, arg should point to a str_list structure. π
The sl_nmods member says how many entries the process has allocated in the array. On return, the sl_modlist member of the str_list structure shall contain the list of module names, and the number of entries that have been filled into the sl_modlist array is found in the sl_nmods member (and yes, that number includes the number of modules including the driver). The return value from ioctl() shall be 0. The entries get filled in starting at the top of the STREAM and continuing downstream until either the end of the STREAM is reached, or the number of requested modules (sl_nmods) is satisfied. β¨
The ioctl() function with the I_LIST command shall fail if:
EINVALβ thesl_nmodsmember is less than1. give it at least one slot, bestie.EAGAINorENOSRβ unable to allocate buffers. π
I_ATMARK
Lets the process peek and see if the message at the head of the STREAM head read queue is marked by some module downstream. π
The arg argument decides how the checking goes down when there might be multiple marked messages sitting on the STREAM head read queue. It may take on the following values:
ANYMARKβ check if the message is marked.LASTMARKβ check if the message is the last one marked on the queue.
The bitwise-inclusive OR of the flags ANYMARK and LASTMARK is permitted. yes, you can have both. we love options. π
The return value shall be 1 if the mark condition is satisfied; otherwise, the value shall be 0.
The ioctl() function with the I_ATMARK command shall fail if:
EINVALβ invalidargvalue.
I_CKBAND
Checks if the message of a given priority band exists on the STREAM head read queue. This shall return 1 if a message of the given priority exists, 0 if no such message exists, or -1 on error. arg should be of type int. π¦
The ioctl() function with the I_CKBAND command shall fail if:
EINVALβ invalidargvalue.
I_GETBAND
Returns the priority band of the first message on the STREAM head read queue in the integer referenced by arg. π―
The ioctl() function with the I_GETBAND command shall fail if:
ENODATAβ no message on the STREAM head read queue. nothing there, bestie. π
I_CANPUT
Checks if a certain band is writable. arg is set to the priority band in question. The return value shall be 0 if the band is flow-controlled, 1 if the band is writable, or -1 on error. π
The ioctl() function with the I_CANPUT command shall fail if:
EINVALβ invalidargvalue.
I_SETCLTIME
This request lets the process set the time the STREAM head shall delay when a STREAM is closing and there's still data sitting on the write queues. β³
Before closing each module or driver, if there's data on its write queue, the STREAM head shall delay for the specified amount of time to let the data drain. If, after the delay, data is still present, it shall be flushed. The arg argument is a pointer to an integer specifying the number of milliseconds to delay, rounded up to the nearest valid value. If I_SETCLTIME is not performed on a STREAM, an implementation-defined default timeout interval is used.
The ioctl() function with the I_SETCLTIME command shall fail if:
EINVALβ invalidargvalue.
I_GETCLTIME
Returns the close time delay in the integer pointed to by arg. π°οΈ
Multiplexed STREAMS Configurations
The following commands are used for connecting and disconnecting multiplexed STREAMS configurations. These commands use an implementation-defined default timeout interval. (iykyk β it's implementation-defined, so don't come for me.)
I_LINK
Connects two STREAMs, where fildes is the file descriptor of the STREAM connected to the multiplexing driver, and arg is the file descriptor of the STREAM connected to another driver. The STREAM designated by arg is connected below the multiplexing driver. I_LINK requires the multiplexing driver to send an acknowledgement message to the STREAM head regarding the connection. This call shall return a multiplexer ID number (an identifier used to disconnect the multiplexer; see I_UNLINK) on success, and -1 on failure. π
The ioctl() function with the I_LINK command shall fail if:
ENXIOβ hangup received onfildes.ETIMEβ timeout before acknowledgement message was received at STREAM head. β°EAGAINorENOSRβ unable to allocate STREAMS storage to perform theI_LINK.EBADFβ theargargument is not a valid, open file descriptor.EINVALβ thefildesargument does not support multiplexing; orargis not a STREAM or is already connected downstream from a multiplexer; or the specifiedI_LINKoperation would connect the STREAM head in more than one place in the multiplexed STREAM. π«
An I_LINK can also fail while waiting for the multiplexing driver to acknowledge the request, if a message indicating an error or a hangup is received at the STREAM head of fildes. In addition, an error code can be returned in the positive or negative acknowledgement message. For these cases, I_LINK fails with errno set to the value in the message.
I_UNLINK
Disconnects the two STREAMs specified by fildes and arg. fildes is the file descriptor of the STREAM connected to the multiplexing driver. The arg argument is the multiplexer ID number that was returned by the I_LINK ioctl() command when a STREAM was connected downstream from the multiplexing driver. If arg is MUXID_ALL, then all STREAMs that were connected to fildes shall be disconnected. As in I_LINK, this command requires acknowledgement. βοΈ
The ioctl() function with the I_UNLINK command shall fail if:
ENXIOβ hangup received onfildes.ETIMEβ timeout before acknowledgement message was received at STREAM head. β°EAGAINorENOSRβ unable to allocate buffers for the acknowledgement message.EINVALβ invalid multiplexer ID number.
An I_UNLINK can also fail while waiting for the multiplexing driver to acknowledge the request if a message indicating an error or a hangup is received at the STREAM head of fildes. In addition, an error code can be returned in the positive or negative acknowledgement message. For these cases, I_UNLINK shall fail with errno set to the value in the message.
I_PLINK
Creates a persistent connection between two STREAMs, where fildes is the file descriptor of the STREAM connected to the multiplexing driver, and arg is the file descriptor of the STREAM connected to another driver. This call shall create a persistent connection which can exist even if the file descriptor fildes associated with the upper STREAM to the multiplexing driver is closed. π The STREAM designated by arg gets connected via a persistent connection below the multiplexing driver. I_PLINK requires the multiplexing driver to send an acknowledgement message to the STREAM head. This call shall return a multiplexer ID number (an identifier that may be used to disconnect the multiplexer; see I_PUNLINK) on success, and -1 on failure.
The ioctl() function with the I_PLINK command shall fail if:
ENXIOβ hangup received onfildes.ETIMEβ timeout before acknowledgement message was received at STREAM head. β°EAGAINorENOSRβ unable to allocate STREAMS storage to perform theI_PLINK.EBADFβ theargargument is not a valid, open file descriptor.EINVALβ thefildesargument does not support multiplexing; orargis not a STREAM or is already connected downstream from a multiplexer; or the specifiedI_PLINKoperation would connect the STREAM head in more than one place in the multiplexed STREAM. π«
An I_PLINK can also fail while waiting for the multiplexing driver to acknowledge the request, if a message indicating an error or a hangup is received at the STREAM head of fildes. In addition, an error code can be returned in the positive or negative acknowledgement message. For these cases, I_PLINK shall fail with errno set to the value in the message.
I_PUNLINKβ bestie, this one disconnects the two STREAMs specified byfildesandargfrom a persistent connection. π Thefildesargument is the file descriptor of the STREAM connected to the multiplexing driver. Theargargument is the multiplexer ID number that was returned by theI_PLINKioctl()command when a STREAM was connected downstream from the multiplexing driver. IfargisMUXID_ALL, then all STREAMs which are persistent connections tofildesshall be disconnected. As inI_PLINK, this command requires the multiplexing driver to acknowledge the request. π«Ά
The ioctl() function with the I_PUNLINK command shall fail if:
ENXIOβ Hangup received onfildes. πETIMEβ Timeout before acknowledgement message was received at STREAM head. β°EAGAINorENOSRβ Unable to allocate buffers for the acknowledgement message. πEINVALβ Invalid multiplexer ID number. π«
An I_PUNLINK can also fail while waiting for the multiplexing driver to acknowledge the request if a message indicating an error or a hangup is received at the STREAM head of fildes. In addition, an error code can be returned in the positive or negative acknowledgement message. For these cases, I_PUNLINK shall fail with errno set to the value in the message. β¨
β¨ RETURN VALUE β¨
Upon successful completion, ioctl() shall return a value other than -1 that depends upon the STREAMS device control function. Otherwise, it shall return -1 and set errno to indicate the error. π
π ERRORS π
Under the following general conditions, ioctl() shall fail if:
EBADFβ Thefildesargument is not a valid open file descriptor. π«EINTRβ A signal was caught during theioctl()operation. π‘EINVALβ The STREAM or multiplexer referenced byfildesis linked (directly or indirectly) downstream from a multiplexer. π
If an underlying device driver detects an error, then ioctl() shall fail if:
EINVALβ Therequestorargargument is not valid for this device. βEIOβ Some physical I/O error has occurred. π₯ENOTTYβ The file associated with thefildesargument is not a STREAMS device that accepts control functions. πENXIOβ Therequestandargarguments are valid for this device driver, but the service requested cannot be performed on this particular sub-device. π΅ENODEVβ Thefildesargument refers to a valid STREAMS device, but the corresponding device driver does not support theioctl()function. π
If a STREAM is connected downstream from a multiplexer, any ioctl() command except I_UNLINK and I_PUNLINK shall set errno to [EINVAL]. β οΈ
The following sections are informative.
πΈ EXAMPLES πΈ
None. (literally none, bestie β not even one example. π)
π¦ APPLICATION USAGE π¦
The implementation-defined timeout interval for STREAMS has historically been 15 seconds. β³
π RATIONALE π
None. (again, nothing to see here. π )
β¨ FUTURE DIRECTIONS β¨
The ioctl() function may be removed in a future version. π
π₯ SEE ALSO π₯
- Section 2.6, STREAMS
close()fcntl()getmsg()open()pipe()poll()putmsg()read()sigaction()write()
The Base Definitions volume of POSIX.1β2017, <stropts.h> π
π 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 . π
Source/version vibes: IEEE/The Open Group, 2017 β IOCTL(3P). Periodt. π β¨
π¦ 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