* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
- * $Id: tcpip.c,v 1.48 2002-09-10 20:56:34 adam Exp $
+ * $Id: tcpip.c,v 1.49 2002-09-20 22:23:13 adam Exp $
*/
#include <stdio.h>
#define TRC(X)
#endif
-#if HAVE_SOCKLEN_T
-#define NET_LEN_T socklen_t
-#else
-#if GETPEERNAME_ACCEPTS_SIZE_T_FOR_THIRD_ARGUMENT
-#define NET_LEN_T size_t
-#else
-#define NET_LEN_T int
-#endif
+#ifndef YAZ_SOCKLEN_T
+#define YAZ_SOCKLEN_T int
#endif
/* this state is used for both SSL and straight TCP/IP */
void *cd)
{
struct sockaddr_in addr;
- NET_LEN_T len = sizeof(addr);
+ YAZ_SOCKLEN_T len = sizeof(addr);
TRC(fprintf(stderr, "tcpip_listen pid=%d\n", getpid()));
if (h->state != CS_ST_IDLE)
struct sockaddr_in addr;
tcpip_state *sp = (struct tcpip_state *)h->cprivate;
char *r, *buf = sp->buf;
- NET_LEN_T len;
+ YAZ_SOCKLEN_T len;
struct hostent *host;
len = sizeof(addr);
* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
- * $Id: unix.c,v 1.5 2002-09-10 20:56:34 adam Exp $
+ * $Id: unix.c,v 1.6 2002-09-20 22:23:13 adam Exp $
* UNIX socket COMSTACK. By Morten Bøgeskov.
*/
#ifndef WIN32
/* Chas added the following, so we get the definition of completeBER */
#include <yaz/odr.h>
-#if HAVE_SOCKLEN_T
-#define NET_LEN_T socklen_t
-#else
-#if GETPEERNAME_ACCEPTS_SIZE_T_FOR_THIRD_ARGUMENT
-#define NET_LEN_T size_t
-#else
-#define NET_LEN_T int
-#endif
+#ifndef YAZ_SOCKLEN_T
+#define YAZ_SOCKLEN_T int
#endif
int unix_close(COMSTACK h);
void *cd)
{
struct sockaddr_un addr;
- NET_LEN_T len = SUN_LEN(&addr);
+ YAZ_SOCKLEN_T len = SUN_LEN(&addr);
TRC(fprintf(stderr, "unix_listen pid=%d\n", getpid()));
if (h->state != CS_ST_IDLE)
dnl YAZ Toolkit, Index Data 1994-2002
dnl See the file LICENSE for details.
-dnl $Id: configure.in,v 1.90 2002-09-18 20:55:54 adam Exp $
+dnl $Id: configure.in,v 1.91 2002-09-20 22:23:13 adam Exp $
AC_INIT(include/yaz/yaz-version.h)
AM_INIT_AUTOMAKE(yaz, 1.9.1)
dnl
AC_CHECK_HEADERS(sys/poll.h)
fi
dnl ------ socklen_t
-dnl AC_CHECK_TYPES(socklen_t)
-AC_MSG_CHECKING(for socklen_t)
-AC_CACHE_VAL(ac_cv_check_socklen_t,
-[ac_cv_check_socklen_t=''
-AC_TRY_COMPILE([
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/socket.h>
-],
- [socklen_t len;],
- ac_cv_check_socklen_t=yes,
- ac_cv_check_socklen_t=no)])
-AC_MSG_RESULT($ac_cv_check_socklen_t)
-if test "$ac_cv_check_socklen_t" = "yes"; then
- AC_DEFINE(HAVE_SOCKLEN_T)
-else
- AC_MSG_CHECKING(whether net size is of type size_t)
- AC_CACHE_VAL(ac_cv_check_getpeername_accepts_size_t,
- [ac_cv_check_getpeername_accepts_size_t=''
+AC_MSG_CHECKING([for socklen_t])
+AC_CACHE_VAL(ac_cv_check_socklen_t,[ac_cv_check_socklen_t=''
AC_TRY_COMPILE([
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/socket.h>
-],
- [size_t mylen; getpeername(0, (struct sockaddr *)NULL, &mylen);],
- ac_cv_check_getpeername_accepts_size_t=yes,
- ac_cv_check_getpeername_accepts_size_t=no)])
- AC_MSG_RESULT($ac_cv_check_getpeername_accepts_size_t)
- if test "$ac_cv_check_getpeername_accepts_size_t" = yes; then
- AC_DEFINE(GETPEERNAME_ACCEPTS_SIZE_T_FOR_THIRD_ARGUMENT)
- fi
-fi
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ extern accept(int, struct sockaddr *, socklen_t *);
+ ],,[ac_cv_check_socklen_t=socklen_t],[
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ extern accept(int, struct sockaddr *, size_t t *);
+ ],,[ac_cv_check_socklen_t=size_t],[ac_cv_check_socklen_t=int])
+ ])
+])
+AC_MSG_RESULT($ac_cv_check_socklen_t)
+AC_DEFINE_UNQUOTED(YAZ_SOCKLEN_T,$ac_cv_check_socklen_t)
dnl
dnl ------ tcpd
AC_ARG_ENABLE(tcpd,[ --enable-tcpd[=PREFIX] enable TCP wrapper for server if available])