Comment

Comment by NikkiA

That, surprisingly for raymond, doesn't actually answer the question, since you cannot request opening stdin/stdout/stderr via this API, the values 0..2 are also invalid return values.

(/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.

parent NikkiA 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton