Build failures: nanosleep on Solaris and AIX 4.2.x

Darren Tucker dtucker at zip.com.au
Sat Jan 25 18:47:38 EST 2003


Hi All.
	The recent changes to scp caused build failures on Solaris and AIX 4.2
which showed up on the tinderbox[1].  I mentioned the first to djm in
email yesterday but I'm posting after finding the second, in case anyone
else has seen similar problems.

	Solaris' nanosleep is in librt (or libposix4 in older versions) which
is not linked. Adding them to configure works fine, however ldd show
most of the binaries linked to librt.so (which is part of the core
libraries package).  I don't think this is a big deal (right?)

	AIX 4.2.1 does not have nanosleep but has an equivalent (nsleep). AIX
4.3.3 has nanosleep, I don't know about versions in between.

	The attached patch fixes both with one combined nanosleep test in
configure and a couple of #defines.

[1] http://dodgynet.dyndns.org/tinderbox/OpenSSH_Portable/status.html

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
-------------- next part --------------
Index: acconfig.h
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/acconfig.h,v
retrieving revision 1.147
diff -u -r1.147 acconfig.h
--- acconfig.h	12 Jan 2003 23:04:59 -0000	1.147
+++ acconfig.h	25 Jan 2003 05:20:54 -0000
@@ -371,6 +371,9 @@
 #undef SETPROCTITLE_STRATEGY
 #undef SETPROCTITLE_PS_PADDING
 
+/* Have nanosleep() */
+#undef HAVE_NANOSLEEP
+
 @BOTTOM@
 
 /* ******************* Shouldn't need to edit below this line ************** */
Index: configure.ac
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/configure.ac,v
retrieving revision 1.102
diff -u -r1.102 configure.ac
--- configure.ac	20 Jan 2003 04:20:25 -0000	1.102
+++ configure.ac	25 Jan 2003 06:48:20 -0000
@@ -388,7 +388,7 @@
 	rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
 	strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
 	sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
-	sys/stropts.h sys/sysmacros.h sys/time.h \
+	sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
 	sys/un.h time.h tmpdir.h ttyent.h usersec.h \
 	util.h utime.h utmp.h utmpx.h)
 
@@ -604,7 +604,7 @@
 	clock fchmod fchown freeaddrinfo futimes gai_strerror \
 	getaddrinfo getcwd getgrouplist getnameinfo getopt getpeereid\
 	getrlimit getrusage getttyent glob inet_aton inet_ntoa \
-	inet_ntop innetgr login_getcapbool md5_crypt memmove \
+	inet_ntop innetgr login_getcapbool md5_crypt memmove nsleep \
 	mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo pstat readpassphrase \
 	realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
 	setenv seteuid setgroups setlogin setproctitle setresgid setreuid \
@@ -615,6 +615,11 @@
 
 dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
 AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
+
+AC_CHECK_FUNC(nanosleep,
+        AC_DEFINE(HAVE_NANOSLEEP),
+        AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
+)
 
 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Index: includes.h
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/includes.h,v
retrieving revision 1.61
diff -u -r1.61 includes.h
--- includes.h	21 Oct 2002 00:50:26 -0000	1.61
+++ includes.h	25 Jan 2003 07:18:36 -0000
@@ -104,6 +104,9 @@
 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h> /* For timersub */
 #endif
+#ifdef HAVE_SYS_TIMERS_H
+# include <sys/timers.h>	/* For struct timespec on AIX 4.2.x */
+#endif
 #include <sys/resource.h>
 #ifdef HAVE_SYS_SELECT_H
 # include <sys/select.h>
Index: openbsd-compat/port-aix.h
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/openbsd-compat/port-aix.h,v
retrieving revision 1.6
diff -u -r1.6 port-aix.h
--- openbsd-compat/port-aix.h	7 Jul 2002 02:17:36 -0000	1.6
+++ openbsd-compat/port-aix.h	25 Jan 2003 06:45:24 -0000
@@ -26,4 +26,12 @@
 
 #ifdef _AIX
 void aix_usrinfo(struct passwd *pw);
+
+/*
+ * AIX 4.2.x doesn't have nanosleep but does have nsleep which is equivalent
+ */
+#if !defined(HAVE_NANOSLEEP) && defined(HAVE_NSLEEP)
+#define nanosleep nsleep
+#endif
+
 #endif /* _AIX */


More information about the openssh-unix-dev mailing list