Re: C function - other process

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: C function - other process
Date: 2005-04-22 20:36:30
Message-ID: 20050422203629.GA94052@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2005-04-23 05:19:43 Re: How to select from many database ??
Previous Message Tom Lane 2005-04-22 20:07:48 Re: C function - other process