From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30923 invoked from network); 22 Jan 2023 22:11:40 -0000 Received: from minnie.tuhs.org (50.116.15.146) by inbox.vuxu.org with ESMTPUTF8; 22 Jan 2023 22:11:40 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id D189B4258E; Mon, 23 Jan 2023 08:11:34 +1000 (AEST) Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) by minnie.tuhs.org (Postfix) with ESMTPS id 479334258D for ; Mon, 23 Jan 2023 08:11:28 +1000 (AEST) Received: by mail-qk1-f172.google.com with SMTP id u7so5485708qkk.10 for ; Sun, 22 Jan 2023 14:11:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HRT9JwTZNQLcZJaDL913Pwp9gvD8sRTmKxIP3S5dmII=; b=mI1fAEu1WVU1RZ/UuHuIXnlSh6yf+zRTgmmoteyA6I6EN3qugtoBlfP+jHAfMw+lKF tyobzwiHQgwTmCHyTK9PhuR+i2jHH81R/PEboVMEBF6o+LlK6HbzksuA4F5wmqAaO2lQ 8BMRJ3oXGpw8nRCTJjajO+MutjtA+zqRW4oY9haqsMdnessp71krQtyuzPa5Xu0ZdEe0 0aXEpnHGI0cvBcSucVn1lUmyfrhymKTVOUyoRCjcdHDxfil6JqJ0ZSR7SLXNxAO3EV8i VqRO4ZNimADGBG2ugwrQEmaObVahvAK949K7HCauiQrECnYI2LnVxWGU1VfNvm1L0W9J Mi1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HRT9JwTZNQLcZJaDL913Pwp9gvD8sRTmKxIP3S5dmII=; b=vqltVAjU1Kj6+SmkTOS4g0LkeKQsQH23ukpFqDSLUeAJdCUzYxdxUQSovE2h+JvvTs iu4dJfm+bwHSgcdlTDr/Zpa36fWs05ecl8BVrZ8qepIeUQ2fKXSLO+eqyIg7WxdXIrNi Ptv7cGBEqbhyvqGPx+erQdkJL8LTNJsCODrYItHPSN/CvTO4gYsip3NAztbfPVAxm4av T0TNM1Q1TOkeluKC8VAO/U6ELleLarPw77S8iga7JBb8NVOeWhSIrNi9SvgK71Jhv1KY I+UBkSiyTwas1V+WB4X3Q6DCcKUGP05Z6BdGkZBejuSZr3c/3fc9V44hc9ZEQIX4FJhm 1qzA== X-Gm-Message-State: AFqh2kpEu2EjGXp/JVtOzUqWoGKpJ2hnfZGpT524tiCUSNTle+B6wJr6 xSP2XIPqS9VXv1Rq6hpVRjTSmC6/7LyEl4/J0Cj21E4w X-Google-Smtp-Source: AMrXdXstmp1pYzB/R/h3b8BLMLqc4ADjybNJ1owgBbj1/qsocfwIgDXmahi56rGGy8YE+d94cXAXKjAQ09ivOowuskQ= X-Received: by 2002:a05:620a:12ef:b0:706:3036:cb48 with SMTP id f15-20020a05620a12ef00b007063036cb48mr1268943qkl.185.1674425427299; Sun, 22 Jan 2023 14:10:27 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: ron minnich Date: Sun, 22 Jan 2023 17:10:15 -0500 Message-ID: To: Warner Losh Content-Type: multipart/alternative; boundary="000000000000cc124e05f2e18c7b" Message-ID-Hash: WZOSOIVWI3BFDCLODJWD6CGPOTDOSJSG X-Message-ID-Hash: WZOSOIVWI3BFDCLODJWD6CGPOTDOSJSG X-MailFrom: rminnich@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-tuhs.tuhs.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: The Eunuchs Hysterical Society X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: FD 2 List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --000000000000cc124e05f2e18c7b Content-Type: text/plain; charset="UTF-8" Thanks very much for this interesting archaeological dig. On Sun, Jan 22, 2023, 4:23 PM Warner Losh wrote: > > > On Sat, Jan 21, 2023 at 11:37 AM Warner Losh 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 > --000000000000cc124e05f2e18c7b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks very much for this interesting archaeological dig.=

= On Sun, Jan 22, 2023, 4:23 PM Warner Losh <imp@bsdimp.com> wrote:
=


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

Yea. Like man= y things, there was a transition... the most important bit is the shell. An= d that was more tricky to read through with the phone at breakfast...
=

OK. I've dug a bit further and C= lem and I have chatted...=C2=A0 Here's the summary.

We don't have V4's shell, alas, since all we have from that t= ime 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 fe= atures in V6 to allow use of fd2/stderr, few programs used then.
=
And neither crypt nor passwd reads from fd2. crypt reads fro= m 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 s= till does.

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

So, people remembering it coming in with V7 are right,=C2=A0in the sense i= t was the first release to=C2=A0do it consistently. And the people remember= ing V4 or V5 are also right, in a different sense because the shell was ens= uring fd2 was a copy of fd1 there, which a couple of programs (diff) used f= or errors. And I believe that the impetus for the V7 changes was phototypes= etting 'file not found' too often...=C2=A0 But that last bit is mos= tly because I want to believe.

Warner
--000000000000cc124e05f2e18c7b--