|
|
DataMuseum.dkPresents historical artifacts from the history of: ICL Comet 32 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about ICL Comet 32 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 2347 (0x92b)
Types: TextFile
Notes: UNIX file
Names: »ioctl.2«
└─⟦26887b7e0⟧ Bits:30009717 Comet 32 harddisk image
└─⟦28c352965⟧ »/a« UNIX Filesystem
└─⟦this⟧ »usr/man/man2/ioctl.2«
.ig
@(#)ioctl.2 2.1 7/1/84
@(#)Copyright (C) 1983 by National Semiconductor Corp.
..
.TH IOCTL 2
.SH NAME
ioctl, stty, gtty \- control device
.SH SYNOPSIS
.nf
.B #include <sgtty.h>
.PP
.B ioctl(fildes, request, argp)
.B struct sgttyb *argp;
.PP
.B stty(fildes, argp)
.B struct sgttyb *argp;
.PP
.B gtty(fildes, argp)
.B struct sgttyb *argp;
.fi
.SH DESCRIPTION
.I Ioctl
performs a variety of functions
on character special files (devices).
The writeups of various devices
in section 4 discuss how
.I ioctl
applies to them.
.PP
For certain status setting and status inquiries
about terminal devices, the functions
.I stty
and
.I gtty
are implemented by
.RS
.B ioctl(fildes, TIOCSETP, argp)
.br
.B ioctl(fildes, TIOCGETP, argp)
.RE
.LP
respectively and via ioctl exactly this way; see
.IR tty (4).
.PP
The following two standard calls, however, apply to any open file:
.PP
.RS
.B ioctl(fildes, FIOCLEX, NULL);
.br
.B ioctl(fildes, FIONCLEX, NULL);
.RE
.LP
The first causes the file to be closed automatically during
a successful
.I exec
operation;
the second reverses the effect of the first.
.PP
The following call is peculiar to the Berkeley implementation, and
also applies to any open file:
.PP
.RS
.B ioctl(fildes, FIONREAD, &count)
.RE
.LP
returning, in the longword
.I count
the number of characters available for reading from
.I fildes.
.SH "SEE ALSO"
stty(1), tty(4), exec(2)
.SH DIAGNOSTICS
Zero is returned if the call was successful;
\-1 if the file descriptor does not refer to
the kind of file for which it was intended,
or if
.I request
attempts to modify the state of a terminal
when
.I fildes
is not writeable.
.PP
.I Ioctl
calls which attempt to modify the state of a process control terminal
while a process is not in the process group of the control terminal
will cause a SIGTTOU signal to be sent to the process' process group.
Such
.IR ioctl s
are allowed,
however,
if SIGTTOU is being held,
ignored,
if the process is an orphan which has been inherited by
.IR init ,
or is the child in an incomplete
.I vfork
(see
.IR jobs (3))
.SH BUGS
Strictly speaking,
because
.I ioctl
may be extended in different ways to devices with
different properties,
.I argp
should have an open-ended declaration like
.IP
.B union { struct sgttyb
.RB ... ;
\&...
.B } *argp;
.PP
The important thing is that the size is fixed by `struct sgttyb'.