- (djm) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]

Add a usleep replacement for platforms that lack it; ok dtucker
This commit is contained in:
Damien Miller 2013-03-15 10:34:25 +11:00
parent a2438bbd28
commit f4db77d766
4 changed files with 21 additions and 3 deletions

View File

@ -2,6 +2,8 @@
- (djm) [configure.ac] Disable utmp, wtmp and/or lastlog if the platform - (djm) [configure.ac] Disable utmp, wtmp and/or lastlog if the platform
is unable to successfully compile them. Based on patch from des AT is unable to successfully compile them. Based on patch from des AT
des.no des.no
- (djm) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
Add a usleep replacement for platforms that lack it; ok dtucker
20120312 20120312
- (dtucker) [regress/Makefile regress/cipher-speed.sh regress/test-exec.sh] - (dtucker) [regress/Makefile regress/cipher-speed.sh regress/test-exec.sh]

View File

@ -1,4 +1,4 @@
# $Id: configure.ac,v 1.515 2013/03/14 23:23:07 djm Exp $ # $Id: configure.ac,v 1.516 2013/03/14 23:34:25 djm Exp $
# #
# Copyright (c) 1999-2004 Damien Miller # Copyright (c) 1999-2004 Damien Miller
# #
@ -15,7 +15,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
AC_REVISION($Revision: 1.515 $) AC_REVISION($Revision: 1.516 $)
AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_SRCDIR([ssh.c])
AC_LANG([C]) AC_LANG([C])
@ -1604,6 +1604,7 @@ AC_CHECK_FUNCS([ \
unsetenv \ unsetenv \
updwtmpx \ updwtmpx \
user_from_uid \ user_from_uid \
usleep \
vasprintf \ vasprintf \
vhangup \ vhangup \
vsnprintf \ vsnprintf \

View File

@ -165,6 +165,17 @@ int nanosleep(const struct timespec *req, struct timespec *rem)
} }
#endif #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 #ifndef HAVE_TCGETPGRP
pid_t pid_t
tcgetpgrp(int fd) tcgetpgrp(int fd)

View File

@ -1,4 +1,4 @@
/* $Id: bsd-misc.h,v 1.22 2013/02/15 00:41:36 dtucker Exp $ */ /* $Id: bsd-misc.h,v 1.23 2013/03/14 23:34:27 djm Exp $ */
/* /*
* Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org> * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org>
@ -80,6 +80,10 @@ struct timespec {
int nanosleep(const struct timespec *, struct timespec *); int nanosleep(const struct timespec *, struct timespec *);
#endif #endif
#ifndef HAVE_USLEEP
int usleep(unsigned int useconds);
#endif
#ifndef HAVE_TCGETPGRP #ifndef HAVE_TCGETPGRP
pid_t tcgetpgrp(int); pid_t tcgetpgrp(int);
#endif #endif