ioctl(2) DG/UX R4.11MU05 ioctl(2)
NAME
ioctl - control a device
SYNOPSIS
#include <sys/ioctl.h>
#include <unistd.h>
int ioctl (fildes, command, argument)
int fildes;
int command;
int argument;
where:
fildes A valid, active file descriptor
command A device control command
argument A pointer to the argument for the control command
DESCRIPTION
ioctl provides a variety of operations on descriptors. fildes is an
active, valid descriptor. command is an I/O control command to be
performed on fildes using argument as an argument. Not all commands
require an argument.
The 88open BCS version of ioctl accepts values for command only as
specified in the BCS.
The following two commands apply to any open file. In both cases,
argument is ignored.
FIOCLEX Set the `close-on-exec' attribute of fildes. This causes
the file to be closed upon execution of the exec operation.
FIONCLEX Clear the `close-on-exec' attribute of fildes. This causes
the file to remain open across exec operations.
All other commands invoke the type manager of the object to which
fildes refers to perform the I/O control operation. Usually, the
object must be a character-special device.
The commands, arguments, and error conditions for particular kinds of
I/O are documented in: rmt(7) (magnetic tapes), streamio(7)
(STREAMS), termio(7) (terminals).
ACCESS CONTROL
None.
RETURN VALUE
0 Completed successfully.
-1 An error occurred. errno is set to indicate the error.
DIAGNOSTICS
Errno may be set to one of the following error codes:
EBADF fildes is not a valid, active descriptor.
ENOTTY fildes does not refer to a character-special device and
command only operates on character-special devices.
EINVAL command or argument is not valid.
EINTR The call was interrupted by a signal.
Additional errors may be given by the type managers.
SEE ALSO
stty(1), exec(2), fcntl(2), socket(2), rmt(7), streamio(7), st(7),
termio(7).
Licensed material--property of copyright holder(s)