Re: C function - other process

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: C function - other process
Дата
Msg-id 20050422203629.GA94052@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: C function - other process  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: C function - other process
Следующее
От: "Letnes, David G."
Дата:
Сообщение: Insert psql commands inside a script