🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.unix
Article #635

Re: /dev/tty implemented as /dev/fd/3

#635
From: Arnold Robbins
Date: Wed, 31 Oct 1990 17:22
40 lines
2767 bytes
Submitted-by: arnold%audiofax.com@mathcs.emory.edu (Arnold Robbins)

In article <14162@cs.utexas.edu> ske@pkmab.se (Kristoffer Eriksson) writes:
>If you have a program that closes only fd 3, this implementation will behave
>differently from the old /dev/tty device implementation, won't it? You will
>not be able to reach the controlling terminal by a guaranteed route, in spite
>of the fact that it is still available on other fd-s.

This is correct.  It's mostly irrelevant though; in current Unix systems if
you do the right magic you can't get use /dev/tty even though the terminal is
still available on the currently open file descriptors.  Six of one, a
half-dozen of the other, as they say.

>Or is the controlling
>terminal concept implemented in such a way that closing fd 3 is the same as
>disassociating from the controlling terminal (so you won't be bother with
>terminal interrupts and such) ?

I don't think this is the case.  V10 still has the concept of a "controlling
terminal", but I strongly doubt that the kernel knows it's on fd 3.  However,
the controlling terminal isn't as pervasive a concept in Research Unix as it
is in BSD or System V.  (In BSD, if you disassociate yourself from the
controlling terminal, and then open some random /dev/tty<whatever>, it
automatically becomes your controlling terminal.  In V10 you'd have to
explicitly make that happen.)

Let me make a clarifying statement.  There are two things under discussion.
1) the usefulness of /dev/fd, 2) the usefulness of having /dev/tty be
/dev/fd/3.   Everyone who's actually used /dev/fd feels it's useful, so
we can take point 1) as a given for a nice feature.  Point 2) has its
plusses and minuses, but, IMO, the minuses don't outweigh the plusses.
Also, if it's good enough for Dennis Ritchie, it's probably good enough
for me. :-)
-- 
Arnold Robbins				AudioFAX, Inc. | Laundry increases
2000 Powers Ferry Road, #200 / Marietta, GA. 30067     | exponentially in the
INTERNET: arnold@audiofax.com Phone:   +1 404 933 7612 | number of children.
UUCP:	  emory!audfax!arnold Fax-box: +1 404 618 4581 |   -- Miriam Robbins

Volume-Number: Volume 22, Number 18
Technical Details
Message-ID: <14208@cs.utexas.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!jsq
References: <14014@cs.utexas.edu> <13878@cs.utexas.edu> <14103@cs.utexas.edu> <14162@cs.utexas.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!jsq
From: arnold%audiofax.com@mathcs.emory.edu (Arnold Robbins)
Newsgroups: comp.std.unix
Subject: Re: /dev/tty implemented as /dev/fd/3
Message-ID: <14208@cs.utexas.edu>
Date: 31 Oct 90 17:22:38 GMT
References: <14014@cs.utexas.edu> <13878@cs.utexas.edu> <14103@cs.utexas.edu> <14162@cs.utexas.edu>
Sender: jsq@cs.utexas.edu
Reply-To: arnold@audiofax.com
Organization: AudioFAX Inc., Atlanta
Lines: 40
Approved: jsq@cs.utexas.edu (Moderator, John S. Quarterman)
X-Submissions: std-unix@uunet.uu.net