ioctls (fd -vs- device)

Richard A. O'Keefe ok at quintus.UUCP
Thu Dec 28 20:24:53 AEST 1989


When you perform an ioctl, there are at least two "objects" which may be
affected.  In effect, a file descriptor is a handle for a "working" object
which keeps track of things like file position, access rights requested and
granted, locks, and so on.  This "working" object may itself refer in some
way to an "external" object such as a disc, serial port, tape drive, and so
on.

Some ioctls obviously refer to the working object, e.g. FIOCLEX, I_PUSH.
Some obviously refer to the external object, e.g. MTIOCTOP.

There are quite a few where I don't find it obvious, especially in the
terminal interfaces (BSD, SysV, POSIX).  What I'd _like_ to understand
is what happens when someone has several descriptors for connections to
the same (physical or pseudo) terminal.  Which properties of an fd
connected to a terminal can I trust not to be changed behind my back
through another fd?



More information about the Comp.unix.questions mailing list