Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
BIND
Commits
194b6a25
Commit
194b6a25
authored
Aug 28, 1999
by
Michael Graff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make sendmsg() and recvmsg() work on solaris and hpux through nasty methods
parent
2dcb05b6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
51 deletions
+87
-51
acconfig.h
acconfig.h
+9
-1
config.h.in
config.h.in
+9
-1
configure
configure
+43
-31
configure.in
configure.in
+9
-3
lib/isc/unix/socket.c
lib/isc/unix/socket.c
+17
-15
No files found.
acconfig.h
View file @
194b6a25
...
...
@@ -33,5 +33,13 @@
/* define if catgets() is available */
#undef HAVE_CATGETS
/*
D
efine if you have the NET_RT_IFLIST sysctl variable. */
/*
d
efine if you have the NET_RT_IFLIST sysctl variable. */
#undef HAVE_IFLIST_SYSCTL
/* define if you need to #define _XPG4_2 before including sys/socket.h */
#undef NEED_XPG4_2_BEFORE_SOCKET_H
/* define if you need to #define _XOPEN_SOURCE_ENTENDED before including
* sys/socket.h
*/
#undef NEED_XSE_BEFORE_SOCKET_H
config.h.in
View file @
194b6a25
...
...
@@ -33,9 +33,17 @@
/* define if catgets() is available */
#undef HAVE_CATGETS
/*
D
efine if you have the NET_RT_IFLIST sysctl variable. */
/*
d
efine if you have the NET_RT_IFLIST sysctl variable. */
#undef HAVE_IFLIST_SYSCTL
/* define if you need to #define _XPG4_2 before including sys/socket.h */
#undef NEED_XPG4_2_BEFORE_SOCKET_H
/* define if you need to #define _XOPEN_SOURCE_ENTENDED before including
* sys/socket.h
*/
#undef NEED_XSE_BEFORE_SOCKET_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
...
...
configure
View file @
194b6a25
#! /bin/sh
# From configure.in Revision: 1.
49
# From configure.in Revision: 1.
50
...
...
@@ -2056,8 +2056,20 @@ fi
case
"
$host
"
in
*
-dec-osf
*
)
cat
>>
confdefs.h
<<
\
EOF
cat
>>
confdefs.h
<<
\
EOF
#define _SOCKADDR_LEN 1
EOF
;;
*
-sun-solaris
*
)
cat
>>
confdefs.h
<<
\
EOF
#define NEED_XPG4_2_BEFORE_SOCKET_H 1
EOF
;;
*
-hp-hpux
*
)
cat
>>
confdefs.h
<<
\
EOF
#define NEED_XSE_BEFORE_SOCKET_H 1
EOF
;;
...
...
@@ -2065,9 +2077,9 @@ esac
echo
$ac_n
"checking for sa_len in struct sockaddr""...
$ac_c
"
1>&6
echo
"configure:20
69
: checking for sa_len in struct sockaddr"
>
&5
echo
"configure:20
81
: checking for sa_len in struct sockaddr"
>
&5
cat
>
conftest.
$ac_ext
<<
EOF
#line 20
71
"configure"
#line 20
83
"configure"
#include "confdefs.h"
#include <sys/types.h>
...
...
@@ -2076,7 +2088,7 @@ int main() {
struct sockaddr sa; sa.sa_len = 0; return (0);
; return 0; }
EOF
if
{
(
eval echo
configure:20
80
:
\"
$ac_compile
\"
)
1>&5
;
(
eval
$ac_compile
)
2>&5
;
}
;
then
if
{
(
eval echo
configure:20
92
:
\"
$ac_compile
\"
)
1>&5
;
(
eval
$ac_compile
)
2>&5
;
}
;
then
rm
-rf
conftest
*
echo
"
$ac_t
""yes"
1>&6
ISC_NET_HAVESALEN
=
"#define ISC_NET_HAVESALEN 1"
...
...
@@ -2092,9 +2104,9 @@ rm -f conftest*
echo
$ac_n
"checking for interface list sysctl""...
$ac_c
"
1>&6
echo
"configure:2
096
: checking for interface list sysctl"
>
&5
echo
"configure:2
108
: checking for interface list sysctl"
>
&5
cat
>
conftest.
$ac_ext
<<
EOF
#line 2
098
"configure"
#line 2
110
"configure"
#include "confdefs.h"
#include <sys/param.h>
...
...
@@ -2201,7 +2213,7 @@ else
fi
echo
$ac_n
"checking build system type""...
$ac_c
"
1>&6
echo
"configure:22
05
: checking build system type"
>
&5
echo
"configure:22
17
: checking build system type"
>
&5
build_alias
=
$build
case
"
$build_alias
"
in
...
...
@@ -2230,7 +2242,7 @@ ac_prog=ld
if
test
"
$ac_cv_prog_gcc
"
=
yes
;
then
# Check if gcc -print-prog-name=ld gives a path.
echo
$ac_n
"checking for ld used by GCC""...
$ac_c
"
1>&6
echo
"configure:22
3
4: checking for ld used by GCC"
>
&5
echo
"configure:224
6
: checking for ld used by GCC"
>
&5
ac_prog
=
`
(
$CC
-print-prog-name
=
ld
)
2>&5
`
case
"
$ac_prog
"
in
# Accept absolute paths.
...
...
@@ -2254,10 +2266,10 @@ echo "configure:2234: checking for ld used by GCC" >&5
esac
elif
test
"
$with_gnu_ld
"
=
yes
;
then
echo
$ac_n
"checking for GNU ld""...
$ac_c
"
1>&6
echo
"configure:22
58
: checking for GNU ld"
>
&5
echo
"configure:22
70
: checking for GNU ld"
>
&5
else
echo
$ac_n
"checking for non-GNU ld""...
$ac_c
"
1>&6
echo
"configure:22
61
: checking for non-GNU ld"
>
&5
echo
"configure:22
73
: checking for non-GNU ld"
>
&5
fi
if
eval
"test
\"
`
echo
'$''{'
ac_cv_path_LD
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
...
...
@@ -2293,7 +2305,7 @@ fi
test
-z
"
$LD
"
&&
{
echo
"configure: error: no acceptable ld found in
\$
PATH"
1>&2
;
exit
1
;
}
echo
$ac_n
"checking if the linker (
$LD
) is GNU ld""...
$ac_c
"
1>&6
echo
"configure:2
297
: checking if the linker (
$LD
) is GNU ld"
>
&5
echo
"configure:2
309
: checking if the linker (
$LD
) is GNU ld"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_prog_gnu_ld
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
...
...
@@ -2309,7 +2321,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
echo
$ac_n
"checking for BSD-compatible nm""...
$ac_c
"
1>&6
echo
"configure:23
13
: checking for BSD-compatible nm"
>
&5
echo
"configure:23
25
: checking for BSD-compatible nm"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_path_NM
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
...
...
@@ -2346,7 +2358,7 @@ echo "$ac_t""$NM" 1>&6
echo
$ac_n
"checking whether ln -s works""...
$ac_c
"
1>&6
echo
"configure:23
50
: checking whether ln -s works"
>
&5
echo
"configure:23
62
: checking whether ln -s works"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_prog_LN_S
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
...
...
@@ -2390,8 +2402,8 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
case
"
$host
"
in
*
-
*
-irix6
*
)
# Find out which ABI we are using.
echo
'#line 2
394
"configure"'
>
conftest.
$ac_ext
if
{
(
eval echo
configure:2
395
:
\"
$ac_compile
\"
)
1>&5
;
(
eval
$ac_compile
)
2>&5
;
}
;
then
echo
'#line 2
406
"configure"'
>
conftest.
$ac_ext
if
{
(
eval echo
configure:2
407
:
\"
$ac_compile
\"
)
1>&5
;
(
eval
$ac_compile
)
2>&5
;
}
;
then
case
"
`
/usr/bin/file conftest.o
`
"
in
*
32-bit
*
)
LD
=
"
${
LD
-ld
}
-32"
...
...
@@ -2412,19 +2424,19 @@ case "$host" in
SAVE_CFLAGS
=
"
$CFLAGS
"
CFLAGS
=
"
$CFLAGS
-belf"
echo
$ac_n
"checking whether the C compiler needs -belf""...
$ac_c
"
1>&6
echo
"configure:24
16
: checking whether the C compiler needs -belf"
>
&5
echo
"configure:24
28
: checking whether the C compiler needs -belf"
>
&5
if
eval
"test
\"
`
echo
'$''{'
lt_cv_cc_needs_belf
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 24
21
"configure"
#line 24
33
"configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if
{
(
eval echo
configure:24
28
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
if
{
(
eval echo
configure:24
40
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
rm
-rf
conftest
*
lt_cv_cc_needs_belf
=
yes
else
...
...
@@ -2539,9 +2551,9 @@ esac
echo
$ac_n
"checking for IPv6 structures""...
$ac_c
"
1>&6
echo
"configure:25
43
: checking for IPv6 structures"
>
&5
echo
"configure:25
55
: checking for IPv6 structures"
>
&5
cat
>
conftest.
$ac_ext
<<
EOF
#line 25
4
5 "configure"
#line 255
7
"configure"
#include "confdefs.h"
#include <sys/types.h>
...
...
@@ -2551,7 +2563,7 @@ int main() {
struct sockaddr_in6 sin6; return (0);
; return 0; }
EOF
if
{
(
eval echo
configure:25
55
:
\"
$ac_compile
\"
)
1>&5
;
(
eval
$ac_compile
)
2>&5
;
}
;
then
if
{
(
eval echo
configure:25
67
:
\"
$ac_compile
\"
)
1>&5
;
(
eval
$ac_compile
)
2>&5
;
}
;
then
rm
-rf
conftest
*
echo
"
$ac_t
""yes"
1>&6
ISC_NET_HAVEIPV6
=
"#define ISC_NET_HAVEIPV6 1"
...
...
@@ -2574,12 +2586,12 @@ rm -f conftest*
echo
$ac_n
"checking for inet_ntop""...
$ac_c
"
1>&6
echo
"configure:25
78
: checking for inet_ntop"
>
&5
echo
"configure:25
90
: checking for inet_ntop"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_func_inet_ntop
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 25
83
"configure"
#line 25
95
"configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char inet_ntop(); below. */
...
...
@@ -2602,7 +2614,7 @@ inet_ntop();
; return 0; }
EOF
if
{
(
eval echo
configure:26
06
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
if
{
(
eval echo
configure:26
18
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
rm
-rf
conftest
*
eval
"ac_cv_func_inet_ntop=yes"
else
...
...
@@ -2626,12 +2638,12 @@ ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
fi
echo
$ac_n
"checking for inet_pton""...
$ac_c
"
1>&6
echo
"configure:26
30
: checking for inet_pton"
>
&5
echo
"configure:26
42
: checking for inet_pton"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_func_inet_pton
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 26
35
"configure"
#line 26
47
"configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char inet_pton(); below. */
...
...
@@ -2654,7 +2666,7 @@ inet_pton();
; return 0; }
EOF
if
{
(
eval echo
configure:26
58
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
if
{
(
eval echo
configure:26
70
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
rm
-rf
conftest
*
eval
"ac_cv_func_inet_pton=yes"
else
...
...
@@ -2678,12 +2690,12 @@ ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
fi
echo
$ac_n
"checking for inet_aton""...
$ac_c
"
1>&6
echo
"configure:26
82
: checking for inet_aton"
>
&5
echo
"configure:26
94
: checking for inet_aton"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_func_inet_aton
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 26
87
"configure"
#line 26
99
"configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char inet_aton(); below. */
...
...
@@ -2706,7 +2718,7 @@ inet_aton();
; return 0; }
EOF
if
{
(
eval echo
configure:27
10
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
if
{
(
eval echo
configure:27
22
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
rm
-rf
conftest
*
eval
"ac_cv_func_inet_aton=yes"
else
...
...
configure.in
View file @
194b6a25
...
...
@@ -13,7 +13,7 @@ dnl PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dnl ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
dnl SOFTWARE.
AC_REVISION($Revision: 1.5
0
$)
AC_REVISION($Revision: 1.5
1
$)
AC_PREREQ(2.13)
...
...
@@ -239,10 +239,16 @@ dnl
case "$host" in
*-dec-osf*)
dnl Turn on 4.4BSD style sa_len support.
dnl (Disabled for now because it is incompatible
dnl with the use of send() and recv()).
AC_DEFINE(_SOCKADDR_LEN)
;;
*-sun-solaris*)
dnl Solaris has yet another trick to get 4.4BSD behavior
AC_DEFINE(NEED_XPG4_2_BEFORE_SOCKET_H)
;;
*-hp-hpux*)
dnl And HP has to be different, too.
AC_DEFINE(NEED_XSE_BEFORE_SOCKET_H)
;;
esac
dnl
...
...
lib/isc/unix/socket.c
View file @
194b6a25
...
...
@@ -19,6 +19,17 @@
#include <sys/types.h>
#include <sys/uio.h>
#if defined(NEED_XPG4_2_BEFORE_SOCKET_H) && !defined(_XPG4_2)
#define _XPG4_2
#include <sys/socket.h>
#undef _XPG4_2
#elif defined(NEED_XSE_BEFORE_SOCKET_H) && !defined(_XOPEN_SOURCE_EXTENDED)
#define _XOPEN_SOURCE_EXTENDED
#include <sys/socket.h>
#define _XOPEN_SOURCE_EXTENDED
#else
#include <sys/socket.h>
#endif
#include <errno.h>
#include <stddef.h>
...
...
@@ -39,19 +50,10 @@
/*
* Some systems define the socket length argument as an int, some as size_t,
* some as socklen_t. This is here
,
so it can be easily changed if needed.
* some as socklen_t. This is here so it can be easily changed if needed.
*/
#ifndef ISC_SOCKADDR_LEN_T
#define ISC_SOCKADDR_LEN_T int
#endif
/*
* As above, one system (solaris) wants the pointers passed into recv() and
* the other network functions to be char *. All the others seem to use
* void *. Cast everything to char * for now.
*/
#ifndef ISC_SOCKDATA_CAST
#define ISC_SOCKDATA_CAST(x) ((char *)(x))
#define ISC_SOCKADDR_LEN_T unsigned int
#endif
/*
...
...
@@ -496,7 +498,7 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
#ifdef SO_TIMESTAMP
if
(
type
==
isc_sockettype_udp
&&
setsockopt
(
sock
->
fd
,
SOL_SOCKET
,
SO_TIMESTAMP
,
ISC_SOCKDATA_CAST
(
&
on
)
,
sizeof
on
)
<
0
)
{
(
void
*
)
&
on
,
sizeof
on
)
<
0
)
{
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
"setsockopt(%d) failed"
,
sock
->
fd
);
/* Press on... */
...
...
@@ -782,7 +784,7 @@ internal_accept(isc_task_t *me, isc_event_t *ev)
* again.
*/
addrlen
=
sizeof
dev
->
newsocket
->
address
.
type
;
fd
=
accept
(
sock
->
fd
,
&
dev
->
newsocket
->
address
.
type
.
sa
,
&
addrlen
);
fd
=
accept
(
sock
->
fd
,
&
dev
->
newsocket
->
address
.
type
.
sa
,
(
void
*
)
&
addrlen
);
dev
->
newsocket
->
address
.
length
=
addrlen
;
if
(
fd
<
0
)
{
if
(
SOFT_ERROR
(
errno
))
{
...
...
@@ -1303,7 +1305,7 @@ watcher(void *uap)
* Process reads on internal, control fd.
*/
if
(
FD_ISSET
(
ctlfd
,
&
readfds
))
{
while
(
1
)
{
for
(;;
)
{
msg
=
select_readmsg
(
manager
);
XTRACE
(
TRACE_WATCHER
,
...
...
@@ -1980,7 +1982,7 @@ isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr)
LOCK
(
&
sock
->
lock
);
if
(
setsockopt
(
sock
->
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
ISC_SOCKDATA_CAST
(
&
on
)
,
sizeof
on
)
<
0
)
{
(
void
*
)
&
on
,
sizeof
on
)
<
0
)
{
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
"setsockopt(%d) failed"
,
sock
->
fd
);
/* Press on... */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment