TIL: glibc writes internal error messages directly to /dev/tty (!) and when it can't it sometimes writes to STDERR_FILENO (probably, but not always, stderr). See https://github.com/lattera/glibc/blob/a2f34833b1042d5d8eeb263b4cf4caaea138c4ad/sysdeps/posix/libc_fatal.c#L62-L69 …. Takeaway #1: Never `close(STDERR_FILENO);` Instead reopen /dev/null using STDERR_FILENO.
-
-
Takeaway #4: If you're developing an operating system with POSIX-y stdin/stdout/stderr stuff, don't ever implicitly reuse STD*_FILENO file descriptors after those file descriptors have been closed.
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Is there no alternative to open("/dev/null") that doesn't involve the filesystem and can easily be whitelisted in eg. seccomp? Like a null() syscall
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.