Configure process now checks availability of recvfrom() socket function and

finds out its return type and the types of its arguments. Added definitions
for non-configure systems config files, and introduced macro sreadfrom which
will be used on udp sockets as a recvfrom() wrapper.
This commit is contained in:
Yang Tse 2008-07-16 19:16:41 +00:00
parent 3a705696af
commit a9dc900515
24 changed files with 651 additions and 10 deletions

View File

@ -6,6 +6,12 @@
Changelog
Yang Tse (16 Jul 2008)
- Configure process now checks availability of recvfrom() socket function and
finds out its return type and the types of its arguments. Added definitions
for non-configure systems config files, and introduced macro sreadfrom which
will be used on udp sockets as a recvfrom() wrapper.
Yang Tse (15 Jul 2008)
- Added description/comment to include paths used in several Makefile.am files.
Added automake option nostdinc to test servers makefile and modified libcurl

View File

@ -1582,6 +1582,152 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [
]) # AC_DEFUN
dnl CURL_CHECK_FUNC_RECVFROM
dnl -------------------------------------------------
dnl Test if the socket recvfrom() function is available,
dnl and check its return type and the types of its
dnl arguments. If the function succeeds HAVE_RECVFROM
dnl will be defined, defining the types of the arguments
dnl in RECVFROM_TYPE_ARG1, RECVFROM_TYPE_ARG2, and so on
dnl to RECVFROM_TYPE_ARG6, defining also the type of the
dnl function return value in RECVFROM_TYPE_RETV.
AC_DEFUN([CURL_CHECK_FUNC_RECVFROM], [
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
#
AC_MSG_CHECKING([for recvfrom])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#else
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#endif
#endif
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#endif
]],[[
recvfrom(0, 0, 0, 0, 0, 0);
]])
],[
AC_MSG_RESULT([yes])
curl_cv_recvfrom="yes"
],[
AC_MSG_RESULT([no])
curl_cv_recvfrom="no"
])
#
if test "$curl_cv_recvfrom" = "yes"; then
AC_CACHE_CHECK([types of args and return type for recvfrom],
[curl_cv_func_recvfrom_args], [
curl_cv_func_recvfrom_args="unknown"
for recvfrom_retv in 'int' 'ssize_t'; do
for recvfrom_arg1 in 'int' 'ssize_t' 'SOCKET'; do
for recvfrom_arg2 in 'char *' 'void *'; do
for recvfrom_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
for recvfrom_arg4 in 'int' 'unsigned int'; do
for recvfrom_arg5 in 'struct sockaddr *' 'void *'; do
for recvfrom_arg6 in 'socklen_t *' 'int *' 'unsigned int *' 'size_t *'; do
if test "$curl_cv_func_recvfrom_args" = "unknown"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#else
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#endif
#endif
#define RECVFROMCALLCONV PASCAL
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#define RECVFROMCALLCONV
#endif
extern $recvfrom_retv RECVFROMCALLCONV
recvfrom($recvfrom_arg1, $recvfrom_arg2,
$recvfrom_arg3, $recvfrom_arg4,
$recvfrom_arg5, $recvfrom_arg6);
]],[[
$recvfrom_arg1 s=0;
$recvfrom_arg2 buf=0;
$recvfrom_arg3 len=0;
$recvfrom_arg4 flags=0;
$recvfrom_arg5 addr=0;
$recvfrom_arg6 addrlen=0;
$recvfrom_retv res=0;
res = recvfrom(s, buf, len, flags, addr, addrlen);
]])
],[
curl_cv_func_recvfrom_args="$recvfrom_arg1,$recvfrom_arg2,$recvfrom_arg3,$recvfrom_arg4,$recvfrom_arg5,$recvfrom_arg6,$recvfrom_retv"
])
fi
done
done
done
done
done
done
done
]) # AC_CACHE_CHECK
if test "$curl_cv_func_recvfrom_args" = "unknown"; then
AC_MSG_ERROR([Cannot find proper types to use for recvfrom args])
else
recvfrom_prev_IFS=$IFS; IFS=','
set dummy `echo "$curl_cv_func_recvfrom_args" | sed 's/\*/\*/g'`
IFS=$recvfrom_prev_IFS
shift
#
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG1, $[1],
[Define to the type of arg 1 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2, $[2],
[Define to the type of arg 2 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG3, $[3],
[Define to the type of arg 3 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG4, $[4],
[Define to the type of arg 4 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5, $[5],
[Define to the type of arg 5 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6, $[6],
[Define to the type of arg 6 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_RETV, $[7],
[Define to the function return type for recvfrom.])
#
AC_DEFINE_UNQUOTED(HAVE_RECVFROM, 1,
[Define to 1 if you have the recvfrom function.])
ac_cv_func_recvfrom="yes"
fi
else
AC_MSG_ERROR([Unable to link function recvfrom])
fi
]) # AC_DEFUN
dnl CURL_CHECK_MSG_NOSIGNAL
dnl -------------------------------------------------
dnl Check for MSG_NOSIGNAL

View File

@ -4,6 +4,11 @@
- Improved configure detection of number of arguments for getservbyport_r.
Detection is now based on compilation checks instead of linker ones.
- Configure process now checks availability of recvfrom() socket function and
finds out its return type and the types of its arguments. Added definitions
for non-configure systems config files, and introduced macro sreadfrom which
will be used on udp sockets as a recvfrom() wrapper.
* Jul 15 2008 (Yang Tse)
- Introduce definition of _REENTRANT symbol in setup.h to improve library
usability. Previously the configure process only used the AC_SYS_LARGEFILE

View File

@ -23,7 +23,11 @@ CFLAGS += -DWATT32 -DHAVE_AF_INET6 -DHAVE_PF_INET6 -DHAVE_IOCTLSOCKET \
-DRECV_TYPE_ARG1='int' -DRECV_TYPE_ARG2='void*' \
-DRECV_TYPE_ARG3='int' -DRECV_TYPE_ARG4='int' \
-DRECV_TYPE_RETV='int' -DHAVE_STRUCT_TIMEVAL \
-Dselect=select_s -Dsocklen_t=int -UHAVE_CONFIG_H
-Dselect=select_s -Dsocklen_t=int -UHAVE_CONFIG_H \
-DRECVFROM_TYPE_ARG1='int' -DRECVFROM_TYPE_ARG2='void*' \
-DRECVFROM_TYPE_ARG3='int' -DRECVFROM_TYPE_ARG4='int' \
-DRECVFROM_TYPE_ARG6='int*' -DRECVFROM_TYPE_RETV='int' \
-DRECVFROM_TYPE_ARG5='struct sockaddr*' -DHAVE_RECVFROM
LDFLAGS = -s

View File

@ -288,6 +288,13 @@ ifeq ($(LIBARCH),CLIB)
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG2 char *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG3 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG6 int *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_RETV int$(DL) >> $@
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
@ -324,6 +331,13 @@ else
@echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG2 void *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG3 size_t$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG6 int *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_RETV ssize_t$(DL) >> $@
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@
@ -349,6 +363,7 @@ endif
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
@echo $(DL)#define HAVE_RECVFROM 1$(DL) >> $@
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
@echo $(DL)#define HAVE_SEND 1$(DL) >> $@
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@

View File

@ -1049,6 +1049,152 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [
]) # AC_DEFUN
dnl CURL_CHECK_FUNC_RECVFROM
dnl -------------------------------------------------
dnl Test if the socket recvfrom() function is available,
dnl and check its return type and the types of its
dnl arguments. If the function succeeds HAVE_RECVFROM
dnl will be defined, defining the types of the arguments
dnl in RECVFROM_TYPE_ARG1, RECVFROM_TYPE_ARG2, and so on
dnl to RECVFROM_TYPE_ARG6, defining also the type of the
dnl function return value in RECVFROM_TYPE_RETV.
AC_DEFUN([CURL_CHECK_FUNC_RECVFROM], [
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
#
AC_MSG_CHECKING([for recvfrom])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#else
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#endif
#endif
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#endif
]],[[
recvfrom(0, 0, 0, 0, 0, 0);
]])
],[
AC_MSG_RESULT([yes])
curl_cv_recvfrom="yes"
],[
AC_MSG_RESULT([no])
curl_cv_recvfrom="no"
])
#
if test "$curl_cv_recvfrom" = "yes"; then
AC_CACHE_CHECK([types of args and return type for recvfrom],
[curl_cv_func_recvfrom_args], [
curl_cv_func_recvfrom_args="unknown"
for recvfrom_retv in 'int' 'ssize_t'; do
for recvfrom_arg1 in 'int' 'ssize_t' 'SOCKET'; do
for recvfrom_arg2 in 'char *' 'void *'; do
for recvfrom_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
for recvfrom_arg4 in 'int' 'unsigned int'; do
for recvfrom_arg5 in 'struct sockaddr *' 'void *'; do
for recvfrom_arg6 in 'socklen_t *' 'int *' 'unsigned int *' 'size_t *'; do
if test "$curl_cv_func_recvfrom_args" = "unknown"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#else
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#endif
#endif
#define RECVFROMCALLCONV PASCAL
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#define RECVFROMCALLCONV
#endif
extern $recvfrom_retv RECVFROMCALLCONV
recvfrom($recvfrom_arg1, $recvfrom_arg2,
$recvfrom_arg3, $recvfrom_arg4,
$recvfrom_arg5, $recvfrom_arg6);
]],[[
$recvfrom_arg1 s=0;
$recvfrom_arg2 buf=0;
$recvfrom_arg3 len=0;
$recvfrom_arg4 flags=0;
$recvfrom_arg5 addr=0;
$recvfrom_arg6 addrlen=0;
$recvfrom_retv res=0;
res = recvfrom(s, buf, len, flags, addr, addrlen);
]])
],[
curl_cv_func_recvfrom_args="$recvfrom_arg1,$recvfrom_arg2,$recvfrom_arg3,$recvfrom_arg4,$recvfrom_arg5,$recvfrom_arg6,$recvfrom_retv"
])
fi
done
done
done
done
done
done
done
]) # AC_CACHE_CHECK
if test "$curl_cv_func_recvfrom_args" = "unknown"; then
AC_MSG_ERROR([Cannot find proper types to use for recvfrom args])
else
recvfrom_prev_IFS=$IFS; IFS=','
set dummy `echo "$curl_cv_func_recvfrom_args" | sed 's/\*/\*/g'`
IFS=$recvfrom_prev_IFS
shift
#
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG1, $[1],
[Define to the type of arg 1 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2, $[2],
[Define to the type of arg 2 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG3, $[3],
[Define to the type of arg 3 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG4, $[4],
[Define to the type of arg 4 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5, $[5],
[Define to the type of arg 5 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6, $[6],
[Define to the type of arg 6 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_RETV, $[7],
[Define to the function return type for recvfrom.])
#
AC_DEFINE_UNQUOTED(HAVE_RECVFROM, 1,
[Define to 1 if you have the recvfrom function.])
ac_cv_func_recvfrom="yes"
fi
else
AC_MSG_ERROR([Unable to link function recvfrom])
fi
]) # AC_DEFUN
dnl CURL_CHECK_MSG_NOSIGNAL
dnl -------------------------------------------------
dnl Check for MSG_NOSIGNAL

View File

@ -97,6 +97,30 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
/* Define if you have the recvfrom function. */
#define HAVE_RECVFROM 1
/* Define to the type of arg 1 for recvfrom. */
#define RECVFROM_TYPE_ARG1 SOCKET
/* Define to the type of arg 2 for recvfrom. */
#define RECVFROM_TYPE_ARG2 char *
/* Define to the type of arg 3 for recvfrom. */
#define RECVFROM_TYPE_ARG3 int
/* Define to the type of arg 4 for recvfrom. */
#define RECVFROM_TYPE_ARG4 int
/* Define to the type of arg 5 for recvfrom. */
#define RECVFROM_TYPE_ARG5 struct sockaddr *
/* Define to the type of arg 6 for recvfrom. */
#define RECVFROM_TYPE_ARG6 int *
/* Define to the function return type for recvfrom. */
#define RECVFROM_TYPE_RETV int
/* Define if you have the send function. */
#define HAVE_SEND 1

View File

@ -623,9 +623,8 @@ TYPE_SIG_ATOMIC_T
AC_TYPE_SIGNAL
CURL_CHECK_FUNC_RECV
CURL_CHECK_FUNC_RECVFROM
CURL_CHECK_FUNC_SEND
CURL_CHECK_MSG_NOSIGNAL
dnl check for AF_INET6

View File

@ -3,7 +3,7 @@
/* $Id$ */
/* Copyright (C) 2004 - 2007 by Daniel Stenberg et al
/* Copyright (C) 2004 - 2008 by Daniel Stenberg et al
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
@ -191,6 +191,37 @@ struct timeval {
#endif /* HAVE_SEND */
#if defined(HAVE_RECVFROM)
/*
* Currently recvfrom is only used on udp sockets.
*/
#if !defined(RECVFROM_TYPE_ARG1) || \
!defined(RECVFROM_TYPE_ARG2) || \
!defined(RECVFROM_TYPE_ARG3) || \
!defined(RECVFROM_TYPE_ARG4) || \
!defined(RECVFROM_TYPE_ARG5) || \
!defined(RECVFROM_TYPE_ARG6) || \
!defined(RECVFROM_TYPE_RETV)
/* */
Error Missing_definition_of_return_and_arguments_types_of_recvfrom
/* */
#else
#define sreadfrom(s,b,bl,f,fl) (ssize_t)recvfrom((RECVFROM_TYPE_ARG1)(s), \
(RECVFROM_TYPE_ARG2)(b), \
(RECVFROM_TYPE_ARG3)(bl), \
(RECVFROM_TYPE_ARG4)(0), \
(RECVFROM_TYPE_ARG5)(f), \
(RECVFROM_TYPE_ARG6)(fl))
#endif
#else /* HAVE_RECVFROM */
#ifndef sreadfrom
/* */
Error Missing_definition_of_macro_sreadfrom
/* */
#endif
#endif /* HAVE_RECVFROM */
/*
* Uppercase macro versions of ANSI/ISO is*() functions/macros which
* avoid negative number inputs with argument byte codes > 127.

View File

@ -2068,9 +2068,8 @@ AC_TYPE_SIGNAL
CURL_CHECK_FUNC_SELECT
CURL_CHECK_FUNC_RECV
CURL_CHECK_FUNC_RECVFROM
CURL_CHECK_FUNC_SEND
CURL_CHECK_MSG_NOSIGNAL
dnl Checks for library functions.

View File

@ -382,6 +382,13 @@ ifeq ($(LIBARCH),CLIB)
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG2 char *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG3 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG6 int *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_RETV int$(DL) >> $@
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
@ -414,6 +421,13 @@ else
@echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG2 void *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG3 size_t$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG6 int *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_RETV ssize_t$(DL) >> $@
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@
@ -441,6 +455,7 @@ endif
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
@echo $(DL)#define HAVE_RECVFROM 1$(DL) >> $@
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
@echo $(DL)#define HAVE_SEND 1$(DL) >> $@
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -131,6 +131,15 @@
#define RECV_TYPE_ARG4 long
#define RECV_TYPE_RETV long
#define HAVE_RECVFROM 1
#define RECVFROM_TYPE_ARG1 long
#define RECVFROM_TYPE_ARG2 char *
#define RECVFROM_TYPE_ARG3 long
#define RECVFROM_TYPE_ARG4 long
#define RECVFROM_TYPE_ARG5 struct sockaddr *
#define RECVFROM_TYPE_ARG6 long *
#define RECVFROM_TYPE_RETV long
#define HAVE_SEND 1
#define SEND_TYPE_ARG1 int
#define SEND_QUAL_ARG2 const

View File

@ -63,6 +63,15 @@
#define RECV_TYPE_ARG4 int
#define RECV_TYPE_RETV ssize_t
#define HAVE_RECVFROM 1
#define RECVFROM_TYPE_ARG1 int
#define RECVFROM_TYPE_ARG2 void *
#define RECVFROM_TYPE_ARG3 size_t
#define RECVFROM_TYPE_ARG4 int
#define RECVFROM_TYPE_ARG5 struct sockaddr *
#define RECVFROM_TYPE_ARG6 int *
#define RECVFROM_TYPE_RETV ssize_t
#define HAVE_SEND 1
#define SEND_TYPE_ARG1 int
#define SEND_QUAL_ARG2 const

View File

@ -456,6 +456,30 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
/* Define if you have the recvfrom function. */
#define HAVE_RECVFROM
/* Define to the type of arg 1 for recvfrom. */
#define RECVFROM_TYPE_ARG1 int
/* Define to the type of arg 2 for recvfrom. */
#define RECVFROM_TYPE_ARG2 char *
/* Define to the type of arg 3 for recvfrom. */
#define RECVFROM_TYPE_ARG3 int
/* Define to the type of arg 4 for recvfrom. */
#define RECVFROM_TYPE_ARG4 int
/* Define to the type of arg 5 for recvfrom. */
#define RECVFROM_TYPE_ARG5 struct sockaddr *
/* Define to the type of arg 6 for recvfrom. */
#define RECVFROM_TYPE_ARG6 int *
/* Define to the function return type for recvfrom. */
#define RECVFROM_TYPE_RETV int
/* Define if you have the send function. */
#define HAVE_SEND

View File

@ -430,6 +430,30 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV ssize_t
/* Define 1 if you have the recvfrom function. */
#define HAVE_RECVFROM 1
/* Define to the type of arg 1 for recvfrom. */
#define RECVFROM_TYPE_ARG1 int
/* Define to the type of arg 2 for recvfrom. */
#define RECVFROM_TYPE_ARG2 void *
/* Define to the type of arg 3 for recvfrom. */
#define RECVFROM_TYPE_ARG3 size_t
/* Define to the type of arg 4 for recvfrom. */
#define RECVFROM_TYPE_ARG4 int
/* Define to the type of arg 5 for recvfrom. */
#define RECVFROM_TYPE_ARG5 struct sockaddr *
/* Define to the type of arg 6 for recvfrom. */
#define RECVFROM_TYPE_ARG6 int *
/* Define to the function return type for recvfrom. */
#define RECVFROM_TYPE_RETV ssize_t
/* Define if you have the send function. */
#define HAVE_SEND 1

View File

@ -415,6 +415,9 @@
/* Define to 1 if you have the recv function. */
#define HAVE_RECV 1
/* Define to 1 if you have the recvfrom function. */
#define HAVE_RECVFROM 1
/* Define to 1 if you have the <rsa.h> header file. */
/* #undef HAVE_RSA_H */
@ -680,6 +683,14 @@
#define RECV_TYPE_ARG4 int
#define RECV_TYPE_RETV ssize_t
#define RECVFROM_TYPE_ARG1 int
#define RECVFROM_TYPE_ARG2 void*
#define RECVFROM_TYPE_ARG3 size_t
#define RECVFROM_TYPE_ARG4 int
#define RECVFROM_TYPE_ARG5 struct sockaddr *
#define RECVFROM_TYPE_ARG6 size_t *
#define RECVFROM_TYPE_RETV ssize_t
#define SEND_TYPE_ARG1 int
#define SEND_QUAL_ARG2 const
#define SEND_TYPE_ARG2 void*

View File

@ -702,6 +702,30 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
/* Define to 1 if you have the recvfrom function. */
#define HAVE_RECVFROM 1
/* Define to the type of arg 1 for recvfrom. */
#define RECVFROM_TYPE_ARG1 int
/* Define to the type of arg 2 for recvfrom. */
#define RECVFROM_TYPE_ARG2 char *
/* Define to the type of arg 3 for recvfrom. */
#define RECVFROM_TYPE_ARG3 int
/* Define to the type of arg 4 for recvfrom. */
#define RECVFROM_TYPE_ARG4 int
/* Define to the type of arg 5 for recvfrom. */
#define RECVFROM_TYPE_ARG5 struct sockaddr *
/* Define to the type of arg 6 for recvfrom. */
#define RECVFROM_TYPE_ARG6 int *
/* Define to the function return type for recvfrom. */
#define RECVFROM_TYPE_RETV int
/* Define to 1 if you have the send function. */
#define HAVE_SEND 1

View File

@ -248,6 +248,30 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
/* Define if you have the recvfrom function. */
#define HAVE_RECVFROM 1
/* Define to the type of arg 1 for recvfrom. */
#define RECVFROM_TYPE_ARG1 SOCKET
/* Define to the type of arg 2 for recvfrom. */
#define RECVFROM_TYPE_ARG2 char *
/* Define to the type of arg 3 for recvfrom. */
#define RECVFROM_TYPE_ARG3 int
/* Define to the type of arg 4 for recvfrom. */
#define RECVFROM_TYPE_ARG4 int
/* Define to the type of arg 5 for recvfrom. */
#define RECVFROM_TYPE_ARG5 struct sockaddr *
/* Define to the type of arg 6 for recvfrom. */
#define RECVFROM_TYPE_ARG6 int *
/* Define to the function return type for recvfrom. */
#define RECVFROM_TYPE_RETV int
/* Define if you have the send function. */
#define HAVE_SEND 1

View File

@ -234,6 +234,30 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
/* Define if you have the recvfrom function. */
#define HAVE_RECVFROM 1
/* Define to the type of arg 1 for recvfrom. */
#define RECVFROM_TYPE_ARG1 SOCKET
/* Define to the type of arg 2 for recvfrom. */
#define RECVFROM_TYPE_ARG2 char *
/* Define to the type of arg 3 for recvfrom. */
#define RECVFROM_TYPE_ARG3 int
/* Define to the type of arg 4 for recvfrom. */
#define RECVFROM_TYPE_ARG4 int
/* Define to the type of arg 5 for recvfrom. */
#define RECVFROM_TYPE_ARG5 struct sockaddr *
/* Define to the type of arg 6 for recvfrom. */
#define RECVFROM_TYPE_ARG6 int *
/* Define to the function return type for recvfrom. */
#define RECVFROM_TYPE_RETV int
/* Define if you have the send function. */
#define HAVE_SEND 1

View File

@ -35,6 +35,7 @@
#define HAVE_NET_IF_H 1
#define HAVE_PROCESS_H 1
#define HAVE_RECV 1
#define HAVE_RECVFROM 1
#define HAVE_SELECT 1
#define HAVE_SEND 1
#define HAVE_SETJMP_H 1
@ -63,8 +64,8 @@
#define STDC_HEADERS 1
#define TIME_WITH_SYS_TIME 1
/* Qualifiers for send() and recv().
*/
/* Qualifiers for send(), recv() and recv(). */
#define SEND_TYPE_ARG1 int
#define SEND_QUAL_ARG2 const
#define SEND_TYPE_ARG2 void *
@ -78,6 +79,13 @@
#define RECV_TYPE_ARG4 int
#define RECV_TYPE_RETV int
#define RECVFROM_TYPE_ARG1 int
#define RECVFROM_TYPE_ARG2 void *
#define RECVFROM_TYPE_ARG3 int
#define RECVFROM_TYPE_ARG4 int
#define RECVFROM_TYPE_ARG5 struct sockaddr *
#define RECVFROM_TYPE_ARG6 int *
#define RECVFROM_TYPE_RETV int
#define BSD

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -198,6 +198,37 @@ struct timeval {
#endif /* HAVE_SEND */
#if defined(HAVE_RECVFROM)
/*
* Currently recvfrom is only used on udp sockets.
*/
#if !defined(RECVFROM_TYPE_ARG1) || \
!defined(RECVFROM_TYPE_ARG2) || \
!defined(RECVFROM_TYPE_ARG3) || \
!defined(RECVFROM_TYPE_ARG4) || \
!defined(RECVFROM_TYPE_ARG5) || \
!defined(RECVFROM_TYPE_ARG6) || \
!defined(RECVFROM_TYPE_RETV)
/* */
Error Missing_definition_of_return_and_arguments_types_of_recvfrom
/* */
#else
#define sreadfrom(s,b,bl,f,fl) (ssize_t)recvfrom((RECVFROM_TYPE_ARG1)(s), \
(RECVFROM_TYPE_ARG2)(b), \
(RECVFROM_TYPE_ARG3)(bl), \
(RECVFROM_TYPE_ARG4)(0), \
(RECVFROM_TYPE_ARG5)(f), \
(RECVFROM_TYPE_ARG6)(fl))
#endif
#else /* HAVE_RECVFROM */
#ifndef sreadfrom
/* */
Error Missing_definition_of_macro_sreadfrom
/* */
#endif
#endif /* HAVE_RECVFROM */
/*
* Uppercase macro versions of ANSI/ISO is*() functions/macros which
* avoid negative number inputs with argument byte codes > 127.

View File

@ -315,6 +315,30 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
/* Define if you have the recvfrom function. */
#define HAVE_RECVFROM 1
/* Define to the type of arg 1 for recvfrom. */
#define RECVFROM_TYPE_ARG1 int
/* Define to the type of arg 2 for recvfrom. */
#define RECVFROM_TYPE_ARG2 void *
/* Define to the type of arg 3 for recvfrom. */
#define RECVFROM_TYPE_ARG3 int
/* Define to the type of arg 4 for recvfrom. */
#define RECVFROM_TYPE_ARG4 int
/* Define to the type of arg 5 for recvfrom. */
#define RECVFROM_TYPE_ARG5 struct sockaddr *
/* Define to the type of arg 6 for recvfrom. */
#define RECVFROM_TYPE_ARG6 int *
/* Define to the function return type for recvfrom. */
#define RECVFROM_TYPE_RETV int
/* Define if you have the send function. */
#define HAVE_SEND 1

View File

@ -369,6 +369,13 @@ ifeq ($(LIBARCH),CLIB)
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG2 char *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG3 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG6 int *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_RETV int$(DL) >> $@
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
@ -397,6 +404,13 @@ else
@echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG2 void *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG3 size_t$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG6 int *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_RETV ssize_t$(DL) >> $@
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@
@ -421,6 +435,7 @@ endif
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
@echo $(DL)#define HAVE_RECVFROM 1$(DL) >> $@
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
@echo $(DL)#define HAVE_SEND 1$(DL) >> $@
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@

View File

@ -110,6 +110,30 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
/* Define if you have the recvfrom function. */
#define HAVE_RECVFROM 1
/* Define to the type of arg 1 for recvfrom. */
#define RECVFROM_TYPE_ARG1 SOCKET
/* Define to the type of arg 2 for recvfrom. */
#define RECVFROM_TYPE_ARG2 char *
/* Define to the type of arg 3 for recvfrom. */
#define RECVFROM_TYPE_ARG3 int
/* Define to the type of arg 4 for recvfrom. */
#define RECVFROM_TYPE_ARG4 int
/* Define to the type of arg 5 for recvfrom. */
#define RECVFROM_TYPE_ARG5 struct sockaddr *
/* Define to the type of arg 6 for recvfrom. */
#define RECVFROM_TYPE_ARG6 int *
/* Define to the function return type for recvfrom. */
#define RECVFROM_TYPE_RETV int
/* Define if you have the send function. */
#define HAVE_SEND 1