Re: C function - other process - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: C function - other process
Date
Msg-id 20050422203629.GA94052@winnie.fuhr.org
Whole thread Raw
In response to Re: C function - other process  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
On Fri, Apr 22, 2005 at 04:07:48PM -0400, Tom Lane wrote:
> 
> Execing some new program is safe enough, although you might wish to
> explicitly close the various sockets the backend holds to make sure
> the new program doesn't maliciously scribble on them.

Is there a way to find out which fds to close, or should a function
just close everything from, say, 3 to <some value> (assuming that
0, 1, and 2 are stdin, stdout, and stderr)?  I could think of
non-portable ways like looking under /proc/<pid>/fd, but I was
wondering if the backend keeps track of its fds somewhere.

Thanks.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: C function - other process
Next
From: "Letnes, David G."
Date:
Subject: Insert psql commands inside a script