3 ms·
FDs really should have been opt-in for inheritability from the start, with the possible exception of stdio. Inheritability being an fcntl is definitely one of t
by mmastrac 2y ago
FDs really should have been opt-in for inheritability from the start, with the possible exception of stdio. Inheritability being an fcntl is definitely one of the worst bits -- if the APIs for fork()/etc were designed today it would probably take a list of FDs that would be dup2'd in the new child process.
- stefan_ 2y agoFDs optin, memory too given the insane performance pitfalls architectural issues and pernicious security problems (think cloning a CSPRNGs internal state) and suddenly you realize CreateProcessA was and always has been the superior API.
- adzm 2y ago> suddenly you realize CreateProcessA was and always has been the superior API Throw in IOCP and you realize that NT is a pretty solid, well-thought-out OS
- hyperman1 2y agoSpeaking as a linux addict from the 90s: The NT kernel was great. The windows GDI and USER were reasonable but a bit warty, and not fully up to date for current graphics works. COM as interoperability protocol was quite good. The windows UI from 95 to win2k was also great. Really apart from the lack of unix shell like automation and some serious security holes, this was a good system. Unfortunately, starting with XP, the end user was not Microsoft's center of attention anymore, and the OS gets worse every new version since.
- loeg 2y ago> FDs really should have been opt-in for inheritability from the start, with the possible exception of stdio. Yes. > Inheritability being an fcntl is definitely one of the worst bits Well, or you can use O_CLOEXEC in most APIs that create an fd.
- mmastrac 2y agoYep, totally, although there are still some holes in that. pipe2 being missing on Darwin is one example. You also need to hope that all the libraries you're integrating with are using O_CLOEXEC as well.
- glandium 2y agoEven posix_spawn didn't fix this problem. https://pubs.opengroup.org/onlinepubs/007904975/functions/posix_spawn.html https://pubs.opengroup.org/onlinepubs/007904975/functions/po...