NAME
ioctl - Controls devices
SYNOPSIS
#include <sys/ioctl.h>
ioctl(
int d,
unsigned long request,
char *argp );
PARAMETERS
d Specifies the file descriptor of the requested device.
request
Specifies the ioctl command to be performed on the dev-
ice.
argp Points to an parameter array for the request.
DESCRIPTION
The ioctl() function performs a variety of operations on
open descriptors. In particular, many operating charac-
teristics of character special files (for example, termi-
nals) may be controlled with ioctl() requests.
An ioctl() request has encoded in it whether the parameter
is an "in" parameter or "out" parameter, and the size of the
argp parameter in bytes. Macros and defines used in speci-
fying an ioctl() request are located in the sys/ioctl.h
file.
RETURN VALUES
If an error occurs, a value of -1 is returned and errno is
set to indicate the error.
ERRORS
If the ioctl() function fails, errno may be set to one of
the following values:
[EBADF] The d parameter is not a valid descriptor.
[ENOTTY] The d parameter is not associated with a
character special device.
[ENOTTY] The specified request does not apply to the
kind of object that the descriptor d refer-
ences.
[EINVAL] Either the request or argp parameter is not
valid.
RELATED INFORMATION
Functions: exec(2), fcntl(2)
Files: tty(7) lvm(7)
Acknowledgement and Disclaimer