The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Warner Losh <imp@bsdimp.com>
To: Clem Cole <clemc@ccc.com>
Cc: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: [TUHS] Re: FD 2
Date: Sun, 22 Jan 2023 14:23:11 -0700	[thread overview]
Message-ID: <CANCZdfrnO-a7bUGRVHtGLdkGFYeaNCyTzwdR1tO+keKkmKf9cA@mail.gmail.com> (raw)
In-Reply-To: <CANCZdfp2SK+gHNgoybVd3asYfLkNiwt539zdNrgwPSKzK=j38Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1708 bytes --]

On Sat, Jan 21, 2023 at 11:37 AM Warner Losh <imp@bsdimp.com> wrote:

>
> Yea. Like many things, there was a transition... the most important bit is
> the shell. And that was more tricky to read through with the phone at
> breakfast...
>

OK. I've dug a bit further and Clem and I have chatted...  Here's the
summary.

We don't have V4's shell, alas, since all we have from that time period is
the C kernel a few months before the 4th edition release. V5 /bin/sh closes
fd2 and then dups fd1 to fd2. This creates fd2 as something special. V6
closes all FD's larger than 1 (2-15) and then does the dup(1) which it
makes sure returns 2 or it closes the file. While there were features in V6
to allow use of fd2/stderr, few programs used then.

And neither crypt nor passwd reads from fd2. crypt reads from fd0, while
passwd doesn't read. It just replaces the hashed password with the new
password. I've also looked at pr because

>I do remember that pr -p actually read from FD 2. It probably still does.

and that's not true in V7 at least... pr didn't have a 'p' arg :). Maybe
later programs started to do these things, but most of what went on with V7
was a transition to most error messages on stderr, which typically went to
stdout in V6.

So, people remembering it coming in with V7 are right, in the sense it was
the first release to do it consistently. And the people remembering V4 or
V5 are also right, in a different sense because the shell was ensuring fd2
was a copy of fd1 there, which a couple of programs (diff) used for errors.
And I believe that the impetus for the V7 changes was phototypesetting
'file not found' too often...  But that last bit is mostly because I want
to believe.

Warner

[-- Attachment #2: Type: text/html, Size: 2402 bytes --]

  parent reply	other threads:[~2023-01-22 21:25 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 22:44 [TUHS] " ron minnich
2023-01-20 22:54 ` [TUHS] " G. Branden Robinson
2023-01-20 22:56 ` Rob Pike
2023-01-20 23:11   ` Larry McVoy
2023-01-20 23:14     ` Rob Pike
2023-01-20 23:22       ` Larry McVoy
2023-01-20 23:13 ` Douglas McIlroy
2023-01-21  3:37 ` Jon Steinhart
2023-01-21 15:42 ` Clem Cole
2023-01-21 17:34   ` Warner Losh
2023-01-21 17:50     ` Warner Losh
2023-01-21 18:26       ` Clem Cole
2023-01-21 18:37         ` Warner Losh
2023-01-22 11:05           ` Jonathan Gray
2023-01-22 21:23           ` Warner Losh [this message]
2023-01-22 22:10             ` ron minnich
2023-01-23  7:30             ` arnold
2023-01-23  8:32               ` James Johnston
2023-01-23  8:58                 ` G. Branden Robinson
2023-01-23 11:49                   ` Brantley Coile
2023-01-23 14:25                     ` Ronald Natalie
2023-01-23 17:43                       ` Brantley Coile
2023-01-23 16:59                 ` Douglas McIlroy
2023-01-24  7:21                   ` arnold
2023-01-29 18:51             ` Warner Losh
2023-01-29 19:20               ` Ron Natalie
2023-01-29 20:25                 ` Warner Losh
2023-01-30  7:50                   ` arnold
2023-01-30  8:09                     ` Rob Pike
2023-01-30 15:02                       ` Larry McVoy
2023-01-30 15:16                         ` Dan Cross
2023-01-30 15:27                           ` Larry McVoy
2023-01-30 15:35                             ` Dan Cross
2023-01-30 15:45                               ` Larry McVoy
2023-01-30 16:09                                 ` Dan Cross
2023-01-30 16:18                                   ` Larry McVoy
2023-01-30 19:03                                     ` Dan Cross
2023-01-30 19:12                                       ` Brantley Coile
2023-01-30 21:24                                       ` Larry McVoy
2023-01-30 22:15                                         ` Rob Pike
2023-01-30 22:50                                           ` ron minnich
2023-01-30 23:05                                           ` [TUHS] Child of plan9? (Re: " Bakul Shah
2023-01-31  3:19                                             ` [TUHS] " Andrew Warkentin
2023-01-30 16:21                                   ` [TUHS] " Steve Nickolas
2023-01-30 16:27                                     ` Larry McVoy
2023-01-30 16:32                                       ` ron minnich
2023-01-30 16:40                                       ` Clem Cole
2023-01-30 19:55                                       ` Lawrence Stewart
2023-01-31 21:27                                     ` Dave Horsfall
2023-01-30 16:48                                   ` Theodore Ts'o
2023-01-30 16:57                                   ` Andy Kosela
2023-01-30 17:04                                     ` Warner Losh
2023-01-30 20:38                                       ` Theodore Ts'o
2023-01-30 21:01                                         ` Warner Losh
2023-01-30 21:10                                         ` Clem Cole
2023-01-30 16:03                           ` Bakul Shah
2023-01-30 16:07                             ` Larry McVoy
2023-01-30 16:13                               ` Bakul Shah
2023-01-30 16:22                                 ` Steve Nickolas
2023-01-30 16:17                               ` Dan Cross
2023-01-30 16:18                             ` Ralph Corderoy
2023-01-30 16:41                               ` [TUHS] job control (Re: " Bakul Shah
2023-01-30 19:07                               ` [TUHS] " Dan Cross
2023-01-30 13:26                     ` John Cowan
2023-01-30 14:30                       ` arnold
2023-01-30  0:25                 ` Phil Budne
2023-01-30  2:08                   ` Warner Losh
2023-01-21 18:27     ` Clem Cole
2023-01-22 10:56       ` Jaap Akkerhuis via TUHS

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANCZdfrnO-a7bUGRVHtGLdkGFYeaNCyTzwdR1tO+keKkmKf9cA@mail.gmail.com \
    --to=imp@bsdimp.com \
    --cc=clemc@ccc.com \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).