diff options
author | Darren Tucker <dtucker@zip.com.au> | 2011-09-29 23:17:18 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2011-09-29 23:17:18 +1000 |
commit | b54f50e5d0053e2c79fbb5032722aca541fdc6c1 (patch) | |
tree | 327801f832c83ec725dbe937a74aa94049731471 /configure.ac | |
parent | 5ffe1c4b437a519c90b2017ce8afeef0f845207c (diff) |
- (dtucker) [configure.ac openbsd-compat/Makefile.in
openbsd-compat/strnlen.c] Add strnlen to the compat library.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 38e260ce..95a2a8d1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.481 2011/09/29 01:11:55 djm Exp $ +# $Id: configure.ac,v 1.482 2011/09/29 13:17:21 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.481 $) +AC_REVISION($Revision: 1.482 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -1501,6 +1501,7 @@ AC_CHECK_FUNCS([ \ strlcat \ strlcpy \ strmode \ + strnlen \ strnvis \ strptime \ strtonum \ @@ -2505,6 +2506,51 @@ elif test "x$sandbox_arg" = "xrlimit" || \ AC_MSG_ERROR([rlimit sandbox requires setrlimit function]) SANDBOX_STYLE="rlimit" AC_DEFINE([SANDBOX_RLIMIT], [1], [Sandbox using setrlimit(2)]) + + AC_MSG_CHECKING([if select works with zero available fds]) + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([[ +#include <sys/time.h> +#ifdef HAVE_SYS_SELECT_H +#include <sys/select.h> +#endif +#ifdef HAVE_SYS_STAT_H +#include <sys/stat.h> +#endif +#include <sys/resource.h> +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <stdlib.h> + ]], [[ + struct rlimit rl_zero; + int fd, r; + fd_set fds; + + fd = open("/dev/null", O_RDWR); + rl_zero.rlim_cur = rl_zero.rlim_max = 0; + setrlimit(RLIMIT_FSIZE, &rl_zero); + setrlimit(RLIMIT_NOFILE, &rl_zero); + FD_ZERO(&fds); + FD_SET(fd, &fds); + r = select(fd+1, &fds, NULL, NULL, NULL); + if (r == -1) + exit(1); + exit(0); + ]])], [ + AC_MSG_RESULT(yes) + AC_DEFINE([SELECT_REQUIRED_FDS], [0], + [number of available fds required for select]) + ], [ + AC_MSG_RESULT(no) + AC_DEFINE([SELECT_REQUIRED_FDS], [1], + [number of available fds required for select]) + ], [ + AC_MSG_RESULT([cross-compiling, assuming yes]) + AC_DEFINE([SELECT_REQUIRED_FDS], [0], + [assuming select works with zero free fds]) + ] + ) elif test -z "$sandbox_arg" || test "x$sandbox_arg" = "xno" || \ test "x$sandbox_arg" = "xnone" || test "x$sandbox_arg" = "xnull" ; then SANDBOX_STYLE="none" |