Open System Services System Calls Reference Manual (G06.25+, H06.03+)

ioctl(2) OSS System Calls Reference Manual
NAME
ioctl - Controls device les
LIBRARY
G-series native OSS processes: system library
H-series OSS processes: implicit libraries
SYNOPSIS
#include <stropts.h>
#include <ioctl.h>
int ioctl(
int ledes,
int request,
/* arg */ ...);
The ellipsis (...) indicates that the function is variable.
PARAMETERS
filedes Species the open le descriptor of the tty device or socket.
request Species the function to be performed for the tty device or socket.
arg A pointer to data to be used by the function or to be provided by the function.
DESCRIPTION
The ioctl() function controls the operations of devices. The requests that ioctl() performs on
devices are device-specic.
The ioctl() function passes the request parameter to the le designated by the open le descriptor
ledes. If the ledes parameter identies an unsupported device type, the function call fails, and
errno is set to the value [EINVAL].
Valid values for the request parameter for AF_INET or AF_INET6 sockets are:
FIONREAD Gets the number of bytes available for reading and stores it at the int pointed at
by arg.
SIOCATMARK
Examines whether the socket is at an out-of-band data mark and stores it at the
int pointed at by arg. A nonzero value indicates that the socket is at an out-of-
band data mark; a zero value indicates that the socket is not at an out-of-band
data mark.
SIOCGIFNUM
Gets the number of interfaces that have been congured and stores it at the int
pointed at by arg.
FIONBIO Sets the blocking I/O/nonblocking I/O ag for the socket. If the arg is zero, the
socket is set to blocking I/O; otherwise, the socket is set to nonblocking I/O and
the ag is stored at the int pointed at by arg.
SIOCADDRT Adds a route. The data structure pointed to by arg is of type rtentry.
SIOCDELRT Deletes a route. The data structure pointed to by arg is of type rtentry.
360 Hewlett-Packard Company 527186-003