logoalt Hacker News

mjmastoday at 11:22 AM1 replyview on HN

POSIX compatibility

> https://pubs.opengroup.org/onlinepubs/000095399/functions/op...

> The open() function shall return a file descriptor for the named file that is the lowest file descriptor not currently open for that process.


Replies

dupedtoday at 1:53 PM

Firstly, standards compliance is bad when the standard is bad.

Secondly nothing precludes defining '3' as the lowest file descriptor for open(), since stdin/stdout/stderr cannot be opened (they are opened before the process starts).

nb4 open("/dev/stdin"), that's not what I mean