Hacker News new | past | comments | ask | show | jobs | submit login

Be nice if they said the year of this invention, but it seems to have been in the 70s. I tried finding earlier references, two candidates:

- IBM JCL has DD statements for SYSERR, SYSIN, and SYSOUT, but I can't find the date that SYSERR was introduced.

- Any old Fortran IV programmers know that I/O unit 0 is STDERR, unit 5 is STDIN, and unit 6 is STDOUT. And Fortran IV is from 1966 (aka "Fortran 66").

However, I found a 1970 manual for Fortran IV, and at that time, unit 0 was illegal (see table 123-3 on page 13-4), so unit 0 must have been added later, adding token support for the claim made in this article.

http://www.bitsavers.org/www.computer.museum.uq.edu.au/pdf/D...




Please note that Dec-10 Fortran (like all Digital Fortrans) had a huge number of extensions. When I worked at Middlesex Polytechnic (later Middlesex University), we replaced our Dec-10 with two IBM 4381 super-minis, and none of the Digital Fortran code that used them could easily be ported (my own programs were portable, because I adhered fairly rigidly to the Fortran-77 standard).

I don't remember the Fortran 77 standard specifying STDERR, STOUT or STDIN in the sense the the C and C++ Standards do (in lower case) - but I might be a bit forgetful; this was over 30 years 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/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...

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.


Right and the big question is whether unix was first to have stderr, or if it was predated on other OS’s.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: