User: Password:
Subscribe / Log in / New account

nostd in userspace?

nostd in userspace?

Posted Aug 27, 2009 20:40 UTC (Thu) by quotemstr (subscriber, #45331)
In reply to: nostd in userspace? by kjp
Parent article: In brief

I actually agree with you. Well-written programs should close file descriptors before exec. Additionally, well-written libraries should mark their file descriptors close-on-exec. That way, at least one component will be well-written and the correct behavior will result.

(Log in to post comments)

nostd in userspace?

Posted Aug 28, 2009 3:54 UTC (Fri) by kjp (subscriber, #39639) [Link]

What about libraries that use fopen() anywhere? There is no way for them to set CLOEXEC race free..or even pass NOSTD for that matter. The people who thought these hacks up didn't think it through. If you use open(2) you should be able to realize you don't need these hacks.

nostd in userspace?

Posted Aug 28, 2009 4:05 UTC (Fri) by quotemstr (subscriber, #45331) [Link]

Your argument is spot-on. That's why I proposed, way back when, that O_CLOEXEC be a thread flag. I'm glad to see that people finally realize I was right.

nostd in userspace?

Posted Aug 28, 2009 4:53 UTC (Fri) by foom (subscriber, #14868) [Link]

If only linux would implement this:
....*that* would be a welcome addition.

Oh look, this was already discussed. :)

Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds