Why did 16-bit _lopen and _lcreat functions return -1 on failure instead of 0?
devblogs.microsoft.com
devblogs.microsoft.com
(/dev/stdin, /dev/stdout, /dev/stderr exist today, but did not then, and even today I don't think you can open/create them since they are symlinks to /proc/self/fd/0..2 and thus open("/dev/stdin", ...) returns -1)
AFAIK if you close(0) you lose your stdin and never see it again.
This is the way redirection was done in early UNIX versions, at least I think until System 7, where dup2() was introduced to address the race condition lurking here.