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_INVALID,DKIM_SIGNED, HTML_FONT_LOW_CONTRAST,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2262 invoked from network); 21 Jan 2023 18:39:23 -0000 Received: from minnie.tuhs.org (50.116.15.146) by inbox.vuxu.org with ESMTPUTF8; 21 Jan 2023 18:39:23 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 8A6FB42573; Sun, 22 Jan 2023 04:39:00 +1000 (AEST) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by minnie.tuhs.org (Postfix) with ESMTPS id 86F6842572 for ; Sun, 22 Jan 2023 04:38:55 +1000 (AEST) Received: by mail-ed1-f41.google.com with SMTP id b4so10335269edf.0 for ; Sat, 21 Jan 2023 10:38:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.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=ceaCbmyIjFR84r8M+znyLpJOqbljMFSRq3xJqb7dSKM=; b=PxMnac6fzB3zomIBfb5qCdOTlsALMeu1gqLVQ+W1wUhq1lmgQLB2br5wW/eKh41baW 18eN2gTMbTnByaZNyKe3MOWE/BHNDt4UnPrKHsLZvRY76Uh7YqKECgmNg7NNbao97X14 RnM2VwOgvaUXVsINy2NNBzDneNu9MWUzDH0X/Xk2xmqi+MYeNrETJt4UGf0OjF//vaiK 9i9C5R/L4AzbqvlQ+vGiUrwkJTlQbXivt7XjhZCeV82/HYMNmdqEzEIYXaDcFJ3020th NaP/4Nj2WKwO6wlZfw0XuS0RUO/8hN+ht/capEjtEubhHPUEKAyTZZawDjK2MNMgTNxs o/Iw== 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=ceaCbmyIjFR84r8M+znyLpJOqbljMFSRq3xJqb7dSKM=; b=bzg/e7DS5D7VontA0wUUpTZklUBXIiXVZa8x3kGLIQeyNUzxRe/wdDLKQdlimu/2zd +01T9V5iLCLHgaRZlohDStRFYNUgxn7aPNh+hkXxldHHHUxOmqrM+0LCNZuZkAcrO8tZ YwDypx+yBi0LkbRDiSC2tl3TceneVccUAATRtdoxnG2zwcQgrgFsD6aWWTVHauH7dBLE 9qo2DQkcK6PLaF5VhZ5Frw4sQ+hO8Rs+3BFUp3wY1Xm3VO0Y/1pqfA9NB18huVColoR5 OHG0KaAd/Ld9oy1cY8D/NsJwx/xmnqy+Qq2zBUmEWARLHCQMxBUDjiDSj57Swt7Tlp8y zTmA== X-Gm-Message-State: AFqh2krxPu8CdaFVAh7zc3qTQow/FQEVlXtsMAneb6uzb89U0ViZIpBB zeVhuRN/NpjvDZ8n1pyg93dZih1/S0vdI7CZ2jLsTxJmGVLYHg== X-Google-Smtp-Source: AMrXdXt4aD5iEjOhgYrRXdNLXCJhnjdSLX8GL6qiSWghT0HumW1G9GA44JOgaLD5zPKydjUEnse9vkQxqzvRUZS12/s= X-Received: by 2002:aa7:c30d:0:b0:46c:af80:636c with SMTP id l13-20020aa7c30d000000b0046caf80636cmr2243351edq.129.1674326273955; Sat, 21 Jan 2023 10:37:53 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Sat, 21 Jan 2023 11:37:42 -0700 Message-ID: To: Clem Cole Content-Type: multipart/alternative; boundary="000000000000cc35cb05f2ca76f3" Message-ID-Hash: NLOXUCPBESDKFGYGEW2W3GKQCMZPXJHD X-Message-ID-Hash: NLOXUCPBESDKFGYGEW2W3GKQCMZPXJHD X-MailFrom: wlosh@bsdimp.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: --000000000000cc35cb05f2ca76f3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jan 21, 2023, 11:26 AM Clem Cole wrote: > > > On Sat, Jan 21, 2023 at 12:50 PM Warner Losh wrote: > > >> >> Further digging shows v6 is quite similar. >> > As I said, by then they know it's an issue and the fd 2 has been > introduced. The place to look is not the utilities, but the shell itsel= f > and what the kernel is doing in newproc et al for the tty handler. > The utilities were all using printf so even if the concept was there, it wasn't widely used. I'll take a longer look, including these places.. though I'm not sure I see the connection to the tty driver... V7 revamps everything, with printf changed to a routine that writes to >> stderr. Each program did this differently. >> > IMO: Sort of two different things >>I think<<. They are related - the ide= a > ( what the OS supplied to each process), as opposed to what/how each > utility handled it. > Yea. Mostly i think each program had a different wrapper around stderr to minimize changes to the program... With typesetter C -- we get dmr's new stdio library (libS.a) replacing > Lesk's portable C library. This was released independent of V6 as what D= EC > would have called a 'layered product" that ran on top of V6. As I sai= d, > this is the language that Dennis and Brian describe in K&R (version 1). > Do we have extant copies of that? So far I have see the kernel patches that were "leaked" but not the rest of it. With what was becoming UNIX/TS -- which don't seem to have a formal release > -- we get what we all think of as the V7 kernel, Bourne's new shell and t= he > new and updated tools suite as part of the system > Yea. So with V7, as you point out, most, but not all of the utilities have been > updated to start using the new compiler (since by then Lesk library is no= t > included), If the code were recompiled, that code would have had to used > the new FILE * structure over the small integer fd, for the printf family= . > With V6 there were still a handful of utilities in assembler (like snoba= ll > IIRC), but by V7 I think most of them had been culled. > > And while your point is that you need to look at what each utility > implemented, >>I believe<< that the key to Ron's question is what the she= ll > and the kernel supplied [dates the idea], and >>then<< if the utility > obeyed the new fd 2 as the error file is when it starts to be more formal= ly > enforced. So any further hunting should start there I would think. > 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... Warner Clem > > > >> >> Granted, this is a small sample size. There wasn't a huge uptake of >> stderr/fd2 in v6 it seems, but v7 looks like it had a pass over the code= to >> at least try for all errors going to fd2. >> >> Warner >> >> >>> Warner >>> >>> On Fri, Jan 20, 2023 at 5:46 PM ron minnich wrote: >>>> >>>>> I am trying to remember when fd 2 (aka stderr) became a thing. I have >>>>> a vague memory that it was post-v6 but that may be way off. >>>>> >>>>> >>>>> =E1=90=A7 > --000000000000cc35cb05f2ca76f3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, Jan 21, 2023, 11:26 AM Clem Cole <= clemc@ccc.com> wrote:

<= /div>
O= n Sat, Jan 21, 2023 at 12:50 PM Warner Losh <imp@bsdimp.com> wrote:
=C2=A0
=

= Further digging shows v6 is quite similar.
As I said, by then they know it's=C2=A0an issue and the fd 2 has been = introduced.=C2=A0 =C2=A0The place to look is not the utilities, but the she= ll itself and what the kernel is doing in newproc et al for the tty handler= .

The utilities were all using printf so even if the concept w= as there, it wasn't widely=C2=A0used.

=
I'll take a longer look, including these places..=C2= =A0 though I'm not sure I see the connection to the tty driver...
=

V7 revamps everything, with printf changed to a routine that writes to = stderr. Each program did this differently.
IMO: Sort of two different=C2=A0things >>I think<<. They are r= elated - the idea ( what the OS supplied to each process), as opposed to wh= at/how each utility handled it.
=

Yea. Mostly i think each prog= ram had a different wrapper around stderr to minimize changes to the progra= m...

With typesetter C -- we get dmr's new stdio library (libS.a)= replacing Lesk's portable C library.=C2=A0 This was released independe= nt of V6 as what=C2=A0DEC would have called a 'layered=C2=A0product&quo= t;=C2=A0 that ran on top of V6.=C2=A0 =C2=A0 As I said, this is the languag= e that Dennis and Brian describe in K&R (version 1).=C2=A0
<= /div>

Do we have extant copies of that? So far I have see the kernel patches tha= t were "leaked" but not the rest of it.
With what was becom= ing UNIX/TS -- which don't seem to have a formal release -- we get what= we all think of as the V7 kernel, Bourne's new shell and the new and u= pdated tools suite as part of the system

Yea.

So with= V7, as you point out, most, but not all of the utilities have been updated= to start using the new compiler (since by then Lesk library is not include= d), If the code were recompiled, that code=C2=A0would have had to used the = new FILE * structure over the small integer fd, for the printf family.=C2= =A0 =C2=A0With V6 there were still a handful of utilities in assembler (lik= e snoball IIRC), but by V7 I think most of them had been culled.
And while your point is that you need to look at what each utili= ty implemented, >>I believe<< that the key to Ron's questio= n is what the shell and the kernel supplied [dates the idea], and >>t= hen<< if the utility obeyed the new fd 2 as the error file is when it= starts to be more formally enforced. So any further hunting should start t= here I would think.

Yea. Like many things, there was a transit= ion... the most important bit is the shell. And that was more tricky to rea= d through with the phone at breakfast...

<= div dir=3D"auto">Warner=C2=A0


Clem
=C2=A0

Granted, this is a small sample size. There wasn't a huge uptake o= f stderr/fd2 in v6 it seems, but v7 looks like it had a pass over the code = to at least try for all errors going to fd2.

Warner


Warne= r

On Fri, Jan 20, 2023 at 5:46 P= M ron minnich <rminnich@gmail.com> wrote:
= I am trying to remember when fd 2 (aka stderr) became a thing. I have a vag= ue memory=C2=A0that it was post-v6 but that may be way off.=C2=A0

<= /div>

3D""=E1=90=A7
--000000000000cc35cb05f2ca76f3--