[Previous] [Contents] [Index] [Next]

ioctl()

Control a device

Synopsis:

#include <sys/ioctl.h> 

int ioctl( int d, 
           long request, 
           ... );

Library:

unix3r.lib, unix3s.lib

Description:

The ioctl() function manipulates the underlying parameters of files. In particular, it can be used to control many of the operating attributes of files (such as the attributes of terminals).

The request argument determines whether the subsequent arguments are an "in" or "out" parameter; it also specifies the size of the arguments in bytes. Macros and defines used in specifying a request are located in the file <sys/ioctl.h>.


Note: The argument d must be an open file descriptor.

Returns:

A value based on the request, or -1 if an error occurs (errno is set).

Errors:

EBADF
Invalid descriptor d.
EINVAL
The request or optional variables aren't valid.
ENOTTY
The d argument isn't associated with a character special device; the specified request doesn't apply to the kind of object that the descriptor d references.

Classification:

Standard Unix

Safety:
Interrupt handler No
Signal handler No
Thread No

[Previous] [Contents] [Index] [Next]