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 29356 invoked from network); 21 Jan 2023 17:52:16 -0000 Received: from minnie.tuhs.org (50.116.15.146) by inbox.vuxu.org with ESMTPUTF8; 21 Jan 2023 17:52:16 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 4E6CA42565; Sun, 22 Jan 2023 03:51:40 +1000 (AEST) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by minnie.tuhs.org (Postfix) with ESMTPS id C829742564 for ; Sun, 22 Jan 2023 03:51:29 +1000 (AEST) Received: by mail-ej1-f52.google.com with SMTP id kt14so21361551ejc.3 for ; Sat, 21 Jan 2023 09:51:29 -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=QPsHNKQ4PD49qbQ2aXKeulm1bz58Nq6WhDcXkagzRCg=; b=ZRsq/1M+yX9U2eLd8N8myHJ88itfgKducEVuNtECfSX/mIJonYmJY8sqo25oQGjbCE OpHiads+rNz6IbAxvOGOdIV/flLt+Sdj4EkbJHwGSXywhWUVCFKSRoyafO4ge8ibckJB ffA/oZHtSA/jwS/jVkniON5T4IgZAEWl7T0YuXLWcLA3sB+4sFurDg/WHA7eOegrOK2k 5WYT/tG/IaNGy0WCqFSPFzp/pLYGCxmZYdfnGunFDkyv491jWxbrg00Ww48Xork4vDFV yMDK2RBmrS4dYQR1YQPUh4INLqvLydt3oA2MNYAbzQBrYjGtOZmwkLWHCNPWquVX9e4m wxPQ== 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=QPsHNKQ4PD49qbQ2aXKeulm1bz58Nq6WhDcXkagzRCg=; b=lWWsKdcx8CzsINB/8waDjjNRsfXBPTGDISCBuk5NzFZpGerMqLRfxHfiWR7pnNMHsO qsv2vOBuzxBMxmaRGW7ZcuCHqEh7C7zmzMmiXJ4qVzGNRscnJLMCpmKQEJIJj13ziGB7 HPa2y4J+dmS3Zq1bIX9lXjLyHMrcB5Ku+9zJcZF3jnkrrWOYGavqtDbtSQm6j+gAT5NW QndC/DrQ78Aywowya0N1fxwqBO1GRowekYsCn/pX5OutesLcqIzj37mkr45OBgcCVl1r BJs2vKKks/fiVKy2etAvkfqYWJkKolab7frQ+MVIIIYe0Nedv+TWkzqRg2FGcC4amZND aIlw== X-Gm-Message-State: AFqh2kpdejLikJF/bU+2SPZlE8r15BYqC9bibj6wN3hx4Esncf6UecNQ Y0jYhBQhZ0KKRza410tsiBM8kjaJINHe6eyUa3Cnbg== X-Google-Smtp-Source: AMrXdXsQ0iY/Oq/6EpS5p3LhRJof3WcD5O/35xaT4Iun4f90oSr21J0QirANERn51bqxKVKDP5aoU2MU+pm6XzNtzKg= X-Received: by 2002:a17:906:4d13:b0:7c0:c4e6:eff6 with SMTP id r19-20020a1709064d1300b007c0c4e6eff6mr2421414eju.465.1674323428297; Sat, 21 Jan 2023 09:50:28 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Sat, 21 Jan 2023 10:50:17 -0700 Message-ID: To: Clem Cole Content-Type: multipart/alternative; boundary="0000000000002ee06005f2c9cdce" Message-ID-Hash: H7WLCHSDTAW2SYIXKG6O4TRCRQZWS6QZ X-Message-ID-Hash: H7WLCHSDTAW2SYIXKG6O4TRCRQZWS6QZ 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: --0000000000002ee06005f2c9cdce Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jan 21, 2023, 10:34 AM Warner Losh wrote: > > > On Sat, Jan 21, 2023, 8:45 AM Clem Cole wrote: > >> Certainly fd 2 as a error output appears with Lesk's portable C library, >> which was included in V6 - see the last para on page 1 of his document: >> >> "Initially you are given three file descriptors by the system: 0, 1, and >> 2. File 0 is the standard input; it is normally the teletype in >> time-sharing or input data cards in batch. File 1 is the standard output= ; >> it is nor- mally the teletype in time-sharing or the line printer in bat= ch. >> File 2 is the error file; it is an output file, nor- mally the same as f= ile >> 1, except that when file 1 is diverted via a command line =E2=80=99>=E2= =80=99 operator, >> file 2 remains attached to the original destination, usually the termina= l. >> It is used for error message output. These popular UNIX conventions are >> considered part of the C library specification. By closing 0 or 1, the >> default input or output may be re-directed; this can also be done on the >> command line by >file for output or > >> This document pre-dates ditroff. The idea/names of stdin/out/err (as >> opposed to fd 0, 1, 2) does not come about until Dennis does "typesetter= C" >> which is described in K&R. >> >> That said, my memory is fd 2 as ana error path was there in Fourth or >> Fifth Edition, before Lesk did this library -- i.e. it was a convention >> that Dennis/Ken et al were all using -- when it is realized that printin= g >> errors on in the same output flow as the standard (normal) output was >> problematic in a pipe stream. >> =E1=90=A7 >> > > It looks to be a mixed bag in 5th edition. Cc, ac, comm and find all > printf the errors. Diff uses writes to fd 2. I didn't catalog further, bu= t > this kinda looks like a developing convention, not yet fully realized. . > Further digging shows v6 is quite similar. V7 revamps everything, with printf changed to a routine that writes to stderr. Each program did this differently. 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. >>> >>> >>> --0000000000002ee06005f2c9cdce Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, Jan 21, 2023, 10:34 AM Warner Losh <imp@bsdimp.com> wrote:


On Sat, Jan 21, 2023, 8:45 AM Cl= em Cole <clemc@ccc.com> wrote:
Certainly fd 2 as a error output appears=C2=A0with Les= k's=C2=A0portable C library, which was included in V6 - see the last pa= ra on page 1 of his document:

"Initially you are given three file descriptors by the system: 0= , 1, and 2. File 0 is the standard input; it is normally the teletype in time-sharing or input data cards in batch. File= 1 is the standard output; it is nor- mally the teletype in time-sharing or the line printer in batch. File 2 is = the error file; it is an output file, nor- mally the same as file 1, except that when file 1 is diverted via a command= line =E2=80=99>=E2=80=99 operator, file 2 remains attached to the original destination, usually the terminal. It is used for = error message output. These popular UNIX conventions are considered part of the C library specification. By clo= sing 0 or 1, the default input or output may be re-directed; this can also be done on the command line by >file for output or <file for inpu= t."

This document pre-dates ditro= ff.=C2=A0 =C2=A0The idea/names of stdin/out/err (as opposed to fd 0, 1, 2) = does not come about until Dennis does "typesetter C" which is des= cribed in K&R.
<= br>
That said, my me= mory is fd 2 as ana error path was there in Fourth or Fifth Edition, before= Lesk did this library -- i.e. it was a convention that Dennis/Ken et al we= re all using -- when it is realized that printing errors on in the same out= put flow as the standard (normal) output was problematic in a pipe stream.= =C2=A0 =C2=A0
=09 =09
3D==E1=90=A7

It looks to be a mixed bag in 5th edition. Cc,= ac, comm and find all printf the errors. Diff uses writes to fd 2. I didn&= #39;t catalog further, but this kinda looks like a developing convention, n= ot yet fully realized. .

Further digging shows v6 is quite similar. = V7 revamps everything, with printf changed to a routine that writes to stde= rr. Each program did this differently.

Granted, this is a small sample size. There wasn't a hug= e 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 <rminnich@gmail.com> wrote:
I am trying to remember when fd 2 (aka = stderr) became a thing. I have a vague memory=C2=A0that it was post-v6 but = that may be way off.=C2=A0


--0000000000002ee06005f2c9cdce--