2 ms·
In the early days, stdin and stdout was a convention of the shell, not the operating system. Eg Programmers Workbench circa 1977: see execute() in https://m
by cjsplat 7y ago
In the early days, stdin and stdout was a convention of the shell, not the operating system. Eg Programmers Workbench circa 1977: see execute() in
https://minnie.tuhs.org/cgi-bin/utree.pl?file=PWB1/sys/source/s2/sh.c https://minnie.tuhs.org/cgi-bin/utree.pl?file=PWB1/sys/sourc...
In Version 7 (1979), it moved to the kernel - see setregs() in
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/sys/sys/sys1.c https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/sys/sys...
The V7 kernel model makes it generic - on exec, Unix will close() any file that has the close_on_exec flag set.
I believe that is the critical concept - stderr is supported by an OS level feature and inherits across various processes through pipes, forks and execs.
To tie back to the initial case in this thread, this is very useful for the Unix print system because it was/is a maze of squirrelly processes.
- paulsutter 7y agoRight and the big question is whether unix was first to have stderr, or if it was predated on other OS’s.