fcntl() versus ioctl()

Dr. T. Andrews tanner at ki4pv.uucp
Wed Sep 14 11:18:39 AEST 1988


In article <1380 at solo7.cs.vu.nl>, maart at cs.vu.nl (Maarten Litmaath) writes:
) Isn't it a dubious feature that the PARENT should suffer if a CHILD
) decides) to set the FNDELAY flag of stdin? It's an FCNTL() we're
) talking about, not an IOCTL()!

Well, this is a good question.  Let's examine it.  First of all, note
that fcntl(2) operates on file descriptors (just like ioctl(2) does).
In many environments, it even offers several of the same sorts of
controls.  I don't see any moral difference between fcntl(2) and
ioctl(2), myself.  Thus, if ioctl() might cause a parent to suffer,
fcntl() may be expected to have a similar hazard.

Now, consider the effect proposed by maart at cs.vu.nl above: that the
parent's fd should not be affected by a child's action.  Mainly, the
"stty" command (remember: commands are run as children of shells) no
longer works.  It is no longer practical to change your tty modes.

You're stuck with whatever "getty" decided was best for you.
Alternatively, everything which might be used as a shell needs
to learn about the "stty" command, or else to set tty modes to
your satisfaction via the RPM instruction.
-- 
...!bikini.cis.ufl.edu!ki4pv!tanner  ...!bpa!cdin-1!cdis-1!ki4pv!tanner
or...  {allegra killer gatech!uflorida decvax!ucf-cs}!ki4pv!tanner



More information about the Comp.unix.questions mailing list