diff options
author | dougb <dougb@FreeBSD.org> | 2005-12-29 04:22:58 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2005-12-29 04:22:58 +0000 |
commit | 13e6e55147add29e8d7701891f70aefeb3d74645 (patch) | |
tree | 570b6e4f35462e81147786cc2f272d28fac7f470 /contrib/bind9/lib/bind | |
parent | 9123af99f7956e2383e5b9c4d39e84bea89915fe (diff) | |
download | FreeBSD-src-13e6e55147add29e8d7701891f70aefeb3d74645.zip FreeBSD-src-13e6e55147add29e8d7701891f70aefeb3d74645.tar.gz |
Vendor import of BIND 9.3.2
Diffstat (limited to 'contrib/bind9/lib/bind')
42 files changed, 1483 insertions, 311 deletions
diff --git a/contrib/bind9/lib/bind/Makefile.in b/contrib/bind9/lib/bind/Makefile.in index 0a2a1a0..5c34c1a 100644 --- a/contrib/bind9/lib/bind/Makefile.in +++ b/contrib/bind9/lib/bind/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2001-2003 Internet Software Consortium. # # Permission to use, copy, modify, and distribute this software for any @@ -13,7 +13,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: Makefile.in,v 1.12.2.5.2.7 2004/12/09 04:07:14 marka Exp $ +# $Id: Makefile.in,v 1.12.2.5.2.9 2005/07/29 00:13:08 marka Exp $ srcdir = @srcdir@ VPATH = @srcdir@ @@ -85,10 +85,11 @@ NAMESEROBJS= nameser/ns_date.@O@ nameser/ns_name.@O@ nameser/ns_netint.@O@ \ nameser/ns_parse.@O@ nameser/ns_print.@O@ nameser/ns_samedomain.@O@ \ nameser/ns_sign.@O@ nameser/ns_ttl.@O@ nameser/ns_verify.@O@ -RESOLVOBJS= resolv/herror.@O@ resolv/res_comp.@O@ resolv/res_data.@O@ \ - resolv/res_debug.@O@ resolv/res_findzonecut.@O@ resolv/res_init.@O@ \ - resolv/res_mkquery.@O@ resolv/res_mkupdate.@O@ resolv/res_query.@O@ \ - resolv/res_send.@O@ resolv/res_sendsigned.@O@ resolv/res_update.@O@ +RESOLVOBJS= resolv/herror.@O@ resolv/mtctxres.@O@ resolv/res_comp.@O@ \ + resolv/res_data.@O@ resolv/res_debug.@O@ resolv/res_findzonecut.@O@ \ + resolv/res_init.@O@ resolv/res_mkquery.@O@ resolv/res_mkupdate.@O@ \ + resolv/res_query.@O@ resolv/res_send.@O@ resolv/res_sendsigned.@O@ \ + resolv/res_update.@O@ SUBDIRS = bsd dst include inet irs isc nameser resolv @PORT_INCLUDE@ diff --git a/contrib/bind9/lib/bind/api b/contrib/bind9/lib/bind/api index acc853b..dcc846e 100644 --- a/contrib/bind9/lib/bind/api +++ b/contrib/bind9/lib/bind/api @@ -1,3 +1,3 @@ -LIBINTERFACE = 3 -LIBREVISION = 8 +LIBINTERFACE = 4 +LIBREVISION = 2 LIBAGE = 0 diff --git a/contrib/bind9/lib/bind/config.h.in b/contrib/bind9/lib/bind/config.h.in index 6c86b4d..82a1560 100644 --- a/contrib/bind9/lib/bind/config.h.in +++ b/contrib/bind9/lib/bind/config.h.in @@ -1,6 +1,8 @@ #undef _SOCKADDR_LEN #undef HAVE_FCNTL_H #undef HAVE_PATHS_H +#undef HAVE_INTTYPES_H +#undef HAVE_STROPTS_H #undef HAVE_SYS_TIMERS_H #undef SYS_CDEFS_H #undef _POSIX_PTHREAD_SEMANTICS @@ -35,6 +37,8 @@ #undef HAS_PW_CLASS +#undef uintptr_t + /* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */ #undef SHUTUP_SPUTAUX #ifdef SHUTUP_SPUTAUX diff --git a/contrib/bind9/lib/bind/configure b/contrib/bind9/lib/bind/configure index 1baa91e..8f12621 100755 --- a/contrib/bind9/lib/bind/configure +++ b/contrib/bind9/lib/bind/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.83.2.5.2.10 . +# From configure.in Revision: 1.83.2.5.2.22 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # @@ -464,7 +464,7 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA STD_CINCLUDES STD_CDEFINES STD_CWARNINGS CCOPT AR ARFLAGS LN ETAGS PERL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP ISC_PLATFORM_NEEDSYSSELECTH WANT_IRS_GR WANT_IRS_GR_OBJS WANT_IRS_PW WANT_IRS_PW_OBJS WANT_IRS_NIS WANT_IRS_NIS_OBJS WANT_IRS_NISGR_OBJS WANT_IRS_NISPW_OBJS WANT_IRS_DBPW_OBJS ALWAYS_DEFINES DO_PTHREADS WANT_IRS_THREADSGR_OBJS WANT_IRS_THREADSPW_OBJS WANT_IRS_THREADS_OBJS WANT_THREADS_OBJS USE_IFNAMELINKID ISC_THREAD_DIR DAEMON_OBJS NEED_DAEMON STRSEP_OBJS NEED_STRSEP NEED_STRERROR MKDEPCC MKDEPCFLAGS MKDEPPROG IRIX_DNSSEC_WARNINGS_HACK purify_path PURIFY LN_S ECHO ac_ct_AR STRIP ac_ct_STRIP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL O A SA LIBTOOL_MKDEP_SED LIBTOOL_MODE_COMPILE LIBTOOL_MODE_INSTALL LIBTOOL_MODE_LINK HAS_INET6_STRUCTS ISC_PLATFORM_NEEDNETINETIN6H ISC_PLATFORM_NEEDNETINET6IN6H HAS_IN_ADDR6 NEED_IN6ADDR_ANY ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_FIXIN6ISADDR ISC_IPV6_H ISC_IPV6_O ISC_ISCIPV6_O ISC_IPV6_C HAVE_SIN6_SCOPE_ID HAVE_SOCKADDR_STORAGE ISC_PLATFORM_NEEDNTOP ISC_PLATFORM_NEEDPTON ISC_PLATFORM_NEEDATON HAVE_SA_LEN HAVE_MINIMUM_IFREQ BSD_COMP SOLARIS_BITTYPES USE_FIONBIO_IOCTL PORT_DIR PORT_INCLUDE ISC_PLATFORM_MSGHDRFLAVOR ISC_PLATFORM_NEEDPORTT ISC_LWRES_ENDHOSTENTINT ISC_LWRES_SETNETENTINT ISC_LWRES_ENDNETENTINT ISC_LWRES_GETHOSTBYADDRVOID ISC_LWRES_NEEDHERRNO ISC_LWRES_GETIPNODEPROTO ISC_LWRES_GETADDRINFOPROTO ISC_LWRES_GETNAMEINFOPROTO NEED_PSELECT NEED_GETTIMEOFDAY HAVE_STRNDUP ISC_PLATFORM_NEEDSTRSEP ISC_PLATFORM_NEEDVSNPRINTF ISC_EXTRA_OBJS ISC_EXTRA_SRCS USE_SYSERROR_LIST ISC_PLATFORM_QUADFORMAT ISC_SOCKLEN_T GETGROUPLIST_ARGS NET_R_ARGS NET_R_BAD NET_R_COPY NET_R_COPY_ARGS NET_R_OK NET_R_SETANSWER NET_R_RETURN GETNETBYADDR_ADDR_T NETENT_DATA NET_R_ENT_ARGS NET_R_SET_RESULT NET_R_SET_RETURN NET_R_END_RESULT NET_R_END_RETURN GROUP_R_ARGS GROUP_R_BAD GROUP_R_OK GROUP_R_RETURN GROUP_R_END_RESULT GROUP_R_END_RETURN GROUP_R_ENT_ARGS GROUP_R_SET_RESULT GROUP_R_SET_RETURN HOST_R_ARGS HOST_R_BAD HOST_R_COPY HOST_R_COPY_ARGS HOST_R_ERRNO HOST_R_OK HOST_R_RETURN HOST_R_SETANSWER HOSTENT_DATA HOST_R_END_RESULT HOST_R_END_RETURN HOST_R_ENT_ARGS HOST_R_SET_RESULT HOST_R_SET_RETURN SETPWENT_VOID SETGRENT_VOID NGR_R_ARGS NGR_R_BAD NGR_R_COPY NGR_R_COPY_ARGS NGR_R_OK NGR_R_RETURN NGR_R_PRIVATE NGR_R_END_RESULT NGR_R_END_RETURN NGR_R_ENT_ARGS NGR_R_SET_RESULT NGR_R_SET_RETURN PROTO_R_ARGS PROTO_R_BAD PROTO_R_COPY PROTO_R_COPY_ARGS PROTO_R_OK PROTO_R_SETANSWER PROTO_R_RETURN PROTO_R_END_RESULT PROTO_R_END_RETURN PROTO_R_ENT_ARGS PROTO_R_SET_RESULT PROTO_R_SET_RETURN PASS_R_ARGS PASS_R_BAD PASS_R_COPY PASS_R_COPY_ARGS PASS_R_OK PASS_R_RETURN PASS_R_END_RESULT PASS_R_END_RETURN PASS_R_ENT_ARGS PASS_R_SET_RESULT PASS_R_SET_RETURN SERV_R_ARGS SERV_R_BAD SERV_R_COPY SERV_R_COPY_ARGS SERV_R_OK SERV_R_SETANSWER SERV_R_RETURN SERV_R_END_RESULT SERV_R_END_RETURN SERV_R_ENT_ARGS SERV_R_SET_RESULT SERV_R_SET_RETURN SETNETGRENT_ARGS INNETGR_ARGS BIND9_TOP_BUILDDIR BIND9_VERSION LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA STD_CINCLUDES STD_CDEFINES STD_CWARNINGS CCOPT AR ARFLAGS LN ETAGS PERL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP ISC_PLATFORM_NEEDSYSSELECTH WANT_IRS_GR WANT_IRS_GR_OBJS WANT_IRS_PW WANT_IRS_PW_OBJS WANT_IRS_NIS WANT_IRS_NIS_OBJS WANT_IRS_NISGR_OBJS WANT_IRS_NISPW_OBJS WANT_IRS_DBPW_OBJS ALWAYS_DEFINES DO_PTHREADS WANT_IRS_THREADSGR_OBJS WANT_IRS_THREADSPW_OBJS WANT_IRS_THREADS_OBJS WANT_THREADS_OBJS USE_IFNAMELINKID ISC_THREAD_DIR DAEMON_OBJS NEED_DAEMON STRSEP_OBJS NEED_STRSEP NEED_STRERROR MKDEPCC MKDEPCFLAGS MKDEPPROG IRIX_DNSSEC_WARNINGS_HACK purify_path PURIFY LN_S ECHO ac_ct_AR STRIP ac_ct_STRIP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL O A SA LIBTOOL_MKDEP_SED LIBTOOL_MODE_COMPILE LIBTOOL_MODE_INSTALL LIBTOOL_MODE_LINK HAS_INET6_STRUCTS ISC_PLATFORM_NEEDNETINETIN6H ISC_PLATFORM_NEEDNETINET6IN6H HAS_IN_ADDR6 NEED_IN6ADDR_ANY ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_FIXIN6ISADDR ISC_IPV6_H ISC_IPV6_O ISC_ISCIPV6_O ISC_IPV6_C HAVE_SIN6_SCOPE_ID HAVE_SOCKADDR_STORAGE ISC_PLATFORM_NEEDNTOP ISC_PLATFORM_NEEDPTON ISC_PLATFORM_NEEDATON HAVE_SA_LEN HAVE_MINIMUM_IFREQ BSD_COMP SOLARIS_BITTYPES USE_FIONBIO_IOCTL PORT_NONBLOCK PORT_DIR USE_POLL HAVE_MD5 SOLARIS2 PORT_INCLUDE ISC_PLATFORM_MSGHDRFLAVOR ISC_PLATFORM_NEEDPORTT ISC_LWRES_ENDHOSTENTINT ISC_LWRES_SETNETENTINT ISC_LWRES_ENDNETENTINT ISC_LWRES_GETHOSTBYADDRVOID ISC_LWRES_NEEDHERRNO ISC_LWRES_GETIPNODEPROTO ISC_LWRES_GETADDRINFOPROTO ISC_LWRES_GETNAMEINFOPROTO NEED_PSELECT NEED_GETTIMEOFDAY HAVE_STRNDUP ISC_PLATFORM_NEEDSTRSEP ISC_PLATFORM_NEEDVSNPRINTF ISC_EXTRA_OBJS ISC_EXTRA_SRCS USE_SYSERROR_LIST ISC_PLATFORM_QUADFORMAT ISC_SOCKLEN_T GETGROUPLIST_ARGS NET_R_ARGS NET_R_BAD NET_R_COPY NET_R_COPY_ARGS NET_R_OK NET_R_SETANSWER NET_R_RETURN GETNETBYADDR_ADDR_T NETENT_DATA NET_R_ENT_ARGS NET_R_SET_RESULT NET_R_SET_RETURN NET_R_END_RESULT NET_R_END_RETURN GROUP_R_ARGS GROUP_R_BAD GROUP_R_OK GROUP_R_RETURN GROUP_R_END_RESULT GROUP_R_END_RETURN GROUP_R_ENT_ARGS GROUP_R_SET_RESULT GROUP_R_SET_RETURN HOST_R_ARGS HOST_R_BAD HOST_R_COPY HOST_R_COPY_ARGS HOST_R_ERRNO HOST_R_OK HOST_R_RETURN HOST_R_SETANSWER HOSTENT_DATA HOST_R_END_RESULT HOST_R_END_RETURN HOST_R_ENT_ARGS HOST_R_SET_RESULT HOST_R_SET_RETURN SETPWENT_VOID SETGRENT_VOID NGR_R_ARGS NGR_R_BAD NGR_R_COPY NGR_R_COPY_ARGS NGR_R_OK NGR_R_RETURN NGR_R_PRIVATE NGR_R_END_RESULT NGR_R_END_RETURN NGR_R_ENT_ARGS NGR_R_SET_RESULT NGR_R_SET_RETURN PROTO_R_ARGS PROTO_R_BAD PROTO_R_COPY PROTO_R_COPY_ARGS PROTO_R_OK PROTO_R_SETANSWER PROTO_R_RETURN PROTO_R_END_RESULT PROTO_R_END_RETURN PROTO_R_ENT_ARGS PROTO_R_SET_RESULT PROTO_R_SET_RETURN PASS_R_ARGS PASS_R_BAD PASS_R_COPY PASS_R_COPY_ARGS PASS_R_OK PASS_R_RETURN PASS_R_END_RESULT PASS_R_END_RETURN PASS_R_ENT_ARGS PASS_R_SET_RESULT PASS_R_SET_RETURN SERV_R_ARGS SERV_R_BAD SERV_R_COPY SERV_R_COPY_ARGS SERV_R_OK SERV_R_SETANSWER SERV_R_RETURN SERV_R_END_RESULT SERV_R_END_RETURN SERV_R_ENT_ARGS SERV_R_SET_RESULT SERV_R_SET_RETURN SETNETGRENT_ARGS INNETGR_ARGS BIND9_TOP_BUILDDIR BIND9_VERSION LIBOBJS LTLIBOBJS' ac_subst_files='BIND9_INCLUDES BIND9_MAKE_RULES LIBBIND_API' # Initialize some variables set by options. @@ -1019,7 +1019,7 @@ if test -n "$ac_init_help"; then Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-threads disable multithreading + --enable-threads enable multithreading --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] @@ -3472,7 +3472,8 @@ done -for ac_header in fcntl.h db.h paths.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/timers.h + +for ac_header in fcntl.h db.h paths.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/timers.h stropts.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -3622,7 +3623,6 @@ fi done - echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then @@ -3867,6 +3867,72 @@ _ACEOF fi +echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((uintptr_t *) 0) + return 0; +if (sizeof (uintptr_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uintptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uintptr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 +if test $ac_cv_type_uintptr_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define uintptr_t unsigned long +_ACEOF + +fi + echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then @@ -4435,24 +4501,81 @@ esac # # First, decide whether to use multithreading or not. # -echo "$as_me:$LINENO: checking whether to look for thread support" >&5 -echo $ECHO_N "checking whether to look for thread support... $ECHO_C" >&6 +# Enable multithreading by default on systems where it is known +# to work well, and where debugging of multithreaded programs +# is supported. +# + +echo "$as_me:$LINENO: checking whether to build with thread support" >&5 +echo $ECHO_N "checking whether to build with thread support... $ECHO_C" >&6 + +case $host in +*-dec-osf*) + use_threads=true ;; +*-solaris2.[0-6]) + # Thread signals are broken on Solaris 2.6; they are sometimes + # delivered to the wrong thread. + use_threads=false ;; +*-solaris*) + use_threads=true ;; +*-ibm-aix*) + use_threads=true ;; +*-hp-hpux10*) + use_threads=false ;; +*-hp-hpux11*) + use_threads=true ;; +*-sgi-irix*) + use_threads=true ;; +*-sco-sysv*uw*|*-*-sysv*UnixWare*) + # UnixWare + use_threads=false ;; +*-*-sysv*OpenUNIX*) + # UnixWare + use_threads=true ;; +*-netbsd*) + if test -r /usr/lib/libpthread.so ; then + use_threads=true + else + # Socket I/O optimizations introduced in 9.2 expose a + # bug in unproven-pthreads; see PR #12650 + use_threads=false + fi + ;; +*-openbsd*) + # OpenBSD users have reported that named dumps core on + # startup when built with threads. + use_threads=false ;; +*-freebsd*) + use_threads=false ;; +*-bsdi234*) + # Thread signals do not work reliably on some versions of BSD/OS. + use_threads=false ;; +*-bsdi5*) + use_threads=true ;; +*-linux*) + # Threads are disabled on Linux by default because most + # Linux kernels produce unusable core dumps from multithreaded + # programs, and because of limitations in setuid(). + use_threads=false ;; +*) + use_threads=false ;; +esac + # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" fi; case "$enable_threads" in - yes|'') - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + yes) use_threads=true ;; no) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 use_threads=false ;; + '') + # Use system-dependent default + ;; *) { { echo "$as_me:$LINENO: error: --enable-threads takes yes or no" >&5 echo "$as_me: error: --enable-threads takes yes or no" >&2;} @@ -4462,6 +4585,15 @@ esac if $use_threads then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if $use_threads +then # # Search for / configure pthreads in a system-dependent fashion. # @@ -4497,23 +4629,32 @@ echo "${ECHO_T}PTL2" >&6 echo "$as_me: WARNING: linking with PTL2 is highly experimental and not expected to work" >&2;} CC=ptlgcc else - if test ! -d $LOCALBASE/pthreads + if test -r /usr/lib/libpthread.so then - echo "$as_me:$LINENO: result: none" >&5 + echo "$as_me:$LINENO: result: native" >&5 +echo "${ECHO_T}native" >&6 + LIBS="-lpthread $LIBS" + else + if test ! -d $LOCALBASE/pthreads + then + echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 - use_threads=false - fi + { { echo "$as_me:$LINENO: error: \"could not find thread libraries\"" >&5 +echo "$as_me: error: \"could not find thread libraries\"" >&2;} + { (exit 1); exit 1; }; } + fi - if $use_threads - then - echo "$as_me:$LINENO: result: mit-pthreads/unproven-pthreads" >&5 + if $use_threads + then + echo "$as_me:$LINENO: result: mit-pthreads/unproven-pthreads" >&5 echo "${ECHO_T}mit-pthreads/unproven-pthreads" >&6 - pkg="$LOCALBASE/pthreads" - lib1="-L$pkg/lib -Wl,-R$pkg/lib" - lib2="-lpthread -lm -lgcc -lpthread" - LIBS="$lib1 $lib2 $LIBS" - CPPFLAGS="$CPPFLAGS -I$pkg/include" - STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include" + pkg="$LOCALBASE/pthreads" + lib1="-L$pkg/lib -Wl,-R$pkg/lib" + lib2="-lpthread -lm -lgcc -lpthread" + LIBS="$lib1 $lib2 $LIBS" + CPPFLAGS="$CPPFLAGS -I$pkg/include" + STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include" + fi fi fi ;; @@ -4883,7 +5024,9 @@ _ACEOF LIBS="-lc $LIBS" else - use_threads=false + { { echo "$as_me:$LINENO: error: \"could not find thread libraries\"" >&5 +echo "$as_me: error: \"could not find thread libraries\"" >&2;} + { (exit 1); exit 1; }; } fi fi @@ -5444,6 +5587,10 @@ _ACEOF ;; *hpux11*) cat >>confdefs.h <<\_ACEOF +#define NEED_ENDNETGRENT_R 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF #define _PTHREADS_DRAFT4 1 _ACEOF @@ -5597,11 +5744,20 @@ fi ;; esac fi + cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + ALWAYS_DEFINES="-D_REENTRANT" DO_PTHREADS="#define DO_PTHREADS 1" WANT_IRS_THREADSGR_OBJS="\${WANT_IRS_THREADSGR_OBJS}" WANT_IRS_THREADSPW_OBJS="\${WANT_IRS_THREADSPW_OBJS}" - WANT_IRS_THREADS_OBJS="\${WANT_IRS_THREADS_OBJS}" + case $host in + ia64-hp-hpux11.*) + WANT_IRS_THREADS_OBJS="";; + *) + WANT_IRS_THREADS_OBJS="\${WANT_IRS_THREADS_OBJS}";; + esac WANT_THREADS_OBJS="\${WANT_THREADS_OBJS}" thread_dir=pthreads else @@ -5614,6 +5770,13 @@ else thread_dir=nothreads fi + + + + + + + echo "$as_me:$LINENO: checking for strlcat" >&5 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6 if test "${ac_cv_func_strlcat+set}" = set; then @@ -5712,13 +5875,6 @@ _ACEOF fi - - - - - - - echo "$as_me:$LINENO: checking for if_nametoindex" >&5 echo $ECHO_N "checking for if_nametoindex... $ECHO_C" >&6 if test "${ac_cv_func_if_nametoindex+set}" = set; then @@ -6267,7 +6423,7 @@ else ;; *) # Turn off the pointlessly noisy warnings. - STD_CWARNINGS="+w1 +W 474,530" + STD_CWARNINGS="+w1 +W 474,530,2193,2236" ;; esac CCOPT="$CCOPT -Ae -z" @@ -6424,6 +6580,156 @@ fi case "$host" in mips-sgi-irix*) ;; + ia64-hp-hpux11.*) + +echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 +echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_socket+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char socket (); +int +main () +{ +socket (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_socket_socket=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_socket_socket=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 +if test $ac_cv_lib_socket_socket = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSOCKET 1 +_ACEOF + + LIBS="-lsocket $LIBS" + +fi + + +echo "$as_me:$LINENO: checking for inet_ntoa in -lnsl" >&5 +echo $ECHO_N "checking for inet_ntoa in -lnsl... $ECHO_C" >&6 +if test "${ac_cv_lib_nsl_inet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inet_ntoa (); +int +main () +{ +inet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_nsl_inet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_nsl_inet_ntoa=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_inet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_inet_ntoa" >&6 +if test $ac_cv_lib_nsl_inet_ntoa = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNSL 1 +_ACEOF + + LIBS="-lnsl $LIBS" + +fi + + ;; *) echo "$as_me:$LINENO: checking for gethostbyname_r in -ld4r" >&5 @@ -7296,7 +7602,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 7299 "configure"' > conftest.$ac_ext + echo '#line 7605 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8293,7 +8599,7 @@ fi # Provide some information about the compiler. -echo "$as_me:8296:" \ +echo "$as_me:8602:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 @@ -9354,11 +9660,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9357: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9663: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9361: \$? = $ac_status" >&5 + echo "$as_me:9667: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -9597,11 +9903,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9600: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9906: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9604: \$? = $ac_status" >&5 + echo "$as_me:9910: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -9657,11 +9963,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9660: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9966: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9664: \$? = $ac_status" >&5 + echo "$as_me:9970: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11842,7 +12148,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 11845 "configure" +#line 12151 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11940,7 +12246,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 11943 "configure" +#line 12249 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14137,11 +14443,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14140: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14446: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14144: \$? = $ac_status" >&5 + echo "$as_me:14450: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -14197,11 +14503,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14200: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14506: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14204: \$? = $ac_status" >&5 + echo "$as_me:14510: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15558,7 +15864,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 15561 "configure" +#line 15867 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15656,7 +15962,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 15659 "configure" +#line 15965 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16493,11 +16799,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16496: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16802: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16500: \$? = $ac_status" >&5 + echo "$as_me:16806: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16553,11 +16859,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16556: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16862: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16560: \$? = $ac_status" >&5 + echo "$as_me:16866: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18592,11 +18898,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18595: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18901: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18599: \$? = $ac_status" >&5 + echo "$as_me:18905: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -18835,11 +19141,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18838: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19144: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18842: \$? = $ac_status" >&5 + echo "$as_me:19148: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -18895,11 +19201,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18898: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19204: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18902: \$? = $ac_status" >&5 + echo "$as_me:19208: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -21080,7 +21386,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 21083 "configure" +#line 21389 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -21178,7 +21484,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 21181 "configure" +#line 21487 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -23007,6 +23313,10 @@ PORT_DIR=port/unknown SOLARIS_BITTYPES="#undef NEED_SOLARIS_BITTYPES" BSD_COMP="#undef BSD_COMP" USE_FIONBIO_IOCTL="#undef USE_FIONBIO_IOCTL" +PORT_NONBLOCK="#define PORT_NONBLOCK O_NONBLOCK" +HAVE_MD5="#undef HAVE_MD5" +USE_POLL="#undef HAVE_POLL" +SOLARIS2="#undef SOLARIS2" case "$host" in *aix3.2*) PORT_DIR="port/aix32";; *aix4*) PORT_DIR="port/aix4";; @@ -23014,7 +23324,9 @@ case "$host" in *aux3*) PORT_DIR="port/aux3";; *-bsdi2*) PORT_DIR="port/bsdos2";; *-bsdi*) PORT_DIR="port/bsdos";; - *-cygwin*) PORT_DIR="port/cygwin";; + *-cygwin*) + PORT_NONBLOCK="#define PORT_NONBLOCK O_NDELAY" + PORT_DIR="port/cygwin";; *-darwin*) PORT_DIR="port/darwin";; *-osf*) PORT_DIR="port/decunix";; *-freebsd*) PORT_DIR="port/freebsd";; @@ -23030,16 +23342,28 @@ case "$host" in *-openbsd*) PORT_DIR="port/openbsd";; *-qnx*) PORT_DIR="port/qnx";; *-rhapsody*) PORT_DIR="port/rhapsody";; - *-solaris2.[01234]*) + *-sunos4*) + PORT_NONBLOCK="#define PORT_NONBLOCK O_NDELAY" + PORT_DIR="port/sunos";; + *-solaris2.[01234]) BSD_COMP="#define BSD_COMP 1" SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1" USE_FIONBIO_IOCTL="#define USE_FIONBIO_IOCTL 1" + SOLARIS2="#define SOLARIS2 1" PORT_DIR="port/solaris";; - *-solaris2.5*) + *-solaris2.5) BSD_COMP="#define BSD_COMP 1" SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1" + SOLARIS2="#define SOLARIS2 1" + PORT_DIR="port/solaris";; + *-solaris2.[67]) + BSD_COMP="#define BSD_COMP 1" + SOLARIS2="#define SOLARIS2 1" PORT_DIR="port/solaris";; *-solaris2*) BSD_COMP="#define BSD_COMP 1" + USE_POLL="#define USE_POLL 1" + HAVE_MD5="#define HAVE_MD5 1" + SOLARIS2="#define SOLARIS2 1" PORT_DIR="port/solaris";; *-ultrix*) PORT_DIR="port/ultrix";; *-sco-sysv*uw2.0*) PORT_DIR="port/unixware20";; @@ -23050,10 +23374,14 @@ esac -PORT_INCLUDE=${PORT_DIR}/include + + +PORT_INCLUDE=${PORT_DIR}/include + + # # Look for a 4.4BSD or 4.3BSD struct msghdr # @@ -25188,6 +25516,10 @@ _ACEOF fi +case $host in +ia64-hp-hpux11.*) +;; +*) echo "$as_me:$LINENO: checking for getnetbyaddr_r" >&5 echo $ECHO_N "checking for getnetbyaddr_r... $ECHO_C" >&6 if test "${ac_cv_func_getnetbyaddr_r+set}" = set; then @@ -25518,6 +25850,66 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#undef __USE_MISC +#define __USE_MISC +#include <netdb.h> +int getnetbyaddr_r (uint32_t, int, struct netent *, + char *, size_t, struct netent **, int *); + +int +main () +{ +return (0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +NET_R_ARGS="#define NET_R_ARGS char *buf, size_t buflen, struct netent **answerp, int *h_errnop" +NET_R_BAD="#define NET_R_BAD ERANGE" +NET_R_COPY="#define NET_R_COPY buf, buflen" +NET_R_COPY_ARGS="#define NET_R_COPY_ARGS char *buf, size_t buflen" +NET_R_OK="#define NET_R_OK 0" +NET_R_SETANSWER="#define NET_R_SETANSWER 1" +NET_R_RETURN="#define NET_R_RETURN int" +GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T unsigned long int" +NETENT_DATA="#undef NETENT_DATA" + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext @@ -25543,6 +25935,8 @@ NETENT_DATA="#undef NETENT_DATA" fi +esac + case "$host" in *dec-osf*) GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T int" ;; esac @@ -25767,6 +26161,11 @@ fi + +case $host in +ia64-hp-hpux11.*) +;; +*) echo "$as_me:$LINENO: checking for endnetent_r" >&5 echo $ECHO_N "checking for endnetent_r... $ECHO_C" >&6 if test "${ac_cv_func_endnetent_r+set}" = set; then @@ -26029,6 +26428,7 @@ NET_R_END_RETURN="#define NET_R_END_RETURN void" fi +esac @@ -26606,6 +27006,10 @@ fi +case $host in +ia64-hp-hpux11.*) +;; +*) echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname_r+set}" = set; then @@ -26805,7 +27209,7 @@ HOST_R_ARGS="#define HOST_R_ARGS struct hostent_data *hdptr" HOST_R_BAD="#define HOST_R_BAD (-1)" HOST_R_COPY="#define HOST_R_COPY hdptr" HOST_R_COPY_ARGS="#define HOST_R_COPY_ARGS HOST_R_ARGS" -HOST_R_ERRNO="#define HOST_R_ERRNO NULL" +HOST_R_ERRNO="#undef HOST_R_ERRNO" HOST_R_OK="#define HOST_R_OK 0" HOST_R_RETURN="#define HOST_R_RETURN int" HOST_R_SETANSWER="#undef HOST_R_SETANSWER" @@ -26896,6 +27300,7 @@ HOSTENT_DATA="#undef HOSTENT_DATA" fi +esac @@ -26906,6 +27311,10 @@ fi +case $host in +ia64-hp-hpux11.*) +;; +*) echo "$as_me:$LINENO: checking for endhostent_r" >&5 echo $ECHO_N "checking for endhostent_r... $ECHO_C" >&6 if test "${ac_cv_func_endhostent_r+set}" = set; then @@ -27171,10 +27580,15 @@ HOST_R_ENT_ARGS="#undef HOST_R_ENT_ARGS /*empty*/" fi +esac; +case $host in +ia64-hp-hpux11.*) +;; +*) echo "$as_me:$LINENO: checking for sethostent_r" >&5 echo $ECHO_N "checking for sethostent_r... $ECHO_C" >&6 if test "${ac_cv_func_sethostent_r+set}" = set; then @@ -27428,6 +27842,7 @@ HOST_R_SET_RETURN="#define HOST_R_SET_RETURN void" fi +esac @@ -27599,6 +28014,10 @@ fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +case $host in +ia64-hp-hpux11.*) +;; +*) echo "$as_me:$LINENO: checking for getnetgrent_r" >&5 echo $ECHO_N "checking for getnetgrent_r... $ECHO_C" >&6 if test "${ac_cv_func_getnetgrent_r+set}" = set; then @@ -27878,6 +28297,7 @@ NGR_R_RETURN="#define NGR_R_RETURN int" fi +esac @@ -28209,6 +28629,10 @@ _ACEOF fi +case $host in +ia64-hp-hpux11.*) +;; +*) echo "$as_me:$LINENO: checking for getprotoent_r" >&5 echo $ECHO_N "checking for getprotoent_r... $ECHO_C" >&6 if test "${ac_cv_func_getprotoent_r+set}" = set; then @@ -28435,6 +28859,7 @@ PROTO_R_RETURN="#define PROTO_R_RETURN struct protoent *" fi +esac @@ -28443,6 +28868,10 @@ fi +case $host in +ia64-hp-hpux11.*) +;; +*) echo "$as_me:$LINENO: checking for endprotoent_r" >&5 echo $ECHO_N "checking for endprotoent_r... $ECHO_C" >&6 if test "${ac_cv_func_endprotoent_r+set}" = set; then @@ -28599,10 +29028,15 @@ PROTO_R_ENT_ARGS="#undef PROTO_R_ENT_ARGS /*empty*/" fi +esac +case $host in +ia64-hp-hpux11.*) +;; +*) echo "$as_me:$LINENO: checking for setprotoent_r" >&5 echo $ECHO_N "checking for setprotoent_r... $ECHO_C" >&6 if test "${ac_cv_func_setprotoent_r+set}" = set; then @@ -28754,6 +29188,7 @@ PROTO_R_SET_RETURN="#define PROTO_R_SET_RETURN void" fi +esac @@ -29685,6 +30120,10 @@ _ACEOF fi +case $host in +ia64-hp-hpux11.*) +;; +*) echo "$as_me:$LINENO: checking for getservent_r" >&5 echo $ECHO_N "checking for getservent_r... $ECHO_C" >&6 if test "${ac_cv_func_getservent_r+set}" = set; then @@ -29907,6 +30346,7 @@ SERV_R_RETURN="#define SERV_R_RETURN struct servent *" fi +esac @@ -29915,6 +30355,10 @@ fi +case $host in +ia64-hp-hpux11.*) +;; +*) echo "$as_me:$LINENO: checking for endservent_r" >&5 echo $ECHO_N "checking for endservent_r... $ECHO_C" >&6 if test "${ac_cv_func_endservent_r+set}" = set; then @@ -30071,10 +30515,15 @@ SERV_R_ENT_ARGS="#undef SERV_R_ENT_ARGS /*empty*/" fi +esac +case $host in +ia64-hp-hpux11.*) +;; +*) echo "$as_me:$LINENO: checking for setservent_r" >&5 echo $ECHO_N "checking for setservent_r... $ECHO_C" >&6 if test "${ac_cv_func_setservent_r+set}" = set; then @@ -30229,6 +30678,7 @@ SERV_R_SET_RETURN="#define SERV_R_SET_RETURN void" fi +esac @@ -30489,7 +30939,6 @@ case "$host" in hack_shutup_in6addr_init_macros=yes ;; *-solaris2.8) - hack_shutup_pthreadmutexinit=yes hack_shutup_in6addr_init_macros=yes ;; *-solaris2.9) @@ -31304,7 +31753,11 @@ s,@HAVE_MINIMUM_IFREQ@,$HAVE_MINIMUM_IFREQ,;t t s,@BSD_COMP@,$BSD_COMP,;t t s,@SOLARIS_BITTYPES@,$SOLARIS_BITTYPES,;t t s,@USE_FIONBIO_IOCTL@,$USE_FIONBIO_IOCTL,;t t +s,@PORT_NONBLOCK@,$PORT_NONBLOCK,;t t s,@PORT_DIR@,$PORT_DIR,;t t +s,@USE_POLL@,$USE_POLL,;t t +s,@HAVE_MD5@,$HAVE_MD5,;t t +s,@SOLARIS2@,$SOLARIS2,;t t s,@PORT_INCLUDE@,$PORT_INCLUDE,;t t s,@ISC_PLATFORM_MSGHDRFLAVOR@,$ISC_PLATFORM_MSGHDRFLAVOR,;t t s,@ISC_PLATFORM_NEEDPORTT@,$ISC_PLATFORM_NEEDPORTT,;t t diff --git a/contrib/bind9/lib/bind/configure.in b/contrib/bind9/lib/bind/configure.in index 74c1870..50ffe82 100644 --- a/contrib/bind9/lib/bind/configure.in +++ b/contrib/bind9/lib/bind/configure.in @@ -1,4 +1,4 @@ -# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2001 Internet Software Consortium. # # Permission to use, copy, modify, and distribute this software for any @@ -13,7 +13,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -AC_REVISION($Revision: 1.83.2.5.2.10 $) +AC_REVISION($Revision: 1.83.2.5.2.22 $) AC_INIT(resolv/herror.c) AC_PREREQ(2.13) @@ -169,12 +169,12 @@ AC_PROG_CC AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h db.h paths.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/timers.h) - +AC_CHECK_HEADERS(fcntl.h db.h paths.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/timers.h stropts.h) AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T +AC_CHECK_TYPE(uintptr_t,unsigned long) AC_HEADER_TIME # # check if we need to #include sys/select.h explicitly @@ -315,86 +315,7 @@ case "$use_randomdev" in ;; esac -# -# Begin pthreads checking. -# -# First, decide whether to use multithreading or not. -# -AC_MSG_CHECKING(whether to look for thread support) -AC_ARG_ENABLE(threads, - [ --disable-threads disable multithreading]) -case "$enable_threads" in - yes|'') - AC_MSG_RESULT(yes) - use_threads=true - ;; - no) - AC_MSG_RESULT(no) - use_threads=false - ;; - *) - AC_MSG_ERROR([--enable-threads takes yes or no]) - ;; -esac - -if $use_threads -then - # - # Search for / configure pthreads in a system-dependent fashion. - # - case "$host" in - *-netbsd*) - # NetBSD has multiple pthreads implementations. The - # recommended one to use is "unproven-pthreads". The - # older "mit-pthreads" may also work on some NetBSD - # versions. The PTL2 thread library does not - # currently work with bind9, but can be chosen with - # the --with-ptl2 option for those who wish to - # experiment with it. - CC="gcc" - AC_MSG_CHECKING(which NetBSD thread library to use) - - AC_ARG_WITH(ptl2, -[ --with-ptl2 on NetBSD, use the ptl2 thread library (experimental)], - use_ptl2="$withval", use_ptl2="no") - - : ${LOCALBASE:=/usr/pkg} - - if test "X$use_ptl2" = "Xyes" - then - AC_MSG_RESULT(PTL2) - AC_MSG_WARN( -[linking with PTL2 is highly experimental and not expected to work]) - CC=ptlgcc - else - if test ! -d $LOCALBASE/pthreads - then - AC_MSG_RESULT(none) - use_threads=false - fi - - if $use_threads - then - AC_MSG_RESULT(mit-pthreads/unproven-pthreads) - pkg="$LOCALBASE/pthreads" - lib1="-L$pkg/lib -Wl,-R$pkg/lib" - lib2="-lpthread -lm -lgcc -lpthread" - LIBS="$lib1 $lib2 $LIBS" - CPPFLAGS="$CPPFLAGS -I$pkg/include" - STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include" - fi - fi - ;; - *) - AC_CHECK_LIB(pthread, pthread_create,, - AC_CHECK_LIB(pthread, __pthread_create,, - AC_CHECK_LIB(pthread, __pthread_create_system,, - AC_CHECK_LIB(c_r, pthread_create,, - AC_CHECK_LIB(c, pthread_create,, - use_threads=false))))) - ;; - esac -fi +sinclude(../../config.threads.in)dnl if $use_threads then @@ -451,6 +372,7 @@ then AC_DEFINE(POSIX_GETGRNAM_R) ;; *hpux11*) + AC_DEFINE(NEED_ENDNETGRENT_R) AC_DEFINE(_PTHREADS_DRAFT4) ;; # @@ -503,11 +425,17 @@ then ;; esac fi + AC_DEFINE(_REENTRANT) ALWAYS_DEFINES="-D_REENTRANT" DO_PTHREADS="#define DO_PTHREADS 1" WANT_IRS_THREADSGR_OBJS="\${WANT_IRS_THREADSGR_OBJS}" WANT_IRS_THREADSPW_OBJS="\${WANT_IRS_THREADSPW_OBJS}" - WANT_IRS_THREADS_OBJS="\${WANT_IRS_THREADS_OBJS}" + case $host in + ia64-hp-hpux11.*) + WANT_IRS_THREADS_OBJS="";; + *) + WANT_IRS_THREADS_OBJS="\${WANT_IRS_THREADS_OBJS}";; + esac WANT_THREADS_OBJS="\${WANT_THREADS_OBJS}" thread_dir=pthreads else @@ -520,8 +448,6 @@ else thread_dir=nothreads fi -AC_CHECK_FUNC(strlcat, AC_DEFINE(HAVE_STRLCAT)) - AC_SUBST(ALWAYS_DEFINES) AC_SUBST(DO_PTHREADS) AC_SUBST(WANT_IRS_THREADSGR_OBJS) @@ -529,6 +455,8 @@ AC_SUBST(WANT_IRS_THREADSPW_OBJS) AC_SUBST(WANT_IRS_THREADS_OBJS) AC_SUBST(WANT_THREADS_OBJS) +AC_CHECK_FUNC(strlcat, AC_DEFINE(HAVE_STRLCAT)) + AC_CHECK_FUNC(if_nametoindex, [USE_IFNAMELINKID="#define USE_IFNAMELINKID 1"], [USE_IFNAMELINKID="#undef USE_IFNAMELINKID"]) @@ -605,7 +533,7 @@ else ;; *) # Turn off the pointlessly noisy warnings. - STD_CWARNINGS="+w1 +W 474,530" + STD_CWARNINGS="+w1 +W 474,530,2193,2236" ;; esac CCOPT="$CCOPT -Ae -z" @@ -666,6 +594,10 @@ AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),) case "$host" in mips-sgi-irix*) ;; + ia64-hp-hpux11.*) + AC_CHECK_LIB(socket, socket) + AC_CHECK_LIB(nsl, inet_ntoa) + ;; *) AC_CHECK_LIB(d4r, gethostbyname_r) AC_CHECK_LIB(socket, socket) @@ -1075,6 +1007,10 @@ PORT_DIR=port/unknown SOLARIS_BITTYPES="#undef NEED_SOLARIS_BITTYPES" BSD_COMP="#undef BSD_COMP" USE_FIONBIO_IOCTL="#undef USE_FIONBIO_IOCTL" +PORT_NONBLOCK="#define PORT_NONBLOCK O_NONBLOCK" +HAVE_MD5="#undef HAVE_MD5" +USE_POLL="#undef HAVE_POLL" +SOLARIS2="#undef SOLARIS2" case "$host" in *aix3.2*) PORT_DIR="port/aix32";; *aix4*) PORT_DIR="port/aix4";; @@ -1082,7 +1018,9 @@ case "$host" in *aux3*) PORT_DIR="port/aux3";; *-bsdi2*) PORT_DIR="port/bsdos2";; *-bsdi*) PORT_DIR="port/bsdos";; - *-cygwin*) PORT_DIR="port/cygwin";; + *-cygwin*) + PORT_NONBLOCK="#define PORT_NONBLOCK O_NDELAY" + PORT_DIR="port/cygwin";; *-darwin*) PORT_DIR="port/darwin";; *-osf*) PORT_DIR="port/decunix";; *-freebsd*) PORT_DIR="port/freebsd";; @@ -1098,30 +1036,46 @@ case "$host" in *-openbsd*) PORT_DIR="port/openbsd";; *-qnx*) PORT_DIR="port/qnx";; *-rhapsody*) PORT_DIR="port/rhapsody";; - *-solaris2.[[01234]]*) + *-sunos4*) + PORT_NONBLOCK="#define PORT_NONBLOCK O_NDELAY" + PORT_DIR="port/sunos";; + *-solaris2.[[01234]]) BSD_COMP="#define BSD_COMP 1" SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1" USE_FIONBIO_IOCTL="#define USE_FIONBIO_IOCTL 1" + SOLARIS2="#define SOLARIS2 1" PORT_DIR="port/solaris";; - *-solaris2.5*) + *-solaris2.5) BSD_COMP="#define BSD_COMP 1" SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1" + SOLARIS2="#define SOLARIS2 1" + PORT_DIR="port/solaris";; + *-solaris2.[[67]]) + BSD_COMP="#define BSD_COMP 1" + SOLARIS2="#define SOLARIS2 1" PORT_DIR="port/solaris";; *-solaris2*) BSD_COMP="#define BSD_COMP 1" + USE_POLL="#define USE_POLL 1" + HAVE_MD5="#define HAVE_MD5 1" + SOLARIS2="#define SOLARIS2 1" PORT_DIR="port/solaris";; *-ultrix*) PORT_DIR="port/ultrix";; *-sco-sysv*uw2.0*) PORT_DIR="port/unixware20";; *-sco-sysv*uw2.1.2*) PORT_DIR="port/unixware212";; *-sco-sysv*uw7*) PORT_DIR="port/unixware7";; esac + AC_SUBST(BSD_COMP) AC_SUBST(SOLARIS_BITTYPES) AC_SUBST(USE_FIONBIO_IOCTL) +AC_SUBST(PORT_NONBLOCK) AC_SUBST(PORT_DIR) +AC_SUBST(USE_POLL) +AC_SUBST(HAVE_MD5) +AC_SUBST(SOLARIS2) PORT_INCLUDE=${PORT_DIR}/include AC_SUBST(PORT_INCLUDE) - # # Look for a 4.4BSD or 4.3BSD struct msghdr # @@ -1365,6 +1319,10 @@ AC_SUBST(GETGROUPLIST_ARGS) AC_CHECK_FUNC(setgroupent,,AC_DEFINE(NEED_SETGROUPENT)) +case $host in +ia64-hp-hpux11.*) +;; +*) AC_CHECK_FUNC(getnetbyaddr_r, AC_TRY_COMPILE( [ @@ -1453,6 +1411,26 @@ NET_R_RETURN="#define NET_R_RETURN int" GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long" NETENT_DATA="#define NETENT_DATA 1" ], +AC_TRY_COMPILE( +#undef __USE_MISC +#define __USE_MISC +[#include <netdb.h> +int getnetbyaddr_r (uint32_t, int, struct netent *, + char *, size_t, struct netent **, int *); +], +[return (0)], +[ +NET_R_ARGS="#define NET_R_ARGS char *buf, size_t buflen, struct netent **answerp, int *h_errnop" +NET_R_BAD="#define NET_R_BAD ERANGE" +NET_R_COPY="#define NET_R_COPY buf, buflen" +NET_R_COPY_ARGS="#define NET_R_COPY_ARGS char *buf, size_t buflen" +NET_R_OK="#define NET_R_OK 0" +NET_R_SETANSWER="#define NET_R_SETANSWER 1" +NET_R_RETURN="#define NET_R_RETURN int" +GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T unsigned long int" +NETENT_DATA="#undef NETENT_DATA" +], +) ) ) ) @@ -1468,6 +1446,8 @@ NET_R_RETURN="#define NET_R_RETURN struct netent *" GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long" NETENT_DATA="#undef NETENT_DATA" ) +esac + case "$host" in *dec-osf*) GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T int" ;; esac @@ -1516,6 +1496,11 @@ AC_SUBST(NET_R_ENT_ARGS) AC_SUBST(NET_R_SET_RESULT) AC_SUBST(NET_R_SET_RETURN) + +case $host in +ia64-hp-hpux11.*) +;; +*) AC_CHECK_FUNC(endnetent_r, AC_TRY_COMPILE( [ @@ -1560,6 +1545,7 @@ NET_R_END_RETURN="#define NET_R_END_RETURN void" NET_R_END_RESULT="#define NET_R_END_RESULT(x) /*empty*/" NET_R_END_RETURN="#define NET_R_END_RETURN void" ) +esac AC_SUBST(NET_R_END_RESULT) AC_SUBST(NET_R_END_RETURN) @@ -1612,6 +1598,10 @@ AC_SUBST(GROUP_R_SET_RESULT) AC_SUBST(GROUP_R_SET_RETURN) +case $host in +ia64-hp-hpux11.*) +;; +*) AC_CHECK_FUNC(gethostbyname_r, AC_TRY_COMPILE( [ @@ -1646,7 +1636,7 @@ HOST_R_ARGS="#define HOST_R_ARGS struct hostent_data *hdptr" HOST_R_BAD="#define HOST_R_BAD (-1)" HOST_R_COPY="#define HOST_R_COPY hdptr" HOST_R_COPY_ARGS="#define HOST_R_COPY_ARGS HOST_R_ARGS" -HOST_R_ERRNO="#define HOST_R_ERRNO NULL" +HOST_R_ERRNO="#undef HOST_R_ERRNO" HOST_R_OK="#define HOST_R_OK 0" HOST_R_RETURN="#define HOST_R_RETURN int" HOST_R_SETANSWER="#undef HOST_R_SETANSWER" @@ -1684,6 +1674,7 @@ HOST_R_RETURN="#define HOST_R_RETURN struct hostent *" HOST_R_SETANSWER="#undef HOST_R_SETANSWER" HOSTENT_DATA="#undef HOSTENT_DATA" ) +esac AC_SUBST(HOST_R_ARGS) AC_SUBST(HOST_R_BAD) AC_SUBST(HOST_R_COPY) @@ -1694,6 +1685,10 @@ AC_SUBST(HOST_R_RETURN) AC_SUBST(HOST_R_SETANSWER) AC_SUBST(HOSTENT_DATA) +case $host in +ia64-hp-hpux11.*) +;; +*) AC_CHECK_FUNC(endhostent_r, AC_TRY_COMPILE([ #undef _REENTRANT @@ -1739,10 +1734,15 @@ HOST_R_END_RESULT="#define HOST_R_END_RESULT(x) /*empty*/" HOST_R_END_RETURN="#define HOST_R_END_RETURN void" HOST_R_ENT_ARGS="#undef HOST_R_ENT_ARGS /*empty*/" ) +esac; AC_SUBST(HOST_R_END_RESULT) AC_SUBST(HOST_R_END_RETURN) AC_SUBST(HOST_R_ENT_ARGS) +case $host in +ia64-hp-hpux11.*) +;; +*) AC_CHECK_FUNC(sethostent_r, AC_TRY_COMPILE([ #undef _REENTRANT @@ -1778,6 +1778,7 @@ HOST_R_SET_RETURN="#define HOST_R_SET_RETURN void"], HOST_R_SET_RESULT="#undef HOST_R_SET_RESULT" HOST_R_SET_RETURN="#define HOST_R_SET_RETURN void" ) +esac AC_SUBST(HOST_R_SET_RESULT) AC_SUBST(HOST_R_SET_RETURN) @@ -1819,6 +1820,10 @@ SETGRENT_VOID="#undef SETGRENT_VOID" ) AC_SUBST(SETGRENT_VOID) +case $host in +ia64-hp-hpux11.*) +;; +*) AC_CHECK_FUNC(getnetgrent_r, AC_TRY_COMPILE( [ @@ -1886,6 +1891,7 @@ NGR_R_COPY_ARGS="#define NGR_R_COPY_ARGS NGR_R_ARGS" NGR_R_OK="#define NGR_R_OK 1" NGR_R_RETURN="#define NGR_R_RETURN int" ) +esac AC_SUBST(NGR_R_ARGS) AC_SUBST(NGR_R_BAD) AC_SUBST(NGR_R_COPY) @@ -1930,6 +1936,10 @@ AC_SUBST(NGR_R_SET_RETURN) AC_CHECK_FUNC(innetgr_r,,AC_DEFINE(NEED_INNETGR_R)) +case $host in +ia64-hp-hpux11.*) +;; +*) AC_CHECK_FUNC(getprotoent_r, AC_TRY_COMPILE( [ @@ -1984,6 +1994,7 @@ PROTO_R_OK="#define PROTO_R_OK pptr" PROTO_R_SETANSWER="#undef PROTO_R_SETANSWER" PROTO_R_RETURN="#define PROTO_R_RETURN struct protoent *" ) +esac AC_SUBST(PROTO_R_ARGS) AC_SUBST(PROTO_R_BAD) AC_SUBST(PROTO_R_COPY) @@ -1992,6 +2003,10 @@ AC_SUBST(PROTO_R_OK) AC_SUBST(PROTO_R_SETANSWER) AC_SUBST(PROTO_R_RETURN) +case $host in +ia64-hp-hpux11.*) +;; +*) AC_CHECK_FUNC(endprotoent_r, AC_TRY_COMPILE( [ @@ -2015,10 +2030,15 @@ PROTO_R_END_RESULT="#define PROTO_R_END_RESULT(x) /*empty*/" PROTO_R_END_RETURN="#define PROTO_R_END_RETURN void" PROTO_R_ENT_ARGS="#undef PROTO_R_ENT_ARGS /*empty*/" ) +esac AC_SUBST(PROTO_R_END_RESULT) AC_SUBST(PROTO_R_END_RETURN) AC_SUBST(PROTO_R_ENT_ARGS) +case $host in +ia64-hp-hpux11.*) +;; +*) AC_CHECK_FUNC(setprotoent_r, AC_TRY_COMPILE( [ @@ -2037,6 +2057,7 @@ PROTO_R_SET_RETURN="#define PROTO_R_SET_RETURN void" PROTO_R_SET_RESULT="#undef PROTO_R_SET_RESULT" PROTO_R_SET_RETURN="#define PROTO_R_SET_RETURN void" ) +esac AC_SUBST(PROTO_R_SET_RESULT) AC_SUBST(PROTO_R_SET_RETURN) @@ -2126,6 +2147,10 @@ AC_SUBST(PASS_R_SET_RETURN) AC_CHECK_FUNC(getpwnam_r,,AC_DEFINE(NEED_GETPWNAM_R)) AC_CHECK_FUNC(getpwuid_r,,AC_DEFINE(NEED_GETPWUID_R)) +case $host in +ia64-hp-hpux11.*) +;; +*) AC_CHECK_FUNC(getservent_r, AC_TRY_COMPILE([ #undef __USE_MISC @@ -2172,6 +2197,7 @@ SERV_R_OK="#define SERV_R_OK sptr" SERV_R_SETANSWER="#undef SERV_R_SETANSWER" SERV_R_RETURN="#define SERV_R_RETURN struct servent *" ) +esac AC_SUBST(SERV_R_ARGS) AC_SUBST(SERV_R_BAD) AC_SUBST(SERV_R_COPY) @@ -2180,6 +2206,10 @@ AC_SUBST(SERV_R_OK) AC_SUBST(SERV_R_SETANSWER) AC_SUBST(SERV_R_RETURN) +case $host in +ia64-hp-hpux11.*) +;; +*) AC_CHECK_FUNC(endservent_r, AC_TRY_COMPILE( [ @@ -2204,10 +2234,15 @@ SERV_R_END_RESULT="#define SERV_R_END_RESULT(x) /*empty*/" SERV_R_END_RETURN="#define SERV_R_END_RETURN void " SERV_R_ENT_ARGS="#undef SERV_R_ENT_ARGS /*empty*/" ) +esac AC_SUBST(SERV_R_END_RESULT) AC_SUBST(SERV_R_END_RETURN) AC_SUBST(SERV_R_ENT_ARGS) +case $host in +ia64-hp-hpux11.*) +;; +*) AC_CHECK_FUNC(setservent_r, AC_TRY_COMPILE( [ @@ -2229,6 +2264,7 @@ SERV_R_SET_RETURN="#define SERV_R_SET_RETURN void" SERV_R_SET_RESULT="#undef SERV_R_SET_RESULT" SERV_R_SET_RETURN="#define SERV_R_SET_RETURN void" ) +esac AC_SUBST(SERV_R_SET_RESULT) AC_SUBST(SERV_R_SET_RETURN) @@ -2327,7 +2363,6 @@ case "$host" in hack_shutup_in6addr_init_macros=yes ;; *-solaris2.8) - hack_shutup_pthreadmutexinit=yes hack_shutup_in6addr_init_macros=yes ;; *-solaris2.9) diff --git a/contrib/bind9/lib/bind/dst/dst_api.c b/contrib/bind9/lib/bind/dst/dst_api.c index 5f67bd9..51dfd0b 100644 --- a/contrib/bind9/lib/bind/dst/dst_api.c +++ b/contrib/bind9/lib/bind/dst/dst_api.c @@ -1,5 +1,5 @@ #ifndef LINT -static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/dst_api.c,v 1.4.2.6.8.1 2004/09/16 00:57:33 marka Exp $"; +static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/dst_api.c,v 1.4.2.6.8.3 2005/10/11 00:48:14 marka Exp $"; #endif /* @@ -336,7 +336,10 @@ dst_read_key(const char *in_keyname, const u_int16_t in_id, if (in_keyname == NULL) { EREPORT(("dst_read_private_key(): Null key name passed in\n")); return (NULL); - } else + } else if (strlen(in_keyname) >= sizeof(keyname)) { + EREPORT(("dst_read_private_key(): keyname too big\n")); + return (NULL); + } else strcpy(keyname, in_keyname); /* before I read in the public key, check if it is allowed to sign */ @@ -347,7 +350,7 @@ dst_read_key(const char *in_keyname, const u_int16_t in_id, return pubkey; if (!(dg_key = dst_s_get_key_struct(keyname, pubkey->dk_alg, - pubkey->dk_flags, pubkey->dk_proto, + pubkey->dk_flags, pubkey->dk_proto, 0))) return (dg_key); /* Fill in private key and some fields in the general key structure */ @@ -953,7 +956,6 @@ dst_generate_key(const char *name, const int bits, const int exp, const int flags, const int protocol, const int alg) { DST_KEY *new_key = NULL; - int res; int dnslen; u_char dns[2048]; @@ -975,7 +977,7 @@ dst_generate_key(const char *name, const int bits, const int exp, alg)); return (dst_free_key(new_key)); } - if ((res = new_key->dk_func->generate(new_key, exp)) <= 0) { + if (new_key->dk_func->generate(new_key, exp) <= 0) { EREPORT(("dst_generate_key_pair(): Key generation failure %s %d %d %d\n", new_key->dk_key_name, new_key->dk_alg, new_key->dk_key_size, exp)); diff --git a/contrib/bind9/lib/bind/dst/hmac_link.c b/contrib/bind9/lib/bind/dst/hmac_link.c index 8a641d0..aa66c80 100644 --- a/contrib/bind9/lib/bind/dst/hmac_link.c +++ b/contrib/bind9/lib/bind/dst/hmac_link.c @@ -1,6 +1,6 @@ #ifdef HMAC_MD5 #ifndef LINT -static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/hmac_link.c,v 1.2.2.1 2003/06/27 03:51:36 marka Exp $"; +static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/hmac_link.c,v 1.2.2.1.4.1 2005/07/28 07:43:16 marka Exp $"; #endif /* * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc. @@ -36,8 +36,15 @@ static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/hmac_lin #include <resolv.h> #include "dst_internal.h" + #ifdef USE_MD5 -# include "md5.h" +# ifndef HAVE_MD5 +# include "md5.h" +# else +# ifdef SOLARIS2 +# include <sys/md5.h> +# endif +# endif # ifndef _MD5_H_ # define _MD5_H_ 1 /* make sure we do not include rsaref md5.h file */ # endif @@ -438,7 +445,11 @@ dst_hmac_md5_generate_key(DST_KEY *key, const int nothing) * related functions */ int +#ifdef SUNW_LIBMD5 +dst_md5_hmac_init() +#else dst_hmac_md5_init() +#endif { if (dst_t_func[KEY_HMAC_MD5] != NULL) return (1); diff --git a/contrib/bind9/lib/bind/dst/md5.h b/contrib/bind9/lib/bind/dst/md5.h index c886d17..6525662 100644 --- a/contrib/bind9/lib/bind/dst/md5.h +++ b/contrib/bind9/lib/bind/dst/md5.h @@ -59,6 +59,8 @@ #ifndef HEADER_MD5_H #define HEADER_MD5_H +#ifndef HAVE_MD5 + #ifdef __cplusplus extern "C" { #endif @@ -99,3 +101,6 @@ unsigned char *MD5(); #endif #endif +#else +#include <sys/md5.h> +#endif /* HAVE_MD5 */ diff --git a/contrib/bind9/lib/bind/dst/md5_dgst.c b/contrib/bind9/lib/bind/dst/md5_dgst.c index 48c327e..ba0a5a1 100644 --- a/contrib/bind9/lib/bind/dst/md5_dgst.c +++ b/contrib/bind9/lib/bind/dst/md5_dgst.c @@ -58,6 +58,7 @@ #ifdef USE_MD5 /* Added by ogud@tis.com 1998/1/26 */ #include <port_before.h> +#ifndef HAVE_MD5 #include <stdio.h> #include "md5_locl.h" #include <port_after.h> @@ -367,4 +368,5 @@ unsigned long *l; } } #endif +#endif /* HAVE_MD5 */ #endif /* USE_MD5 */ diff --git a/contrib/bind9/lib/bind/dst/support.c b/contrib/bind9/lib/bind/dst/support.c index 7b86ea9..8fe3cdb 100644 --- a/contrib/bind9/lib/bind/dst/support.c +++ b/contrib/bind9/lib/bind/dst/support.c @@ -1,4 +1,4 @@ -static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/support.c,v 1.2.2.1 2001/11/02 22:25:29 gson Exp $"; +static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/support.c,v 1.2.2.1.10.2 2005/10/11 00:48:14 marka Exp $"; /* @@ -103,7 +103,7 @@ dst_s_id_calc(const u_char *key, const int keysize) int size = keysize; if (!key || (keysize <= 0)) - return (-1); + return (0xffffU); for (ac = 0; size > 1; size -= 2, kp += 2) ac += ((*kp) << 8) + *(kp + 1); @@ -311,19 +311,15 @@ dst_s_fopen(const char *filename, const char *mode, int perm) { FILE *fp; char pathname[PATH_MAX]; - size_t plen = sizeof(pathname); + + if (strlen(filename) + strlen(dst_path) >= sizeof(pathname)) + return (NULL); if (*dst_path != '\0') { strcpy(pathname, dst_path); - plen -= strlen(pathname); - } - else - pathname[0] = '\0'; - - if (plen > strlen(filename)) - strncpy(&pathname[PATH_MAX - plen], filename, plen-1); - else - return (NULL); + strcat(pathname, filename); + } else + strcpy(pathname, filename); fp = fopen(pathname, mode); if (perm) diff --git a/contrib/bind9/lib/bind/include/isc/eventlib.h b/contrib/bind9/lib/bind/include/isc/eventlib.h index 6750e4d..033b312 100644 --- a/contrib/bind9/lib/bind/include/isc/eventlib.h +++ b/contrib/bind9/lib/bind/include/isc/eventlib.h @@ -18,7 +18,7 @@ /* eventlib.h - exported interfaces for eventlib * vix 09sep95 [initial] * - * $Id: eventlib.h,v 1.1.2.1.4.1 2004/03/09 08:33:31 marka Exp $ + * $Id: eventlib.h,v 1.1.2.1.4.2 2005/07/28 07:43:18 marka Exp $ */ #ifndef _EVENTLIB_H @@ -76,6 +76,8 @@ typedef struct { unsigned char mask[256/8]; } evByteMask; #define EV_WRITE 2 #define EV_EXCEPT 4 +#define EV_WASNONBLOCKING 8 /* Internal library use. */ + /* eventlib.c */ #define evCreate __evCreate #define evSetDebug __evSetDebug diff --git a/contrib/bind9/lib/bind/include/resolv.h b/contrib/bind9/lib/bind/include/resolv.h index f4f3fa4..87a9520 100644 --- a/contrib/bind9/lib/bind/include/resolv.h +++ b/contrib/bind9/lib/bind/include/resolv.h @@ -50,7 +50,7 @@ /* * @(#)resolv.h 8.1 (Berkeley) 6/2/93 - * $Id: resolv.h,v 1.7.2.11.4.2 2004/06/25 00:41:05 marka Exp $ + * $Id: resolv.h,v 1.7.2.11.4.3 2005/08/25 04:44:13 marka Exp $ */ #ifndef _RESOLV_H_ @@ -291,6 +291,11 @@ extern struct __res_state *__res_state(void); __END_DECLS #define _res (*__res_state()) #else +#ifdef __linux +__BEGIN_DECLS +extern struct __res_state * __res_state(void); +__END_DECLS +#endif #ifndef __BIND_NOSTATIC extern struct __res_state _res; #endif diff --git a/contrib/bind9/lib/bind/include/resolv_mt.h b/contrib/bind9/lib/bind/include/resolv_mt.h new file mode 100644 index 0000000..27963a1 --- /dev/null +++ b/contrib/bind9/lib/bind/include/resolv_mt.h @@ -0,0 +1,47 @@ +#ifndef _RESOLV_MT_H +#define _RESOLV_MT_H + +#include <sys/types.h> +#include <netinet/in.h> +#include <arpa/nameser.h> +#include <resolv.h> + +/* Access functions for the libresolv private interface */ + +int __res_enable_mt(void); +int __res_disable_mt(void); + +/* Per-thread context */ + +typedef struct { +int no_hosts_fallback_private; +int retry_save; +int retry_private; +char inet_nsap_ntoa_tmpbuf[255*3]; +char sym_ntos_unname[20]; +char sym_ntop_unname[20]; +char p_option_nbuf[40]; +char p_time_nbuf[40]; +char precsize_ntoa_retbuf[sizeof "90000000.00"]; +char loc_ntoa_tmpbuf[sizeof +"1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"]; +char p_secstodate_output[15]; +} mtctxres_t; + +/* Thread-specific data (TSD) */ + +mtctxres_t *___mtctxres(void); +#define mtctxres (___mtctxres()) + +/* Various static data that should be TSD */ + +#define sym_ntos_unname (mtctxres->sym_ntos_unname) +#define sym_ntop_unname (mtctxres->sym_ntop_unname) +#define inet_nsap_ntoa_tmpbuf (mtctxres->inet_nsap_ntoa_tmpbuf) +#define p_option_nbuf (mtctxres->p_option_nbuf) +#define p_time_nbuf (mtctxres->p_time_nbuf) +#define precsize_ntoa_retbuf (mtctxres->precsize_ntoa_retbuf) +#define loc_ntoa_tmpbuf (mtctxres->loc_ntoa_tmpbuf) +#define p_secstodate_output (mtctxres->p_secstodate_output) + +#endif /* _RESOLV_MT_H */ diff --git a/contrib/bind9/lib/bind/inet/inet_cidr_ntop.c b/contrib/bind9/lib/bind/inet/inet_cidr_ntop.c index 184ad7c..192cf1e 100644 --- a/contrib/bind9/lib/bind/inet/inet_cidr_ntop.c +++ b/contrib/bind9/lib/bind/inet/inet_cidr_ntop.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.1.2.1.8.2 2004/03/17 00:29:46 marka Exp $"; +static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.1.2.1.8.3 2005/11/03 23:08:40 marka Exp $"; #endif #include "port_before.h" @@ -178,7 +178,9 @@ inet_cidr_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size) { for (i = 0; i < NS_IN6ADDRSZ; i++) words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); best.base = -1; + best.len = 0; cur.base = -1; + cur.len = 0; for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { if (words[i] == 0) { if (cur.base == -1) diff --git a/contrib/bind9/lib/bind/inet/inet_ntop.c b/contrib/bind9/lib/bind/inet/inet_ntop.c index 6141407..cd502ab 100644 --- a/contrib/bind9/lib/bind/inet/inet_ntop.c +++ b/contrib/bind9/lib/bind/inet/inet_ntop.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_ntop.c,v 1.1.2.1.8.1 2004/03/09 08:33:33 marka Exp $"; +static const char rcsid[] = "$Id: inet_ntop.c,v 1.1.2.1.8.2 2005/11/03 23:08:40 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -137,7 +137,9 @@ inet_ntop6(src, dst, size) for (i = 0; i < NS_IN6ADDRSZ; i++) words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); best.base = -1; + best.len = 0; cur.base = -1; + cur.len = 0; for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { if (words[i] == 0) { if (cur.base == -1) diff --git a/contrib/bind9/lib/bind/inet/inet_pton.c b/contrib/bind9/lib/bind/inet/inet_pton.c index c7813f8..f18a7b6 100644 --- a/contrib/bind9/lib/bind/inet/inet_pton.c +++ b/contrib/bind9/lib/bind/inet/inet_pton.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_pton.c,v 1.2.206.1 2004/03/09 08:33:33 marka Exp $"; +static const char rcsid[] = "$Id: inet_pton.c,v 1.2.206.2 2005/07/28 07:43:18 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -141,7 +141,7 @@ inet_pton6(src, dst) xdigits_u[] = "0123456789ABCDEF"; u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; const char *xdigits, *curtok; - int ch, saw_xdigit; + int ch, seen_xdigits; u_int val; memset((tp = tmp), '\0', NS_IN6ADDRSZ); @@ -152,7 +152,7 @@ inet_pton6(src, dst) if (*++src != ':') return (0); curtok = src; - saw_xdigit = 0; + seen_xdigits = 0; val = 0; while ((ch = *src++) != '\0') { const char *pch; @@ -162,14 +162,13 @@ inet_pton6(src, dst) if (pch != NULL) { val <<= 4; val |= (pch - xdigits); - if (val > 0xffff) + if (++seen_xdigits > 4) return (0); - saw_xdigit = 1; continue; } if (ch == ':') { curtok = src; - if (!saw_xdigit) { + if (!seen_xdigits) { if (colonp) return (0); colonp = tp; @@ -181,19 +180,19 @@ inet_pton6(src, dst) return (0); *tp++ = (u_char) (val >> 8) & 0xff; *tp++ = (u_char) val & 0xff; - saw_xdigit = 0; + seen_xdigits = 0; val = 0; continue; } if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && inet_pton4(curtok, tp) > 0) { tp += NS_INADDRSZ; - saw_xdigit = 0; + seen_xdigits = 0; break; /* '\0' was seen by inet_pton4(). */ } return (0); } - if (saw_xdigit) { + if (seen_xdigits) { if (tp + NS_INT16SZ > endp) return (0); *tp++ = (u_char) (val >> 8) & 0xff; diff --git a/contrib/bind9/lib/bind/inet/nsap_addr.c b/contrib/bind9/lib/bind/inet/nsap_addr.c index 0b9108a..a4b98e7 100644 --- a/contrib/bind9/lib/bind/inet/nsap_addr.c +++ b/contrib/bind9/lib/bind/inet/nsap_addr.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: nsap_addr.c,v 1.2.206.1 2004/03/09 08:33:33 marka Exp $"; +static const char rcsid[] = "$Id: nsap_addr.c,v 1.2.206.2 2005/07/28 07:43:18 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -31,6 +31,7 @@ static const char rcsid[] = "$Id: nsap_addr.c,v 1.2.206.1 2004/03/09 08:33:33 ma #include <ctype.h> #include <resolv.h> +#include <resolv_mt.h> #include "port_after.h" @@ -79,7 +80,7 @@ char * inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) { int nib; int i; - static char tmpbuf[2+255*3]; + char *tmpbuf = inet_nsap_ntoa_tmpbuf; char *start; if (ascii) diff --git a/contrib/bind9/lib/bind/irs/dns_ho.c b/contrib/bind9/lib/bind/irs/dns_ho.c index 69b4b4f..e8da61a 100644 --- a/contrib/bind9/lib/bind/irs/dns_ho.c +++ b/contrib/bind9/lib/bind/irs/dns_ho.c @@ -52,7 +52,7 @@ /* BIND Id: gethnamaddr.c,v 8.15 1996/05/22 04:56:30 vixie Exp $ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: dns_ho.c,v 1.5.2.7.4.5 2004/08/24 00:32:15 marka Exp $"; +static const char rcsid[] = "$Id: dns_ho.c,v 1.5.2.7.4.6 2005/10/11 00:48:14 marka Exp $"; #endif /* LIBC_SCCS and not lint */ /* Imports. */ @@ -688,7 +688,7 @@ gethostans(struct irs_ho *this, { struct pvt *pvt = (struct pvt *)this->private; int type, class, ancount, qdcount, n, haveanswer, had_error; - int error = NETDB_SUCCESS, arcount; + int error = NETDB_SUCCESS; int (*name_ok)(const char *); const HEADER *hp; const u_char *eom; @@ -735,7 +735,6 @@ gethostans(struct irs_ho *this, hp = (const HEADER *)ansbuf; ancount = ntohs(hp->ancount); qdcount = ntohs(hp->qdcount); - arcount = ntohs(hp->arcount); bp = pvt->hostbuf; ep = pvt->hostbuf + sizeof(pvt->hostbuf); cp = ansbuf + HFIXEDSZ; diff --git a/contrib/bind9/lib/bind/irs/getaddrinfo.c b/contrib/bind9/lib/bind/irs/getaddrinfo.c index e08cf78..4f741a8 100644 --- a/contrib/bind9/lib/bind/irs/getaddrinfo.c +++ b/contrib/bind9/lib/bind/irs/getaddrinfo.c @@ -244,6 +244,7 @@ do { \ goto free; \ } while (/*CONSTCOND*/0) +#ifndef SOLARIS2 #define ERR(err) \ do { \ /* external reference: error, and label bad */ \ @@ -251,6 +252,16 @@ do { \ goto bad; \ /*NOTREACHED*/ \ } while (/*CONSTCOND*/0) +#else +#define ERR(err) \ +do { \ + /* external reference: error, and label bad */ \ + error = (err); \ + if (error == error) \ + goto bad; \ +} while (/*CONSTCOND*/0) +#endif + #define MATCH_FAMILY(x, y, w) \ ((x) == (y) || (/*CONSTCOND*/(w) && ((x) == PF_UNSPEC || (y) == PF_UNSPEC))) @@ -321,6 +332,15 @@ getaddrinfo(hostname, servname, hints, res) pai->ai_family = PF_UNSPEC; pai->ai_socktype = ANY; pai->ai_protocol = ANY; +#ifdef __sparcv9 + /* + * clear _ai_pad to preserve binary + * compatibility with previously compiled 64-bit + * applications in a pre-SUSv3 environment by + * guaranteeing the upper 32-bits are empty. + */ + pai->_ai_pad = 0; +#endif /* __sparcv9 */ pai->ai_addrlen = 0; pai->ai_canonname = NULL; pai->ai_addr = NULL; @@ -345,6 +365,13 @@ getaddrinfo(hostname, servname, hints, res) } memcpy(pai, hints, sizeof(*pai)); +#ifdef __sparcv9 + /* + * We need to clear _ai_pad to preserve binary + * compatibility. See prior comment. + */ + pai->_ai_pad = 0; +#endif /* * if both socktype/protocol are specified, check if they * are meaningful combination. diff --git a/contrib/bind9/lib/bind/irs/gethostent_r.c b/contrib/bind9/lib/bind/irs/gethostent_r.c index 28f1a7f..8a7cff0 100644 --- a/contrib/bind9/lib/bind/irs/gethostent_r.c +++ b/contrib/bind9/lib/bind/irs/gethostent_r.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: gethostent_r.c,v 1.4.206.3 2004/09/01 02:03:07 marka Exp $"; +static const char rcsid[] = "$Id: gethostent_r.c,v 1.4.206.4 2005/09/03 12:47:38 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include <port_before.h> @@ -44,7 +44,9 @@ gethostbyname_r(const char *name, struct hostent *hptr, HOST_R_ARGS) { int n = 0; #endif +#ifdef HOST_R_ERRNO HOST_R_ERRNO; +#endif #ifdef HOST_R_SETANSWER if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0) @@ -69,7 +71,9 @@ gethostbyaddr_r(const char *addr, int len, int type, int n = 0; #endif +#ifdef HOST_R_ERRNO HOST_R_ERRNO; +#endif #ifdef HOST_R_SETANSWER if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0) @@ -99,7 +103,9 @@ gethostent_r(struct hostent *hptr, HOST_R_ARGS) { int n = 0; #endif +#ifdef HOST_R_ERRNO HOST_R_ERRNO; +#endif #ifdef HOST_R_SETANSWER if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0) @@ -123,6 +129,9 @@ sethostent_r(int stay_open, HOST_R_ENT_ARGS) sethostent_r(int stay_open) #endif { +#ifdef HOST_R_ENT_ARGS + UNUSED(hdptr); +#endif sethostent(stay_open); #ifdef HOST_R_SET_RESULT return (HOST_R_SET_RESULT); @@ -136,6 +145,9 @@ endhostent_r(HOST_R_ENT_ARGS) endhostent_r(void) #endif { +#ifdef HOST_R_ENT_ARGS + UNUSED(hdptr); +#endif endhostent(); HOST_R_END_RESULT(HOST_R_OK); } diff --git a/contrib/bind9/lib/bind/irs/getnetent_r.c b/contrib/bind9/lib/bind/irs/getnetent_r.c index 0b540b0..1f8290d 100644 --- a/contrib/bind9/lib/bind/irs/getnetent_r.c +++ b/contrib/bind9/lib/bind/irs/getnetent_r.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: getnetent_r.c,v 1.3.206.1 2004/03/09 08:33:36 marka Exp $"; +static const char rcsid[] = "$Id: getnetent_r.c,v 1.3.206.2 2005/09/03 12:47:38 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include <port_before.h> @@ -118,6 +118,9 @@ setnetent_r(int stay_open, NET_R_ENT_ARGS) setnetent_r(int stay_open) #endif { +#ifdef NET_R_ENT_ARGS + UNUSED(ndptr); +#endif setnetent(stay_open); #ifdef NET_R_SET_RESULT return (NET_R_SET_RESULT); @@ -131,6 +134,9 @@ endnetent_r(NET_R_ENT_ARGS) endnetent_r() #endif { +#ifdef NET_R_ENT_ARGS + UNUSED(ndptr); +#endif endnetent(); NET_R_END_RESULT(NET_R_OK); } diff --git a/contrib/bind9/lib/bind/irs/getnetgrent_r.c b/contrib/bind9/lib/bind/irs/getnetgrent_r.c index bb78b56..b5d9bb1 100644 --- a/contrib/bind9/lib/bind/irs/getnetgrent_r.c +++ b/contrib/bind9/lib/bind/irs/getnetgrent_r.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: getnetgrent_r.c,v 1.5.2.1.4.3 2004/11/30 01:15:43 marka Exp $"; +static const char rcsid[] = "$Id: getnetgrent_r.c,v 1.5.2.1.4.4 2005/09/03 12:47:38 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include <port_before.h> @@ -77,8 +77,14 @@ setnetgrent_r(const char *netgroup) #endif { char *tmp; +#if defined(NGR_R_ENT_ARGS) && !defined(NGR_R_PRIVATE) + UNUSED(buf); + UNUSED(buflen); +#endif + DE_CONST(netgroup, tmp); setnetgrent(tmp); + #ifdef NGR_R_PRIVATE *buf = NULL; #endif @@ -94,6 +100,11 @@ endnetgrent_r(NGR_R_ENT_ARGS) endnetgrent_r(void) #endif { +#if defined(NGR_R_ENT_ARGS) && !defined(NGR_R_PRIVATE) + UNUSED(buf); + UNUSED(buflen); +#endif + endnetgrent(); #ifdef NGR_R_PRIVATE if (*buf != NULL) diff --git a/contrib/bind9/lib/bind/irs/hesiod.c b/contrib/bind9/lib/bind/irs/hesiod.c index 9b0efeb..618c592 100644 --- a/contrib/bind9/lib/bind/irs/hesiod.c +++ b/contrib/bind9/lib/bind/irs/hesiod.c @@ -1,5 +1,5 @@ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: hesiod.c,v 1.1.2.1.4.3 2004/05/17 07:48:56 marka Exp $"; +static const char rcsid[] = "$Id: hesiod.c,v 1.1.2.1.4.4 2005/07/28 07:43:19 marka Exp $"; #endif /* @@ -83,9 +83,7 @@ hesiod_init(void **context) { return (-1); } - ctx->LHS = NULL; - ctx->RHS = NULL; - ctx->res = NULL; + memset(ctx, 0, sizeof (*ctx)); if (parse_config_file(ctx, _PATH_HESIOD_CONF) < 0) { #ifdef DEF_RHS diff --git a/contrib/bind9/lib/bind/isc/ev_connects.c b/contrib/bind9/lib/bind/isc/ev_connects.c index 043e5f4..4b0dd22 100644 --- a/contrib/bind9/lib/bind/isc/ev_connects.c +++ b/contrib/bind9/lib/bind/isc/ev_connects.c @@ -20,7 +20,7 @@ */ #if !defined(LINT) && !defined(CODECENTER) -static const char rcsid[] = "$Id: ev_connects.c,v 1.4.206.1 2004/03/09 08:33:40 marka Exp $"; +static const char rcsid[] = "$Id: ev_connects.c,v 1.4.206.2 2005/07/08 04:52:54 marka Exp $"; #endif /* Import. */ @@ -168,10 +168,10 @@ evCancelConn(evContext opaqueCtx, evConnID id) { return (-1); } else { #ifdef USE_FIONBIO_IOCTL - int on = 1; - OK(ioctl(this->fd, FIONBIO, (char *)&on)); + int off = 0; + OK(ioctl(this->fd, FIONBIO, (char *)&off)); #else - OK(fcntl(this->fd, F_SETFL, mode | PORT_NONBLOCK)); + OK(fcntl(this->fd, F_SETFL, mode & ~PORT_NONBLOCK)); #endif } } diff --git a/contrib/bind9/lib/bind/isc/ev_files.c b/contrib/bind9/lib/bind/isc/ev_files.c index 4d5eb55..1f95ed0 100644 --- a/contrib/bind9/lib/bind/isc/ev_files.c +++ b/contrib/bind9/lib/bind/isc/ev_files.c @@ -20,7 +20,7 @@ */ #if !defined(LINT) && !defined(CODECENTER) -static const char rcsid[] = "$Id: ev_files.c,v 1.3.2.1.4.1 2004/03/09 08:33:42 marka Exp $"; +static const char rcsid[] = "$Id: ev_files.c,v 1.3.2.1.4.3 2005/07/28 07:43:19 marka Exp $"; #endif #include "port_before.h" @@ -58,8 +58,10 @@ evSelectFD(evContext opaqueCtx, ctx, fd, eventmask, func, uap); if (eventmask == 0 || (eventmask & ~EV_MASK_ALL) != 0) EV_ERR(EINVAL); +#ifndef USE_POLL if (fd > ctx->highestFD) EV_ERR(EINVAL); +#endif OK(mode = fcntl(fd, F_GETFL, NULL)); /* side effect: validate fd. */ /* @@ -68,6 +70,11 @@ evSelectFD(evContext opaqueCtx, * of our deselect()'s have to leave it in O_NONBLOCK. If not, then * all but our last deselect() has to leave it in O_NONBLOCK. */ +#ifdef USE_POLL + /* Make sure both ctx->pollfds[] and ctx->fdTable[] are large enough */ + if (fd >= ctx->maxnfds && evPollfdRealloc(ctx, 1, fd) != 0) + EV_ERR(ENOMEM); +#endif /* USE_POLL */ id = FindFD(ctx, fd, EV_MASK_ALL); if (id == NULL) { if (mode & PORT_NONBLOCK) @@ -143,13 +150,6 @@ evSelectFD(evContext opaqueCtx, if (opaqueID) opaqueID->opaque = id; - evPrintf(ctx, 5, - "evSelectFD(fd %d, mask 0x%x): new masks: 0x%lx 0x%lx 0x%lx\n", - fd, eventmask, - (u_long)ctx->rdNext.fds_bits[0], - (u_long)ctx->wrNext.fds_bits[0], - (u_long)ctx->exNext.fds_bits[0]); - return (0); } @@ -204,7 +204,7 @@ evDeselectFD(evContext opaqueCtx, evFileID opaqueID) { * and (b) the caller didn't ask us anything about O_NONBLOCK. */ #ifdef USE_FIONBIO_IOCTL - int off = 1; + int off = 0; (void) ioctl(del->fd, FIONBIO, (char *)&off); #else (void) fcntl(del->fd, F_SETFL, mode & ~PORT_NONBLOCK); @@ -259,13 +259,6 @@ evDeselectFD(evContext opaqueCtx, evFileID opaqueID) { if (del == ctx->fdNext) ctx->fdNext = del->next; - evPrintf(ctx, 5, - "evDeselectFD(fd %d, mask 0x%x): new masks: 0x%lx 0x%lx 0x%lx\n", - del->fd, eventmask, - (u_long)ctx->rdNext.fds_bits[0], - (u_long)ctx->wrNext.fds_bits[0], - (u_long)ctx->exNext.fds_bits[0]); - /* Couldn't free it before now since we were using fields out of it. */ FREE(del); diff --git a/contrib/bind9/lib/bind/isc/eventlib.c b/contrib/bind9/lib/bind/isc/eventlib.c index 06d791e..77b1414 100644 --- a/contrib/bind9/lib/bind/isc/eventlib.c +++ b/contrib/bind9/lib/bind/isc/eventlib.c @@ -20,7 +20,7 @@ */ #if !defined(LINT) && !defined(CODECENTER) -static const char rcsid[] = "$Id: eventlib.c,v 1.2.2.1.4.4 2004/12/09 04:07:15 marka Exp $"; +static const char rcsid[] = "$Id: eventlib.c,v 1.2.2.1.4.5 2005/07/28 07:43:20 marka Exp $"; #endif #include "port_before.h" @@ -29,6 +29,9 @@ static const char rcsid[] = "$Id: eventlib.c,v 1.2.2.1.4.4 2004/12/09 04:07:15 m #include <sys/types.h> #include <sys/time.h> #include <sys/stat.h> +#ifdef SOLARIS2 +#include <limits.h> +#endif /* SOLARIS2 */ #include <errno.h> #include <signal.h> @@ -44,9 +47,13 @@ static const char rcsid[] = "$Id: eventlib.c,v 1.2.2.1.4.4 2004/12/09 04:07:15 m int __evOptMonoTime; +#ifdef USE_POLL +#define pselect Pselect +#endif /* USE_POLL */ + /* Forward. */ -#ifdef NEED_PSELECT +#if defined(NEED_PSELECT) || defined(USE_POLL) static int pselect(int, void *, void *, void *, struct timespec *, const sigset_t *); @@ -78,6 +85,18 @@ evCreate(evContext *opaqueCtx) { INIT_LIST(ctx->accepts); /* Files. */ +#ifdef USE_POLL + ctx->pollfds = NULL; + ctx->maxnfds = 0; + ctx->firstfd = 0; + emulMaskInit(ctx, rdLast, EV_READ, 1); + emulMaskInit(ctx, rdNext, EV_READ, 0); + emulMaskInit(ctx, wrLast, EV_WRITE, 1); + emulMaskInit(ctx, wrNext, EV_WRITE, 0); + emulMaskInit(ctx, exLast, EV_EXCEPT, 1); + emulMaskInit(ctx, exNext, EV_EXCEPT, 0); + emulMaskInit(ctx, nonblockBefore, EV_WASNONBLOCKING, 0); +#endif /* USE_POLL */ ctx->files = NULL; FD_ZERO(&ctx->rdNext); FD_ZERO(&ctx->wrNext); @@ -86,11 +105,16 @@ evCreate(evContext *opaqueCtx) { ctx->fdMax = -1; ctx->fdNext = NULL; ctx->fdCount = 0; /* Invalidate {rd,wr,ex}Last. */ +#ifndef USE_POLL ctx->highestFD = FD_SETSIZE - 1; + memset(ctx->fdTable, 0, sizeof ctx->fdTable); +#else + ctx->highestFD = INT_MAX / sizeof(struct pollfd); + ctx->fdTable = NULL; +#endif #ifdef EVENTLIB_TIME_CHECKS ctx->lastFdCount = 0; #endif - memset(ctx->fdTable, 0, sizeof ctx->fdTable); /* Streams. */ ctx->streams = NULL; @@ -284,34 +308,37 @@ evGetNext(evContext opaqueCtx, evEvent *opaqueEv, int options) { } #endif do { +#ifndef USE_POLL /* XXX need to copy only the bits we are using. */ ctx->rdLast = ctx->rdNext; ctx->wrLast = ctx->wrNext; ctx->exLast = ctx->exNext; - +#else + /* + * The pollfd structure uses separate fields for + * the input and output events (corresponding to + * the ??Next and ??Last fd sets), so there's no + * need to copy one to the other. + */ +#endif /* USE_POLL */ if (m == Timer) { INSIST(tp == &t); t = evSubTime(nextTime, ctx->lastEventTime); } - evPrintf(ctx, 4, - "pselect(%d, 0x%lx, 0x%lx, 0x%lx, %ld.%09ld)\n", - ctx->fdMax+1, - (u_long)ctx->rdLast.fds_bits[0], - (u_long)ctx->wrLast.fds_bits[0], - (u_long)ctx->exLast.fds_bits[0], - tp ? (long)tp->tv_sec : -1L, - tp ? tp->tv_nsec : -1); - /* XXX should predict system's earliness and adjust. */ x = pselect(ctx->fdMax+1, &ctx->rdLast, &ctx->wrLast, &ctx->exLast, tp, NULL); pselect_errno = errno; +#ifndef USE_POLL evPrintf(ctx, 4, "select() returns %d (err: %s)\n", x, (x == -1) ? strerror(errno) : "none"); - +#else + evPrintf(ctx, 4, "poll() returns %d (err: %s)\n", + x, (x == -1) ? strerror(errno) : "none"); +#endif /* USE_POLL */ /* Anything but a poll can change the time. */ if (m != JustPoll) ctx->lastEventTime = evNowTime(); @@ -704,7 +731,7 @@ evGetOption(evContext *opaqueCtx, const char *option, int *value) { return (-1); } -#ifdef NEED_PSELECT +#if defined(NEED_PSELECT) || defined(USE_POLL) /* XXX needs to move to the porting library. */ static int pselect(int nfds, void *rfds, void *wfds, void *efds, @@ -714,15 +741,69 @@ pselect(int nfds, void *rfds, void *wfds, void *efds, struct timeval tv, *tvp; sigset_t sigs; int n; +#ifdef USE_POLL + int polltimeout = INFTIM; + evContext_p *ctx; + struct pollfd *fds; + nfds_t pnfds; + + UNUSED(nfds); +#endif /* USE_POLL */ if (tsp) { tvp = &tv; tv = evTimeVal(*tsp); +#ifdef USE_POLL + polltimeout = 1000 * tv.tv_sec + tv.tv_usec / 1000; +#endif /* USE_POLL */ } else tvp = NULL; if (sigmask) sigprocmask(SIG_SETMASK, sigmask, &sigs); +#ifndef USE_POLL n = select(nfds, rfds, wfds, efds, tvp); +#else + /* + * rfds, wfds, and efds should all be from the same evContext_p, + * so any of them will do. If they're all NULL, the caller is + * presumably calling us to block. + */ + if (rfds != NULL) + ctx = ((__evEmulMask *)rfds)->ctx; + else if (wfds != NULL) + ctx = ((__evEmulMask *)wfds)->ctx; + else if (efds != NULL) + ctx = ((__evEmulMask *)efds)->ctx; + else + ctx = NULL; + if (ctx != NULL && ctx->fdMax != -1) { + fds = &(ctx->pollfds[ctx->firstfd]); + pnfds = ctx->fdMax - ctx->firstfd + 1; + } else { + fds = NULL; + pnfds = 0; + } + n = poll(fds, pnfds, polltimeout); + /* + * pselect() should return the total number of events on the file + * desriptors, not just the count of fd:s with activity. Hence, + * traverse the pollfds array and count the events. + */ + if (n > 0) { + int i, e; + for (e = 0, i = ctx->firstfd; i <= ctx->fdMax; i++) { + if (ctx->pollfds[i].fd < 0) + continue; + if (FD_ISSET(i, &ctx->rdLast)) + e++; + if (FD_ISSET(i, &ctx->wrLast)) + e++; + if (FD_ISSET(i, &ctx->exLast)) + e++; + } + n = e; + } +#endif /* USE_POLL */ if (sigmask) sigprocmask(SIG_SETMASK, &sigs, NULL); if (tsp) @@ -730,3 +811,127 @@ pselect(int nfds, void *rfds, void *wfds, void *efds, return (n); } #endif + +#ifdef USE_POLL +int +evPollfdRealloc(evContext_p *ctx, int pollfd_chunk_size, int fd) { + + int i, maxnfds; + void *pollfds, *fdTable; + + if (fd < ctx->maxnfds) + return (0); + + /* Don't allow ridiculously small values for pollfd_chunk_size */ + if (pollfd_chunk_size < 20) + pollfd_chunk_size = 20; + + maxnfds = (1 + (fd/pollfd_chunk_size)) * pollfd_chunk_size; + + pollfds = realloc(ctx->pollfds, maxnfds * sizeof(*ctx->pollfds)); + if (pollfds != NULL) + ctx->pollfds = pollfds; + fdTable = realloc(ctx->fdTable, maxnfds * sizeof(*ctx->fdTable)); + if (fdTable != NULL) + ctx->fdTable = fdTable; + + if (pollfds == NULL || fdTable == NULL) { + evPrintf(ctx, 2, "pollfd() realloc (%ld) failed\n", + (long)maxnfds*sizeof(struct pollfd)); + return (-1); + } + + for (i = ctx->maxnfds; i < maxnfds; i++) { + ctx->pollfds[i].fd = -1; + ctx->pollfds[i].events = 0; + ctx->fdTable[i] = 0; + } + + ctx->maxnfds = maxnfds; + + return (0); +} + +/* Find the appropriate 'events' or 'revents' field in the pollfds array */ +short * +__fd_eventfield(int fd, __evEmulMask *maskp) { + + evContext_p *ctx = (evContext_p *)maskp->ctx; + + if (!maskp->result || maskp->type == EV_WASNONBLOCKING) + return (&(ctx->pollfds[fd].events)); + else + return (&(ctx->pollfds[fd].revents)); +} + +/* Translate to poll(2) event */ +short +__poll_event(__evEmulMask *maskp) { + + switch ((maskp)->type) { + case EV_READ: + return (POLLRDNORM); + case EV_WRITE: + return (POLLWRNORM); + case EV_EXCEPT: + return (POLLRDBAND | POLLPRI | POLLWRBAND); + case EV_WASNONBLOCKING: + return (POLLHUP); + default: + return (0); + } +} + +/* + * Clear the events corresponding to the specified mask. If this leaves + * the events mask empty (apart from the POLLHUP bit), set the fd field + * to -1 so that poll(2) will ignore this fd. + */ +void +__fd_clr(int fd, __evEmulMask *maskp) { + + evContext_p *ctx = maskp->ctx; + + *__fd_eventfield(fd, maskp) &= ~__poll_event(maskp); + if ((ctx->pollfds[fd].events & ~POLLHUP) == 0) { + ctx->pollfds[fd].fd = -1; + if (fd == ctx->fdMax) + while (ctx->fdMax > ctx->firstfd && + ctx->pollfds[ctx->fdMax].fd < 0) + ctx->fdMax--; + if (fd == ctx->firstfd) + while (ctx->firstfd <= ctx->fdMax && + ctx->pollfds[ctx->firstfd].fd < 0) + ctx->firstfd++; + /* + * Do we have a empty set of descriptors? + */ + if (ctx->firstfd > ctx->fdMax) { + ctx->fdMax = -1; + ctx->firstfd = 0; + } + } +} + +/* + * Set the events bit(s) corresponding to the specified mask. If the events + * field has any other bits than POLLHUP set, also set the fd field so that + * poll(2) will watch this fd. + */ +void +__fd_set(int fd, __evEmulMask *maskp) { + + evContext_p *ctx = maskp->ctx; + + *__fd_eventfield(fd, maskp) |= __poll_event(maskp); + if ((ctx->pollfds[fd].events & ~POLLHUP) != 0) { + ctx->pollfds[fd].fd = fd; + if (fd < ctx->firstfd || ctx->fdMax == -1) + ctx->firstfd = fd; + if (fd > ctx->fdMax) + ctx->fdMax = fd; + } +} +#endif /* USE_POLL */ + +/*! \file */ diff --git a/contrib/bind9/lib/bind/isc/eventlib_p.h b/contrib/bind9/lib/bind/isc/eventlib_p.h index 8c58c7f..b95741d 100644 --- a/contrib/bind9/lib/bind/isc/eventlib_p.h +++ b/contrib/bind9/lib/bind/isc/eventlib_p.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 2005 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1995-1999 by Internet Software Consortium * * Permission to use, copy, modify, and distribute this software for any @@ -18,7 +18,7 @@ /* eventlib_p.h - private interfaces for eventlib * vix 09sep95 [initial] * - * $Id: eventlib_p.h,v 1.3.2.1.4.2 2004/12/05 22:38:43 marka Exp $ + * $Id: eventlib_p.h,v 1.3.2.1.4.3 2005/07/28 07:43:20 marka Exp $ */ #ifndef _EVENTLIB_P_H @@ -63,6 +63,13 @@ #define FILL(p) #endif +#ifdef USE_POLL +#ifdef HAVE_STROPTS_H +#include <stropts.h> +#endif +#include <poll.h> +#endif /* USE_POLL */ + typedef struct evConn { evConnFunc func; void * uap; @@ -166,6 +173,40 @@ typedef struct evEvent_p { } u; } evEvent_p; +#ifdef USE_POLL +typedef struct { + void *ctx; /* pointer to the evContext_p */ + uint32_t type; /* READ, WRITE, EXCEPT, nonblk */ + uint32_t result; /* 1 => revents, 0 => events */ +} __evEmulMask; + +#define emulMaskInit(ctx, field, ev, lastnext) \ + ctx->field.ctx = ctx; \ + ctx->field.type = ev; \ + ctx->field.result = lastnext; + +extern short *__fd_eventfield(int fd, __evEmulMask *maskp); +extern short __poll_event(__evEmulMask *maskp); +extern void __fd_clr(int fd, __evEmulMask *maskp); +extern void __fd_set(int fd, __evEmulMask *maskp); + +#undef FD_ZERO +#define FD_ZERO(maskp) + +#undef FD_SET +#define FD_SET(fd, maskp) \ + __fd_set(fd, maskp) + +#undef FD_CLR +#define FD_CLR(fd, maskp) \ + __fd_clr(fd, maskp) + +#undef FD_ISSET +#define FD_ISSET(fd, maskp) \ + ((*__fd_eventfield(fd, maskp) & __poll_event(maskp)) != 0) + +#endif /* USE_POLL */ + typedef struct { /* Global. */ const evEvent_p *cur; @@ -177,12 +218,26 @@ typedef struct { LIST(evAccept) accepts; /* Files. */ evFile *files, *fdNext; +#ifndef USE_POLL fd_set rdLast, rdNext; fd_set wrLast, wrNext; fd_set exLast, exNext; fd_set nonblockBefore; int fdMax, fdCount, highestFD; evFile *fdTable[FD_SETSIZE]; +#else + struct pollfd *pollfds; /* Allocated as needed */ + evFile **fdTable; /* Ditto */ + int maxnfds; /* # elements in above */ + int firstfd; /* First active fd */ + int fdMax; /* Last active fd */ + int fdCount; /* # fd:s with I/O */ + int highestFD; /* max fd allowed by OS */ + __evEmulMask rdLast, rdNext; + __evEmulMask wrLast, wrNext; + __evEmulMask exLast, exNext; + __evEmulMask nonblockBefore; +#endif /* USE_POLL */ #ifdef EVENTLIB_TIME_CHECKS struct timespec lastSelectTime; int lastFdCount; @@ -203,6 +258,10 @@ typedef struct { void evPrintf(const evContext_p *ctx, int level, const char *fmt, ...) ISC_FORMAT_PRINTF(3, 4); +#ifdef USE_POLL +extern int evPollfdRealloc(evContext_p *ctx, int pollfd_chunk_size, int fd); +#endif /* USE_POLL */ + /* ev_timers.c */ #define evCreateTimers __evCreateTimers heap_context evCreateTimers(const evContext_p *); diff --git a/contrib/bind9/lib/bind/isc/memcluster.c b/contrib/bind9/lib/bind/isc/memcluster.c index 0632ec7..c5b7202 100644 --- a/contrib/bind9/lib/bind/isc/memcluster.c +++ b/contrib/bind9/lib/bind/isc/memcluster.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 2005 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1997,1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any @@ -24,7 +24,7 @@ #if !defined(LINT) && !defined(CODECENTER) -static const char rcsid[] = "$Id: memcluster.c,v 1.3.206.4 2004/09/16 00:57:34 marka Exp $"; +static const char rcsid[] = "$Id: memcluster.c,v 1.3.206.7 2005/10/11 00:48:15 marka Exp $"; #endif /* not lint */ #include "port_before.h" @@ -90,12 +90,28 @@ struct stats { u_long freefrags; }; +#ifdef DO_PTHREADS +#include <pthread.h> +static pthread_mutex_t memlock = PTHREAD_MUTEX_INITIALIZER; +#define MEMLOCK (void)pthread_mutex_lock(&memlock) +#define MEMUNLOCK (void)pthread_mutex_unlock(&memlock) +#else +/* + * Catch bad lock usage in non threaded build. + */ +static unsigned int memlock = 0; +#define MEMLOCK do { INSIST(memlock == 0); memlock = 1; } while (0) +#define MEMUNLOCK do { INSIST(memlock == 1); memlock = 0; } while (0) +#endif /* DO_PTHEADS */ + /* Private data. */ static size_t max_size; static size_t mem_target; +#ifndef MEMCLUSTER_BIG_MALLOC static size_t mem_target_half; static size_t mem_target_fudge; +#endif static memcluster_element ** freelists; #ifdef MEMCLUSTER_RECORD static memcluster_element ** activelists; @@ -132,8 +148,10 @@ meminit(size_t init_max_size, size_t target_size) { mem_target = DEF_MEM_TARGET; else mem_target = target_size; +#ifndef MEMCLUSTER_BIG_MALLOC mem_target_half = mem_target / 2; mem_target_fudge = mem_target + mem_target / 4; +#endif freelists = malloc(max_size * sizeof (memcluster_element *)); stats = malloc((max_size+1) * sizeof (struct stats)); if (freelists == NULL || stats == NULL) { @@ -173,14 +191,20 @@ __memget_record(size_t size, const char *file, int line) { #endif void *ret; + MEMLOCK; + #if !defined(MEMCLUSTER_RECORD) UNUSED(file); UNUSED(line); #endif - if (freelists == NULL) - if (meminit(0, 0) == -1) + if (freelists == NULL) { + if (meminit(0, 0) == -1) { + MEMUNLOCK; return (NULL); + } + } if (size == 0U) { + MEMUNLOCK; errno = EINVAL; return (NULL); } @@ -191,6 +215,7 @@ __memget_record(size_t size, const char *file, int line) { #if defined(DEBUGGING_MEMCLUSTER) e = malloc(new_size); if (e == NULL) { + MEMUNLOCK; errno = ENOMEM; return (NULL); } @@ -202,11 +227,13 @@ __memget_record(size_t size, const char *file, int line) { e->next = activelists[max_size]; activelists[max_size] = e; #endif + MEMUNLOCK; e->fencepost = FRONT_FENCEPOST; p = (char *)e + sizeof *e + size; memcpy(p, &fp, sizeof fp); return ((char *)e + sizeof *e); #else + MEMUNLOCK; return (malloc(size)); #endif } @@ -226,6 +253,7 @@ __memget_record(size_t size, const char *file, int line) { if (basic_blocks == NULL) { new = malloc(NUM_BASIC_BLOCKS * mem_target); if (new == NULL) { + MEMUNLOCK; errno = ENOMEM; return (NULL); } @@ -253,6 +281,7 @@ __memget_record(size_t size, const char *file, int line) { total_size = mem_target; new = malloc(total_size); if (new == NULL) { + MEMUNLOCK; errno = ENOMEM; return (NULL); } @@ -318,6 +347,7 @@ __memget_record(size_t size, const char *file, int line) { stats[size].gets++; stats[size].totalgets++; stats[new_size].freefrags--; + MEMUNLOCK; #if defined(DEBUGGING_MEMCLUSTER) return ((char *)e + sizeof *e); #else @@ -347,6 +377,8 @@ __memput_record(void *mem, size_t size, const char *file, int line) { char *p; #endif + MEMLOCK; + #if !defined (MEMCLUSTER_RECORD) UNUSED(file); UNUSED(line); @@ -355,6 +387,7 @@ __memput_record(void *mem, size_t size, const char *file, int line) { REQUIRE(freelists != NULL); if (size == 0U) { + MEMUNLOCK; errno = EINVAL; return; } @@ -398,6 +431,7 @@ __memput_record(void *mem, size_t size, const char *file, int line) { INSIST(stats[max_size].gets != 0U); stats[max_size].gets--; + MEMUNLOCK; return; } @@ -436,6 +470,7 @@ __memput_record(void *mem, size_t size, const char *file, int line) { INSIST(stats[size].gets != 0U); stats[size].gets--; stats[new_size].freefrags++; + MEMUNLOCK; } void * @@ -464,8 +499,12 @@ memstats(FILE *out) { memcluster_element *e; #endif - if (freelists == NULL) + MEMLOCK; + + if (freelists == NULL) { + MEMUNLOCK; return; + } for (i = 1; i <= max_size; i++) { const struct stats *s = &stats[i]; @@ -492,6 +531,7 @@ memstats(FILE *out) { } } #endif + MEMUNLOCK; } int diff --git a/contrib/bind9/lib/bind/nameser/ns_parse.c b/contrib/bind9/lib/bind/nameser/ns_parse.c index 34ebd3d..19a6f51 100644 --- a/contrib/bind9/lib/bind/nameser/ns_parse.c +++ b/contrib/bind9/lib/bind/nameser/ns_parse.c @@ -16,7 +16,7 @@ */ #ifndef lint -static const char rcsid[] = "$Id: ns_parse.c,v 1.3.2.1.4.1 2004/03/09 08:33:44 marka Exp $"; +static const char rcsid[] = "$Id: ns_parse.c,v 1.3.2.1.4.3 2005/10/11 00:48:16 marka Exp $"; #endif /* Import. */ @@ -40,7 +40,12 @@ static void setsection(ns_msg *msg, ns_sect sect); /* Macros. */ +#ifndef SOLARIS2 #define RETERR(err) do { errno = (err); return (-1); } while (0) +#else +#define RETERR(err) \ + do { errno = (err); if (errno == errno) return (-1); } while (0) +#endif /* Public. */ @@ -135,7 +140,8 @@ ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr) { int tmp; /* Make section right. */ - if ((tmp = section) < 0 || section >= ns_s_max) + tmp = section; + if (tmp < 0 || section >= ns_s_max) RETERR(ENODEV); if (section != handle->_sect) setsection(handle, section); diff --git a/contrib/bind9/lib/bind/nameser/ns_ttl.c b/contrib/bind9/lib/bind/nameser/ns_ttl.c index 368b05a..4d18d3f 100644 --- a/contrib/bind9/lib/bind/nameser/ns_ttl.c +++ b/contrib/bind9/lib/bind/nameser/ns_ttl.c @@ -16,7 +16,7 @@ */ #ifndef lint -static const char rcsid[] = "$Id: ns_ttl.c,v 1.1.206.1 2004/03/09 08:33:45 marka Exp $"; +static const char rcsid[] = "$Id: ns_ttl.c,v 1.1.206.2 2005/07/28 07:43:21 marka Exp $"; #endif /* Import. */ @@ -133,7 +133,8 @@ ns_parse_ttl(const char *src, u_long *dst) { goto einval; else ttl += tmp; - } + } else if (!dirty) + goto einval; *dst = ttl; return (0); diff --git a/contrib/bind9/lib/bind/nameser/ns_verify.c b/contrib/bind9/lib/bind/nameser/ns_verify.c index 7ee00a6..adda249 100644 --- a/contrib/bind9/lib/bind/nameser/ns_verify.c +++ b/contrib/bind9/lib/bind/nameser/ns_verify.c @@ -16,7 +16,7 @@ */ #ifndef lint -static const char rcsid[] = "$Id: ns_verify.c,v 1.1.206.1 2004/03/09 08:33:45 marka Exp $"; +static const char rcsid[] = "$Id: ns_verify.c,v 1.1.206.2 2005/10/11 00:48:16 marka Exp $"; #endif /* Import. */ @@ -144,7 +144,7 @@ ns_verify(u_char *msg, int *msglen, void *k, int n; int error; u_int16_t type, length; - u_int16_t fudge, sigfieldlen, id, otherfieldlen; + u_int16_t fudge, sigfieldlen, otherfieldlen; dst_init(); if (msg == NULL || msglen == NULL || *msglen < 0) @@ -198,9 +198,9 @@ ns_verify(u_char *msg, int *msglen, void *k, sigstart = cp; cp += sigfieldlen; - /* Read the original id and error. */ + /* Skip id and read error. */ BOUNDS_CHECK(cp, 2*INT16SZ); - GETSHORT(id, cp); + cp += INT16SZ; GETSHORT(error, cp); /* Parse the other data. */ @@ -341,12 +341,12 @@ ns_verify_tcp(u_char *msg, int *msglen, ns_tcp_tsig_state *state, int required) { HEADER *hp = (HEADER *)msg; - u_char *recstart, *rdatastart, *sigstart; + u_char *recstart, *sigstart; unsigned int sigfieldlen, otherfieldlen; u_char *cp, *eom = msg + *msglen, *cp2; char name[MAXDNAME], alg[MAXDNAME]; u_char buf[MAXDNAME]; - int n, type, length, fudge, id, error; + int n, type, length, fudge, error; time_t timesigned; if (msg == NULL || msglen == NULL || state == NULL) @@ -403,7 +403,6 @@ ns_verify_tcp(u_char *msg, int *msglen, ns_tcp_tsig_state *state, return (NS_TSIG_ERROR_FORMERR); /* Read the algorithm name. */ - rdatastart = cp; n = dn_expand(msg, eom, cp, alg, MAXDNAME); if (n < 0) return (NS_TSIG_ERROR_FORMERR); @@ -429,9 +428,9 @@ ns_verify_tcp(u_char *msg, int *msglen, ns_tcp_tsig_state *state, sigstart = cp; cp += sigfieldlen; - /* Read the original id and error. */ + /* Skip id and read error. */ BOUNDS_CHECK(cp, 2*INT16SZ); - GETSHORT(id, cp); + cp += INT16SZ; GETSHORT(error, cp); /* Parse the other data. */ diff --git a/contrib/bind9/lib/bind/port_after.h.in b/contrib/bind9/lib/bind/port_after.h.in index c043561..0c956b7 100644 --- a/contrib/bind9/lib/bind/port_after.h.in +++ b/contrib/bind9/lib/bind/port_after.h.in @@ -8,6 +8,9 @@ #if (!defined(BSD)) || (BSD < 199306) #include <sys/bitypes.h> #endif +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#endif @NEED_PSELECT@ @HAVE_SA_LEN@ @@ -27,9 +30,7 @@ @INNETGR_ARGS@ @SETNETGRENT_ARGS@ @USE_IFNAMELINKID@ - -/* XXX sunos and cygwin needs O_NDELAY */ -#define PORT_NONBLOCK O_NONBLOCK +@PORT_NONBLOCK@ /* * We need to know the IPv6 address family number even on IPv4-only systems. @@ -255,7 +256,7 @@ char * strsep(char **stringp, const char *delim); #endif #ifndef ALIGN -#define ALIGN(p) (((unsigned int)(p) + (sizeof(int) - 1)) & ~(sizeof(int) - 1)) +#define ALIGN(p) (((uintptr_t)(p) + (sizeof(long) - 1)) & ~(sizeof(long) - 1)) #endif #ifdef NEED_SETGROUPENT @@ -298,7 +299,7 @@ GROUP_R_SET_RETURN setgrent_r(GROUP_R_ENT_ARGS); GROUP_R_END_RETURN endgrent_r(GROUP_R_ENT_ARGS); #endif -#ifdef NEED_INNETGR_R +#if defined(NEED_INNETGR_R) && defined(NGR_R_RETURN) NGR_R_RETURN innetgr_r(const char *, const char *, const char *, const char *); #endif @@ -381,7 +382,9 @@ int isc__gettimeofday(struct timeval *tp, struct timezone *tzp); int getnetgrent(char **machinep, char **userp, char **domainp); +#ifdef NGR_R_ARGS int getnetgrent_r(char **machinep, char **userp, char **domainp, NGR_R_ARGS); +#endif #ifdef SETNETGRENT_ARGS void setnetgrent(SETNETGRENT_ARGS); diff --git a/contrib/bind9/lib/bind/port_before.h.in b/contrib/bind9/lib/bind/port_before.h.in index d6fbe86..c754efd 100644 --- a/contrib/bind9/lib/bind/port_before.h.in +++ b/contrib/bind9/lib/bind/port_before.h.in @@ -18,6 +18,9 @@ struct timezone; /* silence warning */ @WANT_IRS_PW@ @BSD_COMP@ +@USE_POLL@ +@HAVE_MD5@ +@SOLARIS2@ @DO_PTHREADS@ @GETGROUPLIST_ARGS@ @@ -135,4 +138,9 @@ struct timezone; /* silence warning */ #define ISC_FORMAT_PRINTF(fmt, args) #endif +/* Pull in host order macros when _XOPEN_SOURCE_EXTENDED is defined. */ +#if defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED) +#include <sys/byteorder.h> +#endif + #endif diff --git a/contrib/bind9/lib/bind/resolv/Makefile.in b/contrib/bind9/lib/bind/resolv/Makefile.in index 74a20e7..a235fbc 100644 --- a/contrib/bind9/lib/bind/resolv/Makefile.in +++ b/contrib/bind9/lib/bind/resolv/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2001 Internet Software Consortium. # # Permission to use, copy, modify, and distribute this software for any @@ -13,16 +13,16 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: Makefile.in,v 1.3.206.1 2004/03/15 01:02:54 marka Exp $ +# $Id: Makefile.in,v 1.3.206.3 2005/07/29 00:13:09 marka Exp $ srcdir= @srcdir@ VPATH = @srcdir@ -OBJS= herror.@O@ res_comp.@O@ res_data.@O@ res_debug.@O@ \ +OBJS= herror.@O@ mtctxres.@O@ res_comp.@O@ res_data.@O@ res_debug.@O@ \ res_findzonecut.@O@ res_init.@O@ res_mkquery.@O@ res_mkupdate.@O@ \ res_query.@O@ res_send.@O@ res_sendsigned.@O@ res_update.@O@ -SRCS= herror.c res_comp.c res_data.c res_debug.c \ +SRCS= herror.c mtctxres.c res_comp.c res_data.c res_debug.c \ res_findzonecut.c res_init.c res_mkquery.c res_mkupdate.c \ res_query.c res_send.c res_sendsigned.c res_update.c diff --git a/contrib/bind9/lib/bind/resolv/mtctxres.c b/contrib/bind9/lib/bind/resolv/mtctxres.c new file mode 100644 index 0000000..f33cf11 --- /dev/null +++ b/contrib/bind9/lib/bind/resolv/mtctxres.c @@ -0,0 +1,128 @@ +#include <port_before.h> +#ifdef DO_PTHREADS +#include <pthread.h> +#endif +#include <errno.h> +#include <netdb.h> +#include <stdlib.h> +#include <string.h> +#include <resolv_mt.h> +#include <irs.h> +#include <port_after.h> + +#ifdef DO_PTHREADS +static pthread_key_t key; +static int mt_key_initialized = 0; + +static int __res_init_ctx(void); +static void __res_destroy_ctx(void *); + +#if defined(sun) && !defined(__GNUC__) +#pragma init (_mtctxres_init) +#endif +#endif + +static mtctxres_t sharedctx; + +#ifdef DO_PTHREADS +/* + * Initialize the TSD key. By doing this at library load time, we're + * implicitly running without interference from other threads, so there's + * no need for locking. + */ +static void +_mtctxres_init(void) { + int pthread_keycreate_ret; + + pthread_keycreate_ret = pthread_key_create(&key, __res_destroy_ctx); + if (pthread_keycreate_ret == 0) + mt_key_initialized = 1; +} +#endif + +/* + * To support binaries that used the private MT-safe interface in + * Solaris 8, we still need to provide the __res_enable_mt() + * and __res_disable_mt() entry points. They're do-nothing routines. + */ +int +__res_enable_mt(void) { + return (-1); +} + +int +__res_disable_mt(void) { + return (0); +} + +#ifdef DO_PTHREADS +static int +__res_init_ctx(void) { + + mtctxres_t *mt; + int ret; + + + if (pthread_getspecific(key) != 0) { + /* Already exists */ + return (0); + } + + if ((mt = malloc(sizeof (mtctxres_t))) == 0) { + errno = ENOMEM; + return (-1); + } + + memset(mt, 0, sizeof (mtctxres_t)); + + if ((ret = pthread_setspecific(key, mt)) != 0) { + free(mt); + errno = ret; + return (-1); + } + + return (0); +} + +static void +__res_destroy_ctx(void *value) { + + mtctxres_t *mt = (mtctxres_t *)value; + + if (mt != 0) + free(mt); +} +#endif + +mtctxres_t * +___mtctxres(void) { +#ifdef DO_PTHREADS + mtctxres_t *mt; + + /* + * This if clause should only be executed if we are linking + * statically. When linked dynamically _mtctxres_init() should + * be called at binding time due the #pragma above. + */ + if (!mt_key_initialized) { + static pthread_mutex_t keylock = PTHREAD_MUTEX_INITIALIZER; + pthread_mutex_lock(&keylock); + _mtctxres_init(); + pthread_mutex_unlock(&keylock); + } + + /* + * If we have already been called in this thread return the existing + * context. Otherwise recreat a new context and return it. If + * that fails return a global context. + */ + if (mt_key_initialized) { + if (((mt = pthread_getspecific(key)) != 0) || + (__res_init_ctx() == 0 && + (mt = pthread_getspecific(key)) != 0)) { + return (mt); + } + } +#endif + return (&sharedctx); +} diff --git a/contrib/bind9/lib/bind/resolv/res_comp.c b/contrib/bind9/lib/bind/resolv/res_comp.c index 6468dbc..8cc99a7 100644 --- a/contrib/bind9/lib/bind/resolv/res_comp.c +++ b/contrib/bind9/lib/bind/resolv/res_comp.c @@ -70,7 +70,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_comp.c,v 1.1.2.1.4.1 2004/03/09 08:33:54 marka Exp $"; +static const char rcsid[] = "$Id: res_comp.c,v 1.1.2.1.4.2 2005/07/28 07:43:22 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -242,6 +242,18 @@ res_dnok(const char *dn) { * __getshort * Note that one _ comes from C and the others come from us. */ + +#ifdef SOLARIS2 +#ifdef __putlong +#undef __putlong +#endif +#ifdef __putshort +#undef __putshort +#endif +#pragma weak putlong = __putlong +#pragma weak putshort = __putshort +#endif /* SOLARIS2 */ + void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); } void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); } #ifndef __ultrix__ diff --git a/contrib/bind9/lib/bind/resolv/res_debug.c b/contrib/bind9/lib/bind/resolv/res_debug.c index 1e228be..8dda12c 100644 --- a/contrib/bind9/lib/bind/resolv/res_debug.c +++ b/contrib/bind9/lib/bind/resolv/res_debug.c @@ -95,7 +95,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_debug.c,v 1.3.2.5.4.5 2004/07/28 20:16:46 marka Exp $"; +static const char rcsid[] = "$Id: res_debug.c,v 1.3.2.5.4.6 2005/07/28 07:43:22 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -113,6 +113,7 @@ static const char rcsid[] = "$Id: res_debug.c,v 1.3.2.5.4.5 2004/07/28 20:16:46 #include <math.h> #include <netdb.h> #include <resolv.h> +#include <resolv_mt.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -504,7 +505,7 @@ sym_ston(const struct res_sym *syms, const char *name, int *success) { const char * sym_ntos(const struct res_sym *syms, int number, int *success) { - static char unname[20]; + char *unname = sym_ntos_unname; for ((void)NULL; syms->name != 0; syms++) { if (number == syms->number) { @@ -522,7 +523,7 @@ sym_ntos(const struct res_sym *syms, int number, int *success) { const char * sym_ntop(const struct res_sym *syms, int number, int *success) { - static char unname[20]; + char *unname = sym_ntop_unname; for ((void)NULL; syms->name != 0; syms++) { if (number == syms->number) { @@ -596,7 +597,7 @@ p_class(int class) { */ const char * p_option(u_long option) { - static char nbuf[40]; + char *nbuf = p_option_nbuf; switch (option) { case RES_INIT: return "init"; @@ -639,7 +640,7 @@ p_option(u_long option) { */ const char * p_time(u_int32_t value) { - static char nbuf[40]; /* XXX nonreentrant */ + char *nbuf = p_time_nbuf; if (ns_format_ttl(value, nbuf, sizeof nbuf) < 0) sprintf(nbuf, "%u", value); @@ -695,7 +696,7 @@ static const char * precsize_ntoa(prec) u_int8_t prec; { - static char retbuf[sizeof "90000000.00"]; /* XXX nonreentrant */ + char *retbuf = precsize_ntoa_retbuf; unsigned long val; int mantissa, exponent; @@ -1097,8 +1098,7 @@ dn_count_labels(const char *name) { */ char * p_secstodate (u_long secs) { - /* XXX nonreentrant */ - static char output[15]; /* YYYYMMDDHHMMSS and null */ + char *output = p_secstodate_output; time_t clock = secs; struct tm *time; #ifdef HAVE_TIME_R diff --git a/contrib/bind9/lib/bind/resolv/res_findzonecut.c b/contrib/bind9/lib/bind/resolv/res_findzonecut.c index 154babd..804beb6 100644 --- a/contrib/bind9/lib/bind/resolv/res_findzonecut.c +++ b/contrib/bind9/lib/bind/resolv/res_findzonecut.c @@ -1,5 +1,5 @@ #if !defined(lint) && !defined(SABER) -static const char rcsid[] = "$Id: res_findzonecut.c,v 1.2.2.3.4.3 2004/09/16 07:06:11 marka Exp $"; +static const char rcsid[] = "$Id: res_findzonecut.c,v 1.2.2.3.4.4 2005/10/11 00:48:16 marka Exp $"; #endif /* not lint */ /* @@ -319,7 +319,6 @@ get_soa(res_state statp, const char *dname, ns_class class, int opts, for (i = 0; i < n; i++) { const char *t; const u_char *rdata; - int rdlen; ns_rr rr; if (ns_parserr(&msg, sect, i, &rr) < 0) { @@ -368,7 +367,6 @@ get_soa(res_state statp, const char *dname, ns_class class, int opts, } strcpy(zname, t); rdata = ns_rr_rdata(rr); - rdlen = ns_rr_rdlen(rr); if (ns_name_uncompress(resp, ns_msg_end(msg), rdata, mname, msize) < 0) { DPRINTF(("get_soa: ns_name_uncompress failed") @@ -526,7 +524,6 @@ save_ns(res_state statp, ns_msg *msg, ns_sect sect, const u_char *rdata; rr_ns *nsrr; ns_rr rr; - int rdlen; if (ns_parserr(msg, sect, i, &rr) < 0) { DPRINTF(("save_ns: ns_parserr(%s, %d) failed", @@ -545,7 +542,6 @@ save_ns(res_state statp, ns_msg *msg, ns_sect sect, return (-1); } rdata = ns_rr_rdata(rr); - rdlen = ns_rr_rdlen(rr); if (ns_name_uncompress(ns_msg_base(*msg), ns_msg_end(*msg), rdata, tname, sizeof tname) < 0) { diff --git a/contrib/bind9/lib/bind/resolv/res_init.c b/contrib/bind9/lib/bind/resolv/res_init.c index 241f5f7..28a3ebd 100644 --- a/contrib/bind9/lib/bind/resolv/res_init.c +++ b/contrib/bind9/lib/bind/resolv/res_init.c @@ -70,7 +70,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93"; -static const char rcsid[] = "$Id: res_init.c,v 1.9.2.5.4.2 2004/03/16 12:34:18 marka Exp $"; +static const char rcsid[] = "$Id: res_init.c,v 1.9.2.5.4.5 2005/11/03 00:00:52 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -102,6 +102,10 @@ static const char rcsid[] = "$Id: res_init.c,v 1.9.2.5.4.2 2004/03/16 12:34:18 m #define RESOLVSORT #define DEBUG +#ifdef SOLARIS2 +#include <sys/systeminfo.h> +#endif + static void res_setoptions __P((res_state, const char *, const char *)); #ifdef RESOLVSORT @@ -163,6 +167,9 @@ __res_vinit(res_state statp, int preinit) { int dots; union res_sockaddr_union u[2]; + if (statp->_u._ext.ext != NULL) + res_ndestroy(statp); + if (!preinit) { statp->retrans = RES_TIMEOUT; statp->retry = RES_DFLRETRY; @@ -170,9 +177,6 @@ __res_vinit(res_state statp, int preinit) { statp->id = res_randomid(); } - if ((statp->options & RES_INIT) != 0U) - res_ndestroy(statp); - memset(u, 0, sizeof(u)); #ifdef USELOOPBACK u[nserv].sin.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1); @@ -212,12 +216,42 @@ __res_vinit(res_state statp, int preinit) { statp->_u._ext.ext->nsaddrs[0].sin = statp->nsaddr; strcpy(statp->_u._ext.ext->nsuffix, "ip6.arpa"); strcpy(statp->_u._ext.ext->nsuffix2, "ip6.int"); - } + } else + return (-1); #ifdef RESOLVSORT statp->nsort = 0; #endif res_setservers(statp, u, nserv); +#ifdef SOLARIS2 + /* + * The old libresolv derived the defaultdomain from NIS/NIS+. + * We want to keep this behaviour + */ + { + char buf[sizeof(statp->defdname)], *cp; + int ret; + + if ((ret = sysinfo(SI_SRPC_DOMAIN, buf, sizeof(buf))) > 0 && + (unsigned int)ret <= sizeof(buf)) { + if (buf[0] == '+') + buf[0] = '.'; + cp = strchr(buf, '.'); + if (cp == NULL) { + if (strlcpy(statp->defdname, buf, + sizeof(statp->defdname)) + >= sizeof(statp->defdname)) + goto freedata; + } else { + if (strlcpy(statp->defdname, cp+1, + sizeof(statp->defdname)) + >= sizeof(statp->defdname)) + goto freedata; + } + } + } +#endif /* SOLARIS2 */ + /* Allow user to override the local domain definition */ if ((cp = getenv("LOCALDOMAIN")) != NULL) { (void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1); @@ -456,6 +490,15 @@ __res_vinit(res_state statp, int preinit) { res_setoptions(statp, cp, "env"); statp->options |= RES_INIT; return (0); + +#ifdef SOLARIS2 + freedata: + if (statp->_u._ext.ext != NULL) { + free(statp->_u._ext.ext); + statp->_u._ext.ext = NULL; + } + return (-1); +#endif } static void @@ -495,6 +538,22 @@ res_setoptions(res_state statp, const char *options, const char *source) if (statp->options & RES_DEBUG) printf(";;\ttimeout=%d\n", statp->retrans); #endif +#ifdef SOLARIS2 + } else if (!strncmp(cp, "retrans:", sizeof("retrans:") - 1)) { + /* + * For backward compatibility, 'retrans' is + * supported as an alias for 'timeout', though + * without an imposed maximum. + */ + statp->retrans = atoi(cp + sizeof("retrans:") - 1); + } else if (!strncmp(cp, "retry:", sizeof("retry:") - 1)){ + /* + * For backward compatibility, 'retry' is + * supported as an alias for 'attempts', though + * without an imposed maximum. + */ + statp->retry = atoi(cp + sizeof("retry:") - 1); +#endif /* SOLARIS2 */ } else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){ i = atoi(cp + sizeof("attempts:") - 1); if (i <= RES_MAXRETRY) diff --git a/contrib/bind9/lib/bind/resolv/res_mkupdate.c b/contrib/bind9/lib/bind/resolv/res_mkupdate.c index aac95e5..01078f1 100644 --- a/contrib/bind9/lib/bind/resolv/res_mkupdate.c +++ b/contrib/bind9/lib/bind/resolv/res_mkupdate.c @@ -21,7 +21,7 @@ */ #if !defined(lint) && !defined(SABER) -static const char rcsid[] = "$Id: res_mkupdate.c,v 1.1.2.1.4.3 2004/06/03 04:44:48 marka Exp $"; +static const char rcsid[] = "$Id: res_mkupdate.c,v 1.1.2.1.4.5 2005/10/14 05:43:47 marka Exp $"; #endif /* not lint */ #include "port_before.h" @@ -78,7 +78,7 @@ int res_nmkupdate(res_state statp, ns_updrec *rrecp_in, u_char *buf, int buflen) { ns_updrec *rrecp_start = rrecp_in; HEADER *hp; - u_char *cp, *sp1, *sp2, *startp, *endp; + u_char *cp, *sp2, *startp, *endp; int n, i, soanum, multiline; ns_updrec *rrecp; struct in_addr ina; @@ -101,7 +101,6 @@ res_nmkupdate(res_state statp, ns_updrec *rrecp_in, u_char *buf, int buflen) { hp->id = htons(++statp->id); hp->opcode = ns_o_update; hp->rcode = NOERROR; - sp1 = buf + 2*INT16SZ; /* save pointer to zocount */ cp = buf + HFIXEDSZ; buflen -= HFIXEDSZ; dpp = dnptrs; @@ -922,10 +921,10 @@ res_mkupdrec(int section, const char *dname, } INIT_LINK(rrecp, r_link); INIT_LINK(rrecp, r_glink); - rrecp->r_class = class; - rrecp->r_type = type; + rrecp->r_class = (ns_class)class; + rrecp->r_type = (ns_type)type; rrecp->r_ttl = ttl; - rrecp->r_section = section; + rrecp->r_section = (ns_sect)section; return (rrecp); } diff --git a/contrib/bind9/lib/bind/resolv/res_send.c b/contrib/bind9/lib/bind/resolv/res_send.c index 81c2425..5be2489 100644 --- a/contrib/bind9/lib/bind/resolv/res_send.c +++ b/contrib/bind9/lib/bind/resolv/res_send.c @@ -52,7 +52,7 @@ */ /* - * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 2005 by Internet Systems Consortium, Inc. ("ISC") * Portions Copyright (c) 1996-1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any @@ -70,7 +70,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_send.c,v 1.5.2.2.4.5 2004/08/10 02:19:56 marka Exp $"; +static const char rcsid[] = "$Id: res_send.c,v 1.5.2.2.4.7 2005/08/15 02:04:41 marka Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -103,6 +103,13 @@ static const char rcsid[] = "$Id: res_send.c,v 1.5.2.2.4.5 2004/08/10 02:19:56 m #include "port_after.h" +#ifdef USE_POLL +#ifdef HAVE_STROPTS_H +#include <stropts.h> +#endif +#include <poll.h> +#endif /* USE_POLL */ + /* Options. Leave them on. */ #define DEBUG #include "res_debug.h" @@ -110,7 +117,11 @@ static const char rcsid[] = "$Id: res_send.c,v 1.5.2.2.4.5 2004/08/10 02:19:56 m #define EXT(res) ((res)->_u._ext) +#ifndef USE_POLL static const int highestFD = FD_SETSIZE - 1; +#else +static int highestFD = 0; +#endif /* Forward. */ @@ -125,7 +136,7 @@ static void Aerror(const res_state, FILE *, const char *, int, const struct sockaddr *, int); static void Perror(const res_state, FILE *, const char *, int); static int sock_eq(struct sockaddr *, struct sockaddr *); -#ifdef NEED_PSELECT +#if defined(NEED_PSELECT) && !defined(USE_POLL) static int pselect(int, void *, void *, void *, struct timespec *, const sigset_t *); @@ -280,6 +291,10 @@ res_nsend(res_state statp, int gotsomewhere, terrno, try, v_circuit, resplen, ns, n; char abuf[NI_MAXHOST]; +#ifdef USE_POLL + highestFD = sysconf(_SC_OPEN_MAX) - 1; +#endif + if (statp->nscount == 0) { errno = ESRCH; return (-1); @@ -760,10 +775,15 @@ send_dg(res_state statp, const struct sockaddr *nsap; int nsaplen; struct timespec now, timeout, finish; - fd_set dsmask; struct sockaddr_storage from; ISC_SOCKLEN_T fromlen; int resplen, seconds, n, s; +#ifdef USE_POLL + int polltimeout; + struct pollfd pollfd; +#else + fd_set dsmask; +#endif nsap = get_nsaddr(statp, ns); nsaplen = get_salen(nsap); @@ -841,6 +861,7 @@ send_dg(res_state statp, wait: now = evNowTime(); nonow: +#ifndef USE_POLL FD_ZERO(&dsmask); FD_SET(s, &dsmask); if (evCmpTime(finish, now) > 0) @@ -848,6 +869,17 @@ send_dg(res_state statp, else timeout = evConsTime(0, 0); n = pselect(s + 1, &dsmask, NULL, NULL, &timeout, NULL); +#else + timeout = evSubTime(finish, now); + if (timeout.tv_sec < 0) + timeout = evConsTime(0, 0); + polltimeout = 1000*timeout.tv_sec + + timeout.tv_nsec/1000000; + pollfd.fd = s; + pollfd.events = POLLRDNORM; + n = poll(&pollfd, 1, polltimeout); +#endif /* USE_POLL */ + if (n == 0) { Dprint(statp->options & RES_DEBUG, (stdout, ";; timeout\n")); *gotsomewhere = 1; @@ -856,7 +888,11 @@ send_dg(res_state statp, if (n < 0) { if (errno == EINTR) goto wait; +#ifndef USE_POLL Perror(statp, stderr, "select", errno); +#else + Perror(statp, stderr, "poll", errno); +#endif /* USE_POLL */ res_nclose(statp); return (0); } @@ -1025,7 +1061,7 @@ sock_eq(struct sockaddr *a, struct sockaddr *b) { } } -#ifdef NEED_PSELECT +#if defined(NEED_PSELECT) && !defined(USE_POLL) /* XXX needs to move to the porting library. */ static int pselect(int nfds, void *rfds, void *wfds, void *efds, diff --git a/contrib/bind9/lib/bind/resolv/res_sendsigned.c b/contrib/bind9/lib/bind/resolv/res_sendsigned.c index 1984377..d1d2274 100644 --- a/contrib/bind9/lib/bind/resolv/res_sendsigned.c +++ b/contrib/bind9/lib/bind/resolv/res_sendsigned.c @@ -122,8 +122,16 @@ retry: (stdout, "%s", ""), answer, (anslen > len) ? len : anslen); - Dprint(statp->pfcode & RES_PRF_REPLY, - (stdout, ";; TSIG invalid (%s)\n", p_rcode(ret))); + if (ret > 0) { + Dprint(statp->pfcode & RES_PRF_REPLY, + (stdout, ";; server rejected TSIG (%s)\n", + p_rcode(ret))); + } else { + Dprint(statp->pfcode & RES_PRF_REPLY, + (stdout, ";; TSIG invalid (%s)\n", + p_rcode(-ret))); + } + free (nstatp); free (newmsg); dst_free_key(dstkey); |