Hacker News new | past | comments | ask | show | jobs | submit login

I’m not saying it’s not possible to do correctly. But do you not agree that the first is hard to correctly (can overlook an fd) while the latter is a lot of complexity?

There is the CLOEXEC flag which is the intended way to manage this but it’s not the default and you have to be diligent about setting it which again carries its own set of challenges.

What you’d really want is CLOEXEC implicitly on all fds and having to explicitly opt in for fd inheritance.




Rust stdlib opens all fds with CLOEXEC set. You have to explicitly disable it when you want the child to inhert the fd.


That would be ideal, but we'd need a new syscall for that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: