[fpc-devel] Re: inheriting handles using TProcess in unix

Seth Grover sethdgrover at gmail.com
Thu Jan 27 14:22:20 CET 2011


>> I'm contemplating patching TProcess so that if FInheritHandles
>> is false (default is true) it would do this.
>>
>> Thoughts?
>
> By all means, go ahead. I didn't know there was a way to enumerate all file
> descriptors.
>
> Michael.
>

My current thought is to use FindFirst/FindNext in the context of the
child process after the fork but before the exec to enumerate the
contents of /proc/[pid]/fd/ and close all the descriptors greater than
2. I don't have experience in all different flavors of UNIX, but from
what I've read procfs is standard in UNIX.

-SG

--
This email is fiction. Any resemblance to actual events
or persons living or dead is purely coincidental.

Seth Grover
sethdgrover[at]gmail[dot]com



More information about the fpc-devel mailing list