LWN.net Logo

File descriptor handling changes in 2.6.27

File descriptor handling changes in 2.6.27

Posted Aug 15, 2008 17:27 UTC (Fri) by sethml (subscriber, #8471)
In reply to: File descriptor handling changes in 2.6.27 by njs
Parent article: File descriptor handling changes in 2.6.27

How about a call similar to closefrom(), but which takes a list of fds not to close, and
closes 
all fds but those in the list?  This avoids the brain-dead assumptions about fd ordering which

closefrom() makes, but makes it easy to leave just a select few fds open for the child.  As
the 
parent comment points out, any code which relies on leaving fds other than stdout/stdin/
stderr open for the child probably knows exactly which fds the child will need.


(Log in to post comments)

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