[TUHS] FD 2

Clem Cole clemc at ccc.com
Sun Jan 22 04:26:26 AEST 2023


On Sat, Jan 21, 2023 at 12:50 PM Warner Losh <imp at bsdimp.com> 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 itself
and what the kernel is doing in newproc et al for the tty handler.



> 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 idea
( what the OS supplied to each process), as opposed to what/how each
utility handled it.

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 DEC
would have called a 'layered product"  that ran on top of V6.    As I said,
this is the language that Dennis and Brian describe in K&R (version 1).

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 the
new and updated tools suite as part of the system.


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
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 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 utility
implemented, >>I believe<< that the key to Ron's question is what the shell
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 formally
enforced. So any further hunting should start there I would think.


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 <rminnich at 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.
>>>>
>>>>
>>>>-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20230121/a49085e1/attachment.htm>


More information about the TUHS mailing list