#15 Forget HPUX support, fully broken.

open
nobody
None
5
2001-05-28
2001-05-28
Anonymous
No

I have tried 3 successive releases of queue on HP, and
found the amount of bugs increasing. It seams no
developer cares about HP-UX, so the impression given by
the hp references in the sources is misleading.

For those who don't think it is desparate, find a list
of trouble in queue-1.40.1beta below:

=== use of nonstandard sigaction interface in qlib.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c qlib.c
qlib.c: In function `Queue_io_ignore_unwanted_signals':
qlib.c:1169: `SA_DEFER' undeclared (first use in this
function)
qlib.c:1169: (Each undeclared identifier is reported
only once
qlib.c:1169: for each function it appears in.)
qlib.c:1170: structure has no member named
`sa_restorer'
make: *** [qlib.o] Error 1

Can be fixed by patch :

***************
*** 1161,1173 ****
--- 1161,1204 ----
ign_sigaction.sa_handler = Queue_sighandler_dummy;
ign_sigaction.sa_mask =
Queue_io_unwanted_sigs_sigset;

+ /* The intent is to allow the signal being handled
to be delivered to
+ the handler, while by default, sigaction would
block it.
+
+ On different OS's this option has different
names :
+
+ Linux : signal(7)
+
+ SA_NOMASK or SA_NODEFER
+ Do not prevent the signal from
being received from within its own
+ signal handler.
+
+ HP-UX : signal(5)
+
+ SA_NODEFER
+ Causes signal not to be
automatically
+ blocked on entry to signal
handler.
+
+ Solaris : according to WGK this option is called
SA_DEFER... Curious.
+ */
+
/*WGK 2001/04/11 Solaris fix.*/
+ #if defined(solaris)
#ifndef SA_NOMASK
#define SA_NOMASK SA_DEFER
#endif /*SA_NOMASK*/
+ #endif /*solaris*/
+
+ #ifdef __hpux
+ #define SA_NOMASK SA_NODEFER
+ #endif

ign_sigaction.sa_flags = (SA_RESTART |
SA_NOMASK);
+
+ #ifndef __hpux
ign_sigaction.sa_restorer = NULL; /* This is
obsolete, should not be used. */
+
+ /* On hp this obsolete interface does not exist */
+ #endif

for (; i-- && (i_signum = *i_signum_p);
i_signum_p++, i_sigaction++)
{

=== lots on non-standard utmp calls needs HPUX
conditions

gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c logging.c
logging.c: In function `makeutent':
logging.c:220: structure has no member named `e_exit'
logging.c:236: structure has no member named `ut_name'
logging.c:237: structure has no member named `ut_name'
logging.c:242: structure has no member named
`ut_session'
logging.c: In function `cleanutent':
logging.c:305: structure has no member named
`ut_session'

Can be fixed by following patch :

*** logging.c.orig Mon May 28 21:01:33 2001
--- logging.c Mon May 28 21:13:42 2001
***************
*** 216,224 ****
--- 216,229 ----

/* set up the new entry */
ut.ut_type = USER_PROCESS;
+ #ifdef __hpux
+ ut.ut_exit.__e_exit = 2;
+ #else
#ifndef linux
ut.ut_exit.e_exit = 2;
#endif
+ #endif
+
STRNCPY(ut.ut_user, (pwent && pwent->pw_name) ?
pwent->pw_name : "?",
sizeof(ut.ut_user));
STRNCPY(ut.ut_id, ut_id, sizeof(ut.ut_id));
***************
*** 233,245 ****
--- 238,254 ----
#endif

/* ut_name is normally the same as ut_user, but ....
*/
+ #ifndef __hpux
STRNCPY(ut.ut_name, (pwent && pwent->pw_name) ?
pwent->pw_name : "?",
sizeof(ut.ut_name));
+ #endif

ut.ut_pid = getpid();

#ifdef RXVT_UTMP_AS_UTMPX
+ #ifndef __hpux
ut.ut_session = getsid(0);
+ #endif
ut.ut_tv.tv_sec = time(NULL);
ut.ut_tv.tv_usec = 0;
#else
***************
*** 302,308 ****
--- 311,319 ----
putmp->ut_type = DEAD_PROCESS;

#ifdef RXVT_UTMP_AS_UTMPX
+ #ifndef __hpux
putmp->ut_session = getsid(0);
+ #endif
putmp->ut_tv.tv_sec = time(NULL);
putmp->ut_tv.tv_usec = 0;
#else /* HAVE_UTMPX_H */

=== someone invented the error() function, but didn't
add it to random.c

gcc -g -O2 -o random random.o qlib.o getloadavg.o
setenv.o getopt_long.o -lelf -lcrypt -lxnet -lnsl -lelf
-lrpcsvc
collect2: ld returned 1 exit status
/usr/bin/ld: Unsatisfied symbols:
error (code)

Can be fixed by adding in random.c :

> void error(char* theMessage)
> {
> if (theMessage && (*theMessage)) fputs(theMessage,
stderr);
> }

=== the usual wait3 interface errors

queued.c: In function `waitforchild':
queued.c:1663: warning: passing arg 1 of `wait3' from
incompatible pointer type
queued.c:1716: incompatible types in assignment
queued.c:1736: warning: passing arg 1 of `wait3' from
incompatible pointer type

Can be fixed by following patch :

*** queued.c.orig Mon May 28 21:14:09 2001
--- queued.c Mon May 28 22:28:29 2001
***************
*** 1632,1638 ****

#if defined(solaris) || defined(__hpux)
# define PROPER_WAIT_STATUS(a)
(a.w_status)
! # define PROPER_WAIT_STATUS_P_ARG(a_p) a_p
union { int w_status; } wait_status;
# else
# define PROPER_WAIT_STATUS(a) a
--- 1632,1638 ----

#if defined(solaris) || defined(__hpux)
# define PROPER_WAIT_STATUS(a)
(a.w_status)
! # define PROPER_WAIT_STATUS_P_ARG(a_p)
a_p.w_status
union { int w_status; } wait_status;
# else
# define PROPER_WAIT_STATUS(a) a
***************
*** 1708,1714 ****
{
systemflag = 0;
/*End of code modified and Copyright 2001 QingLong
<QingLong@Bolizm> (GPL'd).*/
! #ifdef solaris
/*Start of code modified and Copyright 2001 by
QingLong <QingLong@Bolizm>
Released under GPL; see file COPYING for details.*/
hpuxstatus = wait_status.w_status;
--- 1708,1714 ----
{
systemflag = 0;
/*End of code modified and Copyright 2001 QingLong
<QingLong@Bolizm> (GPL'd).*/
! #if defined(solaris) || defined(__hpux)
/*Start of code modified and Copyright 2001 by
QingLong <QingLong@Bolizm>
Released under GPL; see file COPYING for details.*/
hpuxstatus = wait_status.w_status;

=== configuration doesn't see hp has no updwtmpx

gcc -g -O2 -o queued ident.o handle.o lex.o
logging.o mrestart.o pty.o qlib.o queued.o sha1.o
wakeup.o getloadavg.o setenv.o getopt_long.o -lelf
-lcrypt -lxnet -lnsl -lel
f -lrpcsvc
collect2: ld returned 1 exit status
/usr/bin/ld: Unsatisfied symbols:
updwtmpx (code)

here I gave up all hope... the hack seems to be beyond
repair...

Discussion