Call for testing: OpenSSH-6.2

Damien Miller djm at mindrot.org
Fri Mar 8 12:02:51 EST 2013


On Wed, 6 Mar 2013, Tom Christensen wrote:

> ld: ERROR 33: Unresolved text symbol "usleep" -- 1st referenced by sshd.o.
> ld: INFO 60: Output file removed because of error.
> collect2: ld returned 1 exit status
> 
> IRIX 5.3 does not have usleep anywhere. I worked around this by replacing
> usleep with sginap.

Here's a usleep replacement at least.

Index: configure.ac
===================================================================
RCS file: /var/cvs/openssh/configure.ac,v
retrieving revision 1.512
diff -u -p -r1.512 configure.ac
--- configure.ac	6 Mar 2013 06:48:48 -0000	1.512
+++ configure.ac	8 Mar 2013 01:01:28 -0000
@@ -1602,6 +1602,7 @@ AC_CHECK_FUNCS([ \
 	unsetenv \
 	updwtmpx \
 	user_from_uid \
+	usleep \
 	vasprintf \
 	vhangup \
 	vsnprintf \
Index: openbsd-compat/bsd-misc.c
===================================================================
RCS file: /var/cvs/openssh/openbsd-compat/bsd-misc.c,v
retrieving revision 1.39
diff -u -p -r1.39 bsd-misc.c
--- openbsd-compat/bsd-misc.c	15 Feb 2013 03:55:39 -0000	1.39
+++ openbsd-compat/bsd-misc.c	8 Mar 2013 01:01:01 -0000
@@ -165,6 +165,17 @@ int nanosleep(const struct timespec *req
 }
 #endif
 
+#if !defined(HAVE_USLEEP)
+int usleep(unsigned int useconds)
+{
+	struct timespec ts;
+
+	ts.tv_sec = useconds / 1000000;
+	ts.tv_nsec = (useconds % 1000000) * 1000;
+	return nanosleep(&ts, NULL);
+}
+#endif
+
 #ifndef HAVE_TCGETPGRP
 pid_t
 tcgetpgrp(int fd)
Index: openbsd-compat/bsd-misc.h
===================================================================
RCS file: /var/cvs/openssh/openbsd-compat/bsd-misc.h,v
retrieving revision 1.22
diff -u -p -r1.22 bsd-misc.h
--- openbsd-compat/bsd-misc.h	15 Feb 2013 00:41:36 -0000	1.22
+++ openbsd-compat/bsd-misc.h	8 Mar 2013 01:01:04 -0000
@@ -80,6 +80,10 @@ struct timespec {
 int nanosleep(const struct timespec *, struct timespec *);
 #endif
 
+#ifndef HAVE_USLEEP
+int usleep(unsigned int useconds);
+#endif
+
 #ifndef HAVE_TCGETPGRP
 pid_t tcgetpgrp(int);
 #endif


More information about the openssh-unix-dev mailing list