Review request for 5049299 (original) (raw)
Michael McMahon Michael.McMahon at Sun.COM
Tue Jun 30 09:48:05 UTC 2009
- Previous message: Review request for 5049299
- Next message: Review request for 5049299
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Roland McGrath wrote:
But...posixspawn doesn't give you any way to delete all file descriptors and if you try to collect them before spawning, there is a race in a multithreaded program.
This is something you should never want to do. There is notoriously no good way to do it on some systems, where getdtablesize() can return RLIMINFINITY and is not proper to use in a loop. Use FDCLOEXEC when you open the descriptor in the first place. We also need to chdir() before calling exec. And while some descriptors already have FD_CLOEXEC set, it's not easy to guarantee this for all of them.
- Michael.
- Previous message: Review request for 5049299
- Next message: Review request for 5049299
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]