summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--acconfig.h4
-rw-r--r--configure.in9
-rw-r--r--include/apr.h.in6
-rw-r--r--include/apr.hw1
-rw-r--r--include/arch/unix/networkio.h2
-rw-r--r--network_io/unix/networkio.h2
-rw-r--r--network_io/unix/sendrecv.c2
-rw-r--r--network_io/unix/sockaddr.c2
8 files changed, 19 insertions, 9 deletions
diff --git a/acconfig.h b/acconfig.h
index 8c8404514..e0d77f038 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -41,10 +41,6 @@
/* Make sure we have ssize_t defined to be something */
#undef ssize_t
-#if !defined(HAVE_SOCKLEN_T)
-typedef int socklen_t;
-#endif
-
/* switch this on if we have a BeOS version below BONE */
#if BEOS && !HAVE_BONE_VERSION
#define BEOS_R5 1
diff --git a/configure.in b/configure.in
index 335c7b846..35c1d44d1 100644
--- a/configure.in
+++ b/configure.in
@@ -296,7 +296,7 @@ AC_CHECK_HEADERS(sys/resource.h)
AC_CHECK_HEADERS(sys/select.h)
AC_CHECK_HEADERS(sys/sendfile.h)
AC_CHECK_HEADERS(sys/signal.h)
-AC_CHECK_HEADERS(sys/socket.h)
+AC_CHECK_HEADERS(sys/socket.h, sys_socketh="1", sys_socketh="0")
AC_CHECK_HEADERS(sys/stat.h)
AC_CHECK_HEADERS(sys/types.h, sys_typesh="1", sys_typesh="0")
AC_CHECK_HEADERS(sys/wait.h, sys_waith="1", sys_waith="0")
@@ -312,6 +312,7 @@ AC_SUBST(fcntlh)
AC_SUBST(netinet_inh)
AC_SUBST(stdargh)
AC_SUBST(stdioh)
+AC_SUBST(sys_socketh)
AC_SUBST(sys_typesh)
AC_SUBST(sys_uioh)
AC_SUBST(signalh)
@@ -377,6 +378,11 @@ if test "$ac_cv_type_ssize_t" = "yes"; then
else
ssize_t_value="apr_int32_t"
fi
+if test "$ac_cv_socklen_t" = "yes"; then
+ socklen_t_value="socklen_t"
+else
+ socklen_t_value="int"
+fi
AC_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
@@ -415,6 +421,7 @@ AC_SUBST(long_value)
AC_SUBST(off_t_value)
AC_SUBST(size_t_value)
AC_SUBST(ssize_t_value)
+AC_SUBST(socklen_t_value)
AC_SUBST(ssize_t_fmt)
AC_SUBST(off_t_fmt)
diff --git a/include/apr.h.in b/include/apr.h.in
index a8416933f..9b55fac89 100644
--- a/include/apr.h.in
+++ b/include/apr.h.in
@@ -32,6 +32,7 @@
#define APR_HAVE_PTHREAD_H @pthreadh@
#define APR_HAVE_STDARG_H @stdargh@
#define APR_HAVE_STDIO_H @stdioh@
+#define APR_HAVE_SYS_SOCKET_H @sys_socketh@
#define APR_HAVE_SYS_TYPES_H @sys_typesh@
#define APR_HAVE_SYS_UIO_H @sys_uioh@
#define APR_HAVE_SIGNAL_H @signalh@
@@ -78,6 +79,10 @@
#include <sys/types.h>
#endif
+#if APR_HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
/* APR Feature Macros */
#define APR_HAS_SHARED_MEMORY @sharedmem@
#define APR_HAS_THREADS @threads@
@@ -113,6 +118,7 @@ typedef unsigned @long_value@ apr_uint64_t;
typedef @size_t_value@ apr_size_t;
typedef @ssize_t_value@ apr_ssize_t;
typedef @off_t_value@ apr_off_t;
+typedef @socklen_t_value@ apr_socklen_t;
/* Definitions that APR programs need to work properly. */
diff --git a/include/apr.hw b/include/apr.hw
index 2e151108b..974a56a6b 100644
--- a/include/apr.hw
+++ b/include/apr.hw
@@ -166,6 +166,7 @@ typedef unsigned __int64 apr_uint64_t;
typedef int apr_size_t;
typedef int apr_ssize_t;
typedef _off_t apr_off_t;
+typedef size_t apr_socklen_t;
typedef int pid_t;
typedef int uid_t;
typedef int gid_t;
diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h
index 90868b06d..84c8b4a81 100644
--- a/include/arch/unix/networkio.h
+++ b/include/arch/unix/networkio.h
@@ -121,7 +121,7 @@ struct apr_socket_t {
int socketdes;
struct sockaddr_in *local_addr;
struct sockaddr_in *remote_addr;
- socklen_t addr_len;
+ apr_socklen_t addr_len;
apr_interval_time_t timeout;
#ifndef HAVE_POLL
int connected;
diff --git a/network_io/unix/networkio.h b/network_io/unix/networkio.h
index 90868b06d..84c8b4a81 100644
--- a/network_io/unix/networkio.h
+++ b/network_io/unix/networkio.h
@@ -121,7 +121,7 @@ struct apr_socket_t {
int socketdes;
struct sockaddr_in *local_addr;
struct sockaddr_in *remote_addr;
- socklen_t addr_len;
+ apr_socklen_t addr_len;
apr_interval_time_t timeout;
#ifndef HAVE_POLL
int connected;
diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c
index ad22eb53f..9c145dce9 100644
--- a/network_io/unix/sendrecv.c
+++ b/network_io/unix/sendrecv.c
@@ -224,7 +224,7 @@ static int os_cork(apr_socket_t *sock)
/* Linux only for now */
int nodelay_off = 0, corkflag = 1, rv, delayflag;
- socklen_t delaylen = sizeof(delayflag);
+ apr_socklen_t delaylen = sizeof(delayflag);
/* XXX it would be cheaper to use an apr_socket_t flag here */
rv = getsockopt(sock->socketdes, SOL_TCP, TCP_NODELAY,
diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
index bce1053ff..08489a567 100644
--- a/network_io/unix/sockaddr.c
+++ b/network_io/unix/sockaddr.c
@@ -73,7 +73,7 @@ apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port)
static apr_status_t get_local_addr(apr_socket_t *sock)
{
- socklen_t namelen = sizeof(*sock->local_addr);
+ apr_socklen_t namelen = sizeof(*sock->local_addr);
if (getsockname(sock->socketdes, (struct sockaddr *)sock->local_addr,
&namelen) < 0) {