A bit of PG archeology uncovers an interesting Linux/Unix factoid

Поиск
Список
Период
Сортировка
От Greg Stark
Тема A bit of PG archeology uncovers an interesting Linux/Unix factoid
Дата
Msg-id CAM-w4HMLmCwxCyVfxbbrA=jOr=2VL=mrm8VsJHUv7LWYX7H6Fw@mail.gmail.com
обсуждение исходный текст
Ответы Re: A bit of PG archeology uncovers an interesting Linux/Unix factoid  (Chapman Flack <chap@anastigmatix.net>)
Список pgsql-hackers
For reasons, I was trying to compile older versions of Postgres and
ran into a strange behaviour where system() worked normally but then
returned -1 with errno set to ECHILD. And surprisingly it looks like
we've seen this behaviour in the past but on a Solaris:

commit 07d4d36aae79cf2ac365e381ed3e7ce62dcfa783
Author: Tatsuo Ishii <ishii@postgresql.org>
Date:   Thu May 25 06:53:43 2000 +0000
   On solaris, createdb/dropdb fails because of strange behavior of system().   (it returns error with errno ECHILD
uponsuccessful completion of commands).   This fix ignores an error from system() if errno == ECHILD.
 

It looks like Linux now behaves similarly, in fact there's a Redhat
notice about this causing similar headaches in Oracle:
https://access.redhat.com/solutions/37218

So just in case anyone else wants to use system() in Postgres or
indeed any other Unix application that twiddles with the SIGCHILD
handler this is something to beware of. It's not entirely clear to me
that the mention of SA_NOCLDWAIT is the only way to get this
behaviour, at least one stackoverflow answer implied just setting
SIG_IGN was enough.

-- 
greg



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Re: Reusing abbreviated keys during second pass of ordered [set] aggregates
Следующее
От: Tom Lane
Дата:
Сообщение: Re: xlc atomics