UnixWare 7.1.4 (and OpenServer) sigwait issue - Mailing list pgsql-hackers

From Andrew Chernow
Subject UnixWare 7.1.4 (and OpenServer) sigwait issue
Date
Msg-id 497B75C3.9080300@esilo.com
Whole thread Raw
Responses Re: UnixWare 7.1.4 (and OpenServer) sigwait issue  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Continuing http://archives.postgresql.org/pgsql-hackers/2009-01/msg01762.php

Bruce Momjian wrote:>> Well, this helps explain why were are getting these problems reports> only now.  How many hacks
doyou have that we don't support, aside from> the threading one for HPUX?>
 

Compiling threaded libpq on UnixWare fails on sigwait.

I quickly setup a test for unixware 7.1.4.  The only issue I found was with 
sigwait.  Although unixware does have a 2arg POSIX.1c version, it requires 
setting _XOPEN_SOURCE and _POSIX_C_SOURCE in such a manner that breaks other things:

(http://uw714doc.sco.com/en/man/html.3pthread/sigwait.3pthread.html).

My solution was:

1. added the below to configure.in line 1620, same section as 
PGAC_FUNC_POSIX_SIGNALS checks.

AC_MSG_CHECKING(for POSIX.1c sigwait)
AC_TRY_COMPILE([#include <signal.h>],  [sigwait((const sigset_t *)NULL, (int *)NULL)],
[AC_DEFINE(HAVE_POSIX1C_SIGWAIT,1,    [Define if the system includes a POSIX.1c sigwait])    AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])

2. Remove the sigwait prototype declaration from src/test/thread/thread_test.c.  I do not know why it is forcing the 2
argversion of sigwait?  Any insight 
 
would be helpful.  Maybe it is for good reason.

3. Update fe-secure.c line 1337, the only place that uses sigwait, to the below:

#ifdef HAVE_POSIX1C_SIGWAIT  sigwait(&sigpipe_sigset, &signo);
#else  signo = sigwait(&sigpipe_sigset);
#endif

If these changes seemare acceptable, I will provide a formal patch.  BTW, 
openserver has the same issue so this kills two birds with one stone.  Not sure 
if openserver has other issues yet, test scheduled for Monday.

-- 
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Hot standby, dropping a tablespace
Next
From: Gregory Stark
Date:
Subject: Re: [COMMITTERS] pgsql: Automatic view update rules Bernd Helmle