Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ioctl(2) — Ultrix-32 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

execve(2)

fcntl(2)

devio(4)

intro(4n)

mu(4)

nbuf(4)

tty(4)

ioctl(2)

NAME

ioctl − control device

SYNTAX

#include <sys/ioctl.h>

ioctl(d, request, argp)
int d, request;
char *argp;

DESCRIPTION

The ioctl call performs a variety of functions on open descriptors.  In particular, many operating characteristics of character special files (for example, terminals) may be controlled with ioctl requests. Certain ioctl requests operate on a number of device types. These include informational ioctl requests which tell you about the device attached to a given special file, such as devio(4), and ioctl requests that control buffering to a device, such as nbuf(4). The descriptions of various devices in section 4 discuss how ioctl applies to them. Also consult <sys/ioctl.h> for more information.

An  ioctl request has encoded in it whether the argument is an “in” parameter or “out” parameter, and the size of the argument argp in bytes.  Macros and defines used in specifying an ioctl request are located in the file <sys/ioctl.h>. 

If an error has occurred, a value of −1 is returned and errno is set to indicate the error. 

DIAGNOSTICS

The ioctl call will fail if one or more of the following are true:

[EBADF] D is not a valid descriptor. 

[ENOTTY] D is not associated with a character special device. 

[ENOTTY] The specified request does not apply to the kind of object which the descriptor d references. 

[EINVAL] Request or argp is not valid. 

SEE ALSO

execve(2), fcntl(2), devio(4), intro(4n), mu(4), nbuf(4) tty(4),

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026