10 int ioctl(int d, int request, ...)
12 [The "third" argument is traditionally char *argp, and
13 will be so named for this discussion.]
16 The ioctl function manipulates the underlying device
17 parameters of special files. In particular, many operat-
18 ing characteristics of sockets and network devices
19 may be controlled with ioctl requests. The argu-
20 ment d must be an open file descriptor.
22 An ioctl request has encoded in it whether the argument is
23 an in parameter or out parameter, and the size of the
24 argument argp in bytes. Macros and defines used in speci-
25 fying an ioctl request are located in the file
29 On success, zero is returned. On error, -1 is returned,
30 and errno is set appropriately.
33 EBADF d is not a valid descriptor.
35 EFAULT argp references an inaccessible memory area.
37 ENOTTY d is not associated with a character special
40 ENOTTY The specified request does not apply to the kind of
41 object that the descriptor d references.
43 EINVAL Request or argp is not valid.