IOCTL(2) COMMAND REFERENCE IOCTL(2)
NAME
ioctl - control device
SYNOPSIS
#include <sys/ioctl.h>
ioctl(fd, request, argp)
int fd;
long request;
char *argp;
DESCRIPTION
Ioctl performs a variety of functions, specified by request,
on the open descriptor fd. In particular, many operating
characteristics of character special files (e.g. terminals)
may be controlled with ioctl requests.
An ioctl request has encoded in it whether the argument argp
is an "in" parameter or "out" parameter, and the size of
argp in bytes. Macros and defines used in specifying an
ioctl request are located in the file <sys/ioctl.h>.
The writeups of various devices in section 4 discuss how
ioctl applies to them. See that section for details.
DIAGNOSTICS
Ioctl will fail if one or more of the following are true:
[EBADF] Fd is not a valid open descriptor, or the
object it references is not readable or
writable.
[ENOTTY] The specified request does not apply to the
kind of object which the descriptor fd
references.
[EINVAL] Request or argp is not valid.
[EFAULT] Argp references an invalid address.
[EFAULT] The size encoded in request is invalid.
RETURN VALUE
If an error has occurred, a value of -1 is returned and
errno is set to indicate the error.
SEE ALSO
execve(2), fcntl(2), tty(4), and intro(4n).
Printed 4/6/89 1
%%index%%
na:264,74;
sy:338,908;
de:1246,1061;
di:2307,748;
rv:3055,236;
se:3291,180;
%%index%%000000000109