Author ferringb
Recipients ferringb, gregory.p.smith, jyasskin, loewis, nadeem.vawda, neologix, pitrou, rosslagerwall, s7v7nislands, vstinner
Date 2012-01-15.12:02:29
SpamBayes Score 0.000107555
Marked as misclassified No
Message-id <1326628950.32.0.331676886965.issue8052@psf.upfronthosting.co.za>
In-reply-to
Content
>The only question is: do other Unix also have /proc/<pid>/fd? e.g.
>FreeBSD, OpenBSD. That's especially important because FreeBSD can have
>a huge RLIMIT_NOFILE by default.

Unless the OS gives some way to optimize the process (whether inferring from procfs, or making use of spawn_closefrom), there really isn't anything we can do.  O_CLOEXEC is one option, but that's basically the same as the close loop in terms of syscalls- specifically post fork looping over the range and setting it.  Beyond that, it's linux specific, so only would be used if the root python was invoked from lacked procfs.

I'm willing to extend my original patch to handle alternate OS hints as needed; in the same way, the nlinks trick I can implement although I'd be more inclined to just limit my original closerange patch to OSs that have a sane opendir and procfs.
History
Date User Action Args
2012-01-15 12:02:30ferringbsetrecipients: + ferringb, loewis, gregory.p.smith, pitrou, vstinner, jyasskin, nadeem.vawda, s7v7nislands, neologix, rosslagerwall
2012-01-15 12:02:30ferringbsetmessageid: <1326628950.32.0.331676886965.issue8052@psf.upfronthosting.co.za>
2012-01-15 12:02:29ferringblinkissue8052 messages
2012-01-15 12:02:29ferringbcreate