This is with code out of the git repo, I think the last release behaves the same on this platform but haven't tested it much.
Firstly, a default build is unable to resume detached sessions, showing WriteMessage: Bad file number Compiling instead with -DNAMEDPIPE does get around this however. Regardless of figuring out a fix for the above error, does anyone have hints as to how the the configure script might be improved to detect the need for -DNAMEDPIPE on this OS? Secondly, I'm not getting the load average feature compiled in without explicitly adding -DLOADAV, but that initially doesn't compile because I have no definition of the LOADAV_AVENRUN macro. I'm able to compile by changing line 303 of loadav.c to nl[0].n_name = "avenrun"; A bit of a closer look at the config.log showed me what looks to be the problem, here's the excerpt: configure:5573: checking for nlist declaration... configure:5593: checking for avenrun symbol... configure:5635: cc -o conftest -g -L/usr/local/lib/hpux32 conftest.c -lncurses -lelf >&5 ld: Type mismatch for symbol "nl"; resolving OBJECT symbol (in file conftest.o) to FUNC symbol (in file /usr/local/lib/hpux32/libncurses.so) 1 warnings. configure:5635: $? = 0 configure:5635: ./conftest ./configure[20]: 26016 Memory fault(coredump) configure:5635: $? = 139 configure: program exited with status 139 I'm not entirely sure that my ncurses is completely normal, since it's from a binary package... it does seem a bit odd for ncurses to have a two-letter global, but the one in screen is easily enough changed. diff --git a/src/Makefile.in b/src/Makefile.in index d087311..8ea2b0e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -34,7 +34,10 @@ SCREENENCODINGS = $(datadir)/screen/utf8encodings CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ -DETCSCREENRC='"$(ETCSCREENRC)"' \ - -DSCREENENCODINGS='"$(SCREENENCODINGS)"' + -DSCREENENCODINGS='"$(SCREENENCODINGS)"' \ + -DNAMEDPIPE \ +# -D_XOPEN_SOURCE_EXTENDED +# Needed on HP-UX 11.31 only without -DNAMEDPIPE, but resuming doesn't work then. LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ @@ -155,10 +158,10 @@ clean celan: mostlyclean # configuring or building the program. # building of term.h/comm.h requires awk. Keep it in the distribution # we keep config.h, as this file knows where 'make dist' finds the ETCSCREENRC. -#distclean: mostlyclean -# rm -f $(SCREEN).tar $(SCREEN).tar.gz -# rm -f config.status Makefile -# rm -f osdef.h doc/Makefile +distclean: mostlyclean + rm -f $(SCREEN).tar $(SCREEN).tar.gz + rm -f config.status Makefile + rm -f osdef.h doc/Makefile maintainer-clean: @echo "This command is not even intended for maintainers to use;" diff --git a/src/configure.in b/src/configure.in index e9ca223..8d5b7d0 100644 --- a/src/configure.in +++ b/src/configure.in @@ -945,21 +945,21 @@ else $nlist64 -struct nlist nl[2]; +struct nlist nlarr[2]; main() { #if !defined(_AUX_SOURCE) && !defined(AUX) # ifdef NLIST_NAME_UNION - nl[0].n_un.n_name = "$av"; + nlarr[0].n_un.n_name = "$av"; # else - nl[0].n_name = "$av"; + nlarr[0].n_name = "$av"; # endif #else - strncpy(nl[0].n_name, "$av", sizeof(nl[0].n_name)); + strncpy(nlarr[0].n_name, "$av", sizeof(nlarr[0].n_name)); #endif - nlist(LOADAV_UNIX, nl); - if (nl[0].n_value == 0) + nlist(LOADAV_UNIX, nlarr); + if (nlarr[0].n_value == 0) exit(1); exit(0); } diff --git a/src/loadav.c b/src/loadav.c index 770010c..eaa207a 100644 --- a/src/loadav.c +++ b/src/loadav.c @@ -283,7 +283,7 @@ extern int nlist __P((char *, struct nlist *)); # define nlist nlist64 #endif -static struct nlist nl[2]; +static struct nlist nlarr[2]; static int kmemf; #ifdef _IBMR2 @@ -298,33 +298,33 @@ InitLoadav() return; # if !defined(_AUX_SOURCE) && !defined(AUX) # ifdef NLIST_NAME_UNION - nl[0].n_un.n_name = LOADAV_AVENRUN; + nlarr[0].n_un.n_name = LOADAV_AVENRUN; # else - nl[0].n_name = LOADAV_AVENRUN; + nlarr[0].n_name = "avenrun"; # endif # else - strncpy(nl[0].n_name, LOADAV_AVENRUN, sizeof(nl[0].n_name)); + strncpy(nlarr[0].n_name, LOADAV_AVENRUN, sizeof(nlarr[0].n_name)); # endif - debug2("Searching in %s for %s\n", LOADAV_UNIX, nl[0].n_name); - nlist(LOADAV_UNIX, nl); - if (nl[0].n_value == 0) + debug2("Searching in %s for %s\n", LOADAV_UNIX, nlarr[0].n_name); + nlist(LOADAV_UNIX, nlarr); + if (nlarr[0].n_value == 0) { close(kmemf); return; } # if 0 /* no longer needed (al.sm...@aeschi.ch.eu.org) */ # ifdef sgi - nl[0].n_value &= (unsigned long)-1 >> 1; /* clear upper bit */ + nlarr[0].n_value &= (unsigned long)-1 >> 1; /* clear upper bit */ # endif /* sgi */ # endif - debug1("AvenrunSym found (0x%lx)!!\n", nl[0].n_value); + debug1("AvenrunSym found (0x%lx)!!\n", nlarr[0].n_value); loadok = 1; } static int GetLoadav() { - if (lseek(kmemf, (off_t) nl[0].n_value, 0) == (off_t)-1) + if (lseek(kmemf, (off_t) nlarr[0].n_value, 0) == (off_t)-1) return 0; if (read(kmemf, (char *) loadav, sizeof(loadav)) != sizeof(loadav)) return 0;