Re: [HACKERS] pg_regress in C

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: [HACKERS] pg_regress in C
Дата
Msg-id 20060719064537.GA31786@svana.org
обсуждение исходный текст
Ответ на Re: pg_regress in C  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] pg_regress in C  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
On Tue, Jul 18, 2006 at 10:46:04PM -0400, Tom Lane wrote:
> ...  One reason I didn't try to do this is I'm a bit hesitant to
> write a signal handler that does anything as interesting as a system()
> call, which would seem to be necessary to duplicate what the shell
> script did.  Comments?

It might not actually be unsafe, given system() actually blocks on
waitpid() which is specifically listed as a "safe" function. I'm a bit
confused though, because system() generally sets the parent to ignore
SIGINT which running the child process. That means the postmaster is
being killed but pg_regress is not? If this is the case, then you won't
be able to catch SIGINT anyway.

Also, the kernel sending it to everyone on the same terminal is (AIUI)
only true if you're running under the same session ID. postgres only
daemonizes itself to be immune from frontend terminal interrupts (using
setsid) when silent_mode is on. I think it defaults to off, which is
probably why it works at all.

Anyway, the signal handling for Windows involves a seperate thead AIUI
which may make it easier. It might be interesting to see how bash does
it.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: [HACKERS] 8.2 features?
Следующее
От: Zdenek Kotala
Дата:
Сообщение: Re: New regresion test for SET/RESET commnad