Re: C function - other process

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: C function - other process
Дата
Msg-id 20050422200150.GA93845@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: C function - other process  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: C function - other process  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
On Fri, Apr 22, 2005 at 03:39:55PM -0400, Tom Lane wrote:
> Jakub Woźny <kubaw@o2.pl> writes:
> > I wrote a simple function:
> 
> >     signal(SIGCHLD,SIG_IGN);
> >     switch(fork())
> 
> This will NOT work.  It WILL corrupt your database.  You do not get to
> randomly introduce new processes into the backend set.

What about fork() followed by exec*(), either explicitly or via
popen(), system(), etc.?  Should these be avoided as well, or is
there a safe way to do them?  I'm thinking of the case where a
user-defined function wants to invoke some external command -- I've
done that in experiments but I've never been sure how safe it was.

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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: C function - other process
Следующее
От: Tom Lane
Дата:
Сообщение: Re: C function - other process