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: Sat, 21 Jan 2023 10:50:17 -0700 [thread overview]
Message-ID: <CANCZdfr4zkmFKgqBZKrOL9z5FbFsWSjHpU3vYu-2T3Y+xNat2g@mail.gmail.com> (raw)
In-Reply-To: <CANCZdfpjrJUDPv2g7-10SrdkgjiacAvp95PVvJ=Ob2h8m8R=FQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2518 bytes --]
On Sat, Jan 21, 2023, 10:34 AM Warner Losh <imp@bsdimp.com> wrote:
>
>
> On Sat, Jan 21, 2023, 8:45 AM Clem Cole <clemc@ccc.com> 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 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 ’>’ 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 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 <file for input."
>>
>> 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 printing
>> errors on in the same output flow as the standard (normal) output was
>> problematic in a pipe stream.
>> ᐧ
>>
>
> 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, but
> 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 <rminnich@gmail.com> 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.
>>>
>>>
>>>
[-- Attachment #2: Type: text/html, Size: 5323 bytes --]
next prev parent reply other threads:[~2023-01-21 17:52 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 [this message]
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
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=CANCZdfr4zkmFKgqBZKrOL9z5FbFsWSjHpU3vYu-2T3Y+xNat2g@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).