The HP manual says this will work on old HP/UX versions; I'm not sure
about other systems. Possibly it will break on old BSD-derived
systems with 32-bit int, 64-bit size_t and no socklen_t, if there are
any such.
dnl types for the argument to getsockopt, getpeername, etc. So we
dnl have to test to find something that will work.
dnl types for the argument to getsockopt, getpeername, etc. So we
dnl have to test to find something that will work.
-dnl This test originally comes from lftp, by way of Albert Chin at The
-dnl Written Word. Thanks!
+dnl This is no good, because passing the wrong pointer on C compilers is
+dnl likely to only generate a warning, not an error. We don't call this at
+dnl the moment.
AC_DEFUN([TYPE_SOCKLEN_T],
[
AC_DEFUN([TYPE_SOCKLEN_T],
[
#include <sys/socket.h>
],
[
#include <sys/socket.h>
],
[
- socklen_t len;
- getpeername(0,0,&len);
+ socklen_t len;
+ getpeername(0,0,&len);
],
[
lftp_cv_socklen_t=yes
],
[
lftp_cv_socklen_t=yes
#include <sys/socket.h>
],
[
#include <sys/socket.h>
],
[
- $t len;
- getpeername(0,0,&len);
+ $t len;
+ getpeername(0,0,&len);
],
[
lftp_cv_socklen_t_equiv="$t"
break
],
[
lftp_cv_socklen_t_equiv="$t"
break
+ ],
+ [
+ AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
+ ])
done
])
AC_MSG_RESULT($lftp_cv_socklen_t_equiv)
done
])
AC_MSG_RESULT($lftp_cv_socklen_t_equiv)
AC_TYPE_GETGROUPS
AC_STRUCT_ST_RDEV
AC_CHECK_TYPE([ino_t], [unsigned])
AC_TYPE_GETGROUPS
AC_STRUCT_ST_RDEV
AC_CHECK_TYPE([ino_t], [unsigned])
+dnl TYPE_SOCKLEN_T
+AC_CHECK_TYPE([socklen_t], [size_t])
AC_CACHE_CHECK([for errno in errno.h],rsync_cv_errno, [
AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
AC_CACHE_CHECK([for errno in errno.h],rsync_cv_errno, [
AC_TRY_COMPILE([#include <errno.h>],[int i = errno],