Open System Services System Calls Reference Manual (G06.25+, H06.03+)
ioctl(2) OSS System Calls Reference Manual
NAME
ioctl - Controls device files
LIBRARY
G-series native OSS processes: system library
H-series OSS processes: implicit libraries
SYNOPSIS
#include <stropts.h>
#include <ioctl.h>
int ioctl(
int filedes,
int request,
/* arg */ ...);
The ellipsis (...) indicates that the function is variable.
PARAMETERS
filedes Specifies the open file descriptor of the tty device or socket.
request Specifies 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-specific.
The ioctl() function passes the request parameter to the file designated by the open file descriptor
filedes. If the filedes parameter identifies 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 configured and stores it at the int
pointed at by arg.
FIONBIO Sets the blocking I/O/nonblocking I/O flag 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 flag 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.
3−60 Hewlett-Packard Company 527186-003