Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ioctl(2) — OSF/1 SILVER Baselevel 4 rev36

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exec(2)

fcntl(2)

streamio(7)

tty(7)

lvm(7)

ioctl(2)  —  System Calls

OSF

NAME

ioctl − Controls devices

SYNOPSIS

#include <sys/ioctl.h> ioctl(
int d,
unsigned long request,
char ∗argp );
char ∗argp );

PARAMETERS

dSpecifies the file descriptor of the requested device. 

requestSpecifies the ioctl command to be performed on the device. 

argpPoints to an parameter array for the request. 

DESCRIPTION

The ioctl() function performs a variety of operations on open descriptors.  In particular, many operating characteristics of character special files (for example, terminals) 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 specifying an ioctl() request are located in the sys/ioctl.h file. 

ioctl() performs a variety of control functions on devices and STREAMS.  For non-STREAMS files, the functions performed by this call are device-specific control functions.  The arguments request and arg are passed to the file designated by fildes and are interpreted by the device driver.  This control is infrequently used on non-STREAMS devices, with the basic input/output functions performed through the read() and write() system calls. 

For STREAMS files, specific functions are performed by the ioctl() call as described in streamio(7). 

STREAMS errors are described in streamio(7). 

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 references. 

[EINVAL]Either the request or argp parameter is not valid. 

RELATED INFORMATION

Functions: exec(2), fcntl(2), streamio(7)

Files: tty(7) lvm(7)
 
 

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