autoconf check for socklen_t

Darren Hall dhall at virage.org
Tue Dec 28 17:55:08 EST 1999


Here's a configure check to see if socklen_t is defined.  Even though my
man pages on linux say accept(2) takes (int *) as it's 3rd arg, the
sys/socket.h files begs to differ.

If not defined (which is doesn't seem to be on AIX 4.2.1), it can be
explicitly typedef'ed to (unsigned int).  Now do mainstream code changes
get submitted back to the openbsd group, or would it be better to submit to
this list?

After defining all those variables to socklen_t, this should clean up the
spurious errors spewed forth from AIX's native compiler, about the uncast
connect, accept and bind calls.

context diff on 1.2.1pre21

*** configure.in~       Sat Dec 25 18:21:48 1999
--- configure.in        Mon Dec 27 00:55:17 1999
***************
*** 180,185 ****
--- 180,197 ----
        [AC_MSG_RESULT(no)]
  )

+ AC_MSG_CHECKING([For socklen_t])
+ AC_TRY_COMPILE(
+ [#include <sys/types.h>],
+ [#include <sys/socket.h>],
+ [socklen_t foo; foo = 1235;],
+ [
+       AC_DEFINE(HAVE_SOCKLEN_T)
+       AC_MSG_RESULT(yes)
+ ],
+ [AC_MSG_RESULT(no)]
+ )
+
  dnl Check PAM strerror arguments
  AC_MSG_CHECKING([whether pam_strerror takes only one argument])
  AC_TRY_COMPILE(





More information about the openssh-unix-dev mailing list