Linux Standard Base Core Specification 3.1 | ||
---|---|---|
<<< Previous | Next >>> |
Socket ioctl() commands are a subset of the ioctl() calls, which can perform a variety of functions on sockets. sockfd shall be an open file descriptor referring to a socket (see the socket() or accept() functions).
Socket ioctl() commands apply to the underlying network interfaces, and affect the entire system, not just the file descriptor used to issue the ioctl().
The following values for request are accepted:
Get the interface configuration list for the system.
Note: The SIOCGIFCONF interface is superceded by the if_nameindex() family of functions (see ISO POSIX (2003)). A future version of this specification may withdraw this value for request.
ifc_ifcu.ifcu_req
field
to point to an array of ifreq structures, and
set ifc_len
to the size in bytes of this allocated
array. Upon return, ifc_len
will contain the size in bytes of the array which was actually used.
If it is the same as the length upon calling, the caller
should assume that the array was too small and try again with a
larger array.On success, SIOCGIFCONF shall return a nonnegative value.
Rationale: Historical UNIX systems disagree on the meaning of the return value.
Get the interface flags for the indicated interface.
argp shall point to a
ifreq structure. Before calling, the
caller should fill in the ifr_name
field with the interface name, and upon return, the
ifr_ifru.ifru_flags
field is set
with the interface flags.
Get the interface address for the given interface.
argp shall point to a
ifreq structure. Before calling, the
caller should fill in the ifr_name
field with the interface name, and upon return, the
ifr_ifru.ifru_addr
field is set
with the interface address.
Get the interface broadcast address for the given interface.
argp shall point to a
ifreq structure. Before calling, the
caller should fill in the ifr_name
field with the interface name, and upon return, the
ifr_ifru.ifru_broadcast
field is set
with the interface broadcast address.
Get the network mask for the given interface.
argp shall point to a
ifreq structure. Before calling, the
caller should fill in the ifr_name
field with the interface name, and upon return, the
ifr_ifru.ifru_netmask
field is set
with the network mask.
Get the Maximum Transmission Unit (MTU) size for the given interface.
argp shall point to a
ifreq structure. Before calling, the
caller should fill in the ifr_name
field with the interface name, and upon return, the
ifr_ifru.ifru_mtu
field is set
with the MTU.
Get the amount of queued unread data in the receive buffer. argp shall point to an integer where the result is to be placed.
Note: Some implementations may also support the use of FIONREAD on other types of file descriptor. However, the LSB only specifies its behavior for a socket related file descriptor.
On success, if request is
SIOCGIFCONF, a non-negative integer shall be returned.
If request is not SIOCGIFCONF, on success
0 is returned.
On error, -1 is returned and
the global variable errno
is set appropriately.
<<< Previous | Home | Next >>> |
ioctl | Up | ttyio |