2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 22:45:39 +00:00

Merge branch '525-cleanup-platform-h-for-stuff-not-exposed-to-the-headers' into 'master'

Resolve "Cleanup platform.h for stuff not exposed to the headers"

Closes #525

See merge request isc-projects/bind9!756
This commit is contained in:
Witold Krecicki
2018-09-07 09:05:02 -04:00
38 changed files with 342 additions and 2122 deletions

View File

@@ -1,3 +1,10 @@
5031. [cleanup] Various defines in platform.h has been either dropped
if always or never triggered on supported platforms
or replaced with config.h equivalents if the defines
didn't have any impact on public headers. Workarounds
for LinuxThreads have been removed because NPTL is
available since Linux kernel 2.6.0. [GL #525]
5030. [bug] Align CMSG buffers to a 64-bit boundary, fixes crash 5030. [bug] Align CMSG buffers to a 64-bit boundary, fixes crash
on architectures with strict alignment. [GL #521] on architectures with strict alignment. [GL #521]

View File

@@ -66,3 +66,4 @@ These are platforms on which BIND is known *not* to build or run:
* Windows Server 2012 and older * Windows Server 2012 and older
* Platforms that don't support IPv6 Advanced Socket API (RFC 3542) * Platforms that don't support IPv6 Advanced Socket API (RFC 3542)
* Platforms that don't support atomic operations (via compiler or library) * Platforms that don't support atomic operations (via compiler or library)
* Linux without NPTL (Native POSIX Thread Library)

View File

@@ -1,81 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file */
/***
*** This file is not to be included by any public header files, because
*** it does not get installed.
***/
@TOP@
/** define if your system needs pthread_init() before using pthreads */
#undef NEED_PTHREAD_INIT
/** define if your system has sigwait() */
#undef HAVE_SIGWAIT
/** define if sigwait() is the UnixWare flavor */
#undef HAVE_UNIXWARE_SIGWAIT
/** define if LinuxThreads is in use */
#undef HAVE_LINUXTHREADS
/** define if sysconf() is available */
#undef HAVE_SYSCONF
/** define if sysctlbyname() is available */
#undef HAVE_SYSCTLBYNAME
/** define if catgets() is available */
#undef HAVE_CATGETS
/** define if getifaddrs() exists */
#undef HAVE_GETIFADDRS
/** define if you have the NET_RT_IFLIST sysctl variable and sys/sysctl.h */
#undef HAVE_IFLIST_SYSCTL
/** define if tzset() is available */
#undef HAVE_TZSET
/**
* define if pthread_setconcurrency() should be called to tell the
* OS how many threads we might want to run.
*/
#undef CALL_PTHREAD_SETCONCURRENCY
/** define if flockfile() is available */
#undef HAVE_FLOCKFILE
/** define if getc_unlocked() is available */
#undef HAVE_GETCUNLOCKED
/** define if the system has a random number generating device */
#undef PATH_RANDOMDEV
/** define if pthread_attr_getstacksize() is available */
#undef HAVE_PTHREAD_ATTR_GETSTACKSIZE
/** define if pthread_attr_setstacksize() is available */
#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
/** define if you have strerror in the C library. */
#undef HAVE_STRERROR
/* Define to the length type used by the socket API (socklen_t, size_t, int). */
#undef ISC_SOCKADDR_LEN_T
/* Define if threads need PTHREAD_SCOPE_SYSTEM */
#undef NEED_PTHREAD_SCOPE_SYSTEM
/* Define to 1 if you have the uname library function. */
#undef HAVE_UNAME

View File

@@ -59,54 +59,6 @@ static int singletonfd = -1;
#define ISC_FACILITY LOG_DAEMON #define ISC_FACILITY LOG_DAEMON
#endif #endif
/*
* If there's no <sys/capability.h>, we don't care about <sys/prctl.h>
*/
#ifndef HAVE_SYS_CAPABILITY_H
#undef HAVE_SYS_PRCTL_H
#endif
/*
* Linux defines:
* (T) HAVE_LINUXTHREADS
* (C) HAVE_SYS_CAPABILITY_H
* (P) HAVE_SYS_PRCTL_H
* The possible cases are:
* none: setuid() normally
* T: no setuid()
* C: setuid() normally, drop caps (keep CAP_SETUID)
* T+C: no setuid(), drop caps (don't keep CAP_SETUID)
* T+C+P: setuid() early, drop caps (keep CAP_SETUID)
* C+P: setuid() normally, drop caps (keep CAP_SETUID)
* P: not possible
* T+P: not possible
*
* if (C)
* caps = BIND_SERVICE + CHROOT + SETGID
* if ((T && C && P) || !T)
* caps += SETUID
* endif
* capset(caps)
* endif
* if (T && C && P && -u)
* setuid()
* else if (T && -u)
* fail
* --> start threads
* if (!T && -u)
* setuid()
* if (C && (P || !-u))
* caps = BIND_SERVICE
* capset(caps)
* endif
*
* It will be nice when Linux threads work properly with setuid().
*/
#ifdef HAVE_LINUXTHREADS
static pid_t mainpid = 0;
#endif
static struct passwd *runas_pw = NULL; static struct passwd *runas_pw = NULL;
static bool done_setuid = false; static bool done_setuid = false;
static int dfd[2] = { -1, -1 }; static int dfd[2] = { -1, -1 };
@@ -117,10 +69,7 @@ static bool non_root = false;
static bool non_root_caps = false; static bool non_root_caps = false;
#include <sys/capability.h> #include <sys/capability.h>
#include <sys/prctl.h>
#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h> /* Required for prctl(). */
#endif /* HAVE_SYS_PRCTL_H */
static void static void
linux_setcaps(cap_t caps) { linux_setcaps(cap_t caps) {
@@ -201,15 +150,11 @@ linux_initialprivs(void) {
*/ */
SET_CAP(CAP_SYS_CHROOT); SET_CAP(CAP_SYS_CHROOT);
#if defined(HAVE_SYS_PRCTL_H) || !defined(HAVE_LINUXTHREADS)
/* /*
* We can setuid() only if either the kernel supports keeping * We need setuid() as the kernel supports keeping capabilities after
* capabilities after setuid() (which we don't know until we've * setuid().
* tried) or we're not using threads. If either of these is
* true, we want the setuid capability.
*/ */
SET_CAP(CAP_SETUID); SET_CAP(CAP_SETUID);
#endif
/* /*
* Since we call initgroups, we need this. * Since we call initgroups, we need this.
@@ -275,7 +220,6 @@ linux_minprivs(void) {
FREE_CAP; FREE_CAP;
} }
#ifdef HAVE_SYS_PRCTL_H
static void static void
linux_keepcaps(void) { linux_keepcaps(void) {
char strbuf[ISC_STRERRORSIZE]; char strbuf[ISC_STRERRORSIZE];
@@ -295,11 +239,9 @@ linux_keepcaps(void) {
non_root = true; non_root = true;
} }
} }
#endif
#endif /* HAVE_SYS_CAPABILITY_H */ #endif /* HAVE_SYS_CAPABILITY_H */
static void static void
setup_syslog(const char *progname) { setup_syslog(const char *progname) {
int options; int options;
@@ -317,9 +259,6 @@ named_os_init(const char *progname) {
#ifdef HAVE_SYS_CAPABILITY_H #ifdef HAVE_SYS_CAPABILITY_H
linux_initialprivs(); linux_initialprivs();
#endif #endif
#ifdef HAVE_LINUXTHREADS
mainpid = getpid();
#endif
#ifdef SIGXFSZ #ifdef SIGXFSZ
signal(SIGXFSZ, SIG_IGN); signal(SIGXFSZ, SIG_IGN);
#endif #endif
@@ -362,10 +301,6 @@ named_os_daemonize(void) {
* We're the child. * We're the child.
*/ */
#ifdef HAVE_LINUXTHREADS
mainpid = getpid();
#endif
if (setsid() == -1) { if (setsid() == -1) {
strerror_r(errno, strbuf, sizeof(strbuf)); strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlyfatal("setsid(): %s", strbuf); named_main_earlyfatal("setsid(): %s", strbuf);
@@ -499,20 +434,6 @@ named_os_changeuser(void) {
done_setuid = true; done_setuid = true;
#ifdef HAVE_LINUXTHREADS
#ifdef HAVE_SYS_CAPABILITY_H
if (!non_root_caps) {
named_main_earlyfatal("-u with Linux threads not supported: "
"requires kernel support for "
"prctl(PR_SET_KEEPCAPS)");
}
#else
named_main_earlyfatal("-u with Linux threads not supported: "
"no capabilities support or capabilities "
"disabled at build time");
#endif
#endif
if (setgid(runas_pw->pw_gid) < 0) { if (setgid(runas_pw->pw_gid) < 0) {
strerror_r(errno, strbuf, sizeof(strbuf)); strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlyfatal("setgid(): %s", strbuf); named_main_earlyfatal("setgid(): %s", strbuf);
@@ -523,7 +444,7 @@ named_os_changeuser(void) {
named_main_earlyfatal("setuid(): %s", strbuf); named_main_earlyfatal("setuid(): %s", strbuf);
} }
#if defined(HAVE_SYS_PRCTL_H) && defined(PR_SET_DUMPABLE) #if defined(HAVE_SYS_CAPABILITY_H)
/* /*
* Restore the ability of named to drop core after the setuid() * Restore the ability of named to drop core after the setuid()
* call has disabled it. * call has disabled it.
@@ -533,8 +454,7 @@ named_os_changeuser(void) {
named_main_earlywarning("prctl(PR_SET_DUMPABLE) failed: %s", named_main_earlywarning("prctl(PR_SET_DUMPABLE) failed: %s",
strbuf); strbuf);
} }
#endif
#if defined(HAVE_SYS_CAPABILITY_H) && !defined(HAVE_LINUXTHREADS)
linux_minprivs(); linux_minprivs();
#endif #endif
} }
@@ -548,7 +468,7 @@ ns_os_uid(void) {
void void
named_os_adjustnofile(void) { named_os_adjustnofile(void) {
#ifdef HAVE_LINUXTHREADS #if defined(__linux__)
isc_result_t result; isc_result_t result;
isc_resourcevalue_t newvalue; isc_resourcevalue_t newvalue;
@@ -566,15 +486,8 @@ named_os_adjustnofile(void) {
void void
named_os_minprivs(void) { named_os_minprivs(void) {
#ifdef HAVE_SYS_PRCTL_H #if defined(HAVE_SYS_CAPABILITY_H)
linux_keepcaps(); linux_keepcaps();
#endif
#ifdef HAVE_LINUXTHREADS
named_os_changeuser(); /* Call setuid() before threads are started */
#endif
#if defined(HAVE_SYS_CAPABILITY_H) && defined(HAVE_LINUXTHREADS)
linux_minprivs(); linux_minprivs();
#endif #endif
} }
@@ -759,21 +672,16 @@ named_os_openfile(const char *filename, mode_t mode, bool switch_user) {
free(f); free(f);
if (switch_user && runas_pw != NULL) { if (switch_user && runas_pw != NULL) {
#ifndef HAVE_LINUXTHREADS
gid_t oldgid = getgid(); gid_t oldgid = getgid();
#endif
/* Set UID/GID to the one we'll be running with eventually */ /* Set UID/GID to the one we'll be running with eventually */
setperms(runas_pw->pw_uid, runas_pw->pw_gid); setperms(runas_pw->pw_uid, runas_pw->pw_gid);
fd = safe_open(filename, mode, false); fd = safe_open(filename, mode, false);
#ifndef HAVE_LINUXTHREADS
/* Restore UID/GID to root */ /* Restore UID/GID to root */
setperms(0, oldgid); setperms(0, oldgid);
#endif /* HAVE_LINUXTHREADS */
if (fd == -1) { if (fd == -1) {
#ifndef HAVE_LINUXTHREADS
fd = safe_open(filename, mode, false); fd = safe_open(filename, mode, false);
if (fd != -1) { if (fd != -1) {
named_main_earlywarning("Required root " named_main_earlywarning("Required root "
@@ -786,13 +694,6 @@ named_os_openfile(const char *filename, mode_t mode, bool switch_user) {
named_main_earlywarning("Please check file and " named_main_earlywarning("Please check file and "
"directory permissions " "directory permissions "
"or reconfigure the filename."); "or reconfigure the filename.");
#else /* HAVE_LINUXTHREADS */
named_main_earlywarning("Could not open "
"'%s'.", filename);
named_main_earlywarning("Please check file and "
"directory permissions "
"or reconfigure the filename.");
#endif /* HAVE_LINUXTHREADS */
} }
} else { } else {
fd = safe_open(filename, mode, false); fd = safe_open(filename, mode, false);
@@ -846,11 +747,7 @@ named_os_writepidfile(const char *filename, bool first_time) {
cleanup_pidfile(); cleanup_pidfile();
return; return;
} }
#ifdef HAVE_LINUXTHREADS
pid = mainpid;
#else
pid = getpid(); pid = getpid();
#endif
if (fprintf(fh, "%ld\n", (long)pid) < 0) { if (fprintf(fh, "%ld\n", (long)pid) < 0) {
(*report)("fprintf() to pid file '%s' failed", filename); (*report)("fprintf() to pid file '%s' failed", filename);
(void)fclose(fh); (void)fclose(fh);
@@ -956,11 +853,7 @@ named_os_shutdownmsg(char *command, isc_buffer_t *text) {
return; return;
} }
#ifdef HAVE_LINUXTHREADS
pid = mainpid;
#else
pid = getpid(); pid = getpid();
#endif
(void)isc_buffer_printf(text, "pid: %ld", (long)pid); (void)isc_buffer_printf(text, "pid: %ld", (long)pid);
} }

View File

@@ -12,6 +12,7 @@
#include <config.h> #include <config.h>
#include <sys/param.h> #include <sys/param.h>
#include <sys/select.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
@@ -35,10 +36,6 @@
#include <dns/result.h> #include <dns/result.h>
#include <dns/zone.h> #include <dns/zone.h>
#ifdef ISC_PLATFORM_NEEDSYSSELECTH
#include <sys/select.h>
#endif
static int debug = 0; static int debug = 0;
static int quiet = 0; static int quiet = 0;
static int stats = 0; static int stats = 0;

View File

@@ -148,7 +148,6 @@ PYTHON=@PYTHON@
# #
# Determine if we support various optional features. # Determine if we support various optional features.
# #
CHECK_DSA=@CHECK_DSA@
HAVEXMLSTATS=@XMLSTATS@ HAVEXMLSTATS=@XMLSTATS@
HAVEJSONSTATS=@JSONSTATS@ HAVEJSONSTATS=@JSONSTATS@
ZLIB=@ZLIB@ ZLIB=@ZLIB@

View File

@@ -147,7 +147,6 @@ PYTHON=@PYTHON@
# #
# Determine if we support various optional features. # Determine if we support various optional features.
# #
CHECK_DSA=@CHECK_DSA@
HAVEXMLSTATS=@XMLSTATS@ HAVEXMLSTATS=@XMLSTATS@
HAVEJSONSTATS=@JSONSTATS@ HAVEJSONSTATS=@JSONSTATS@
ZLIB=@ZLIB@ ZLIB=@ZLIB@

View File

@@ -175,7 +175,7 @@ main(int argc, char **argv) {
int s; int s;
int n = -1; int n = -1;
int v6only = -1; int v6only = -1;
ISC_SOCKADDR_LEN_T len = sizeof(v6only); socklen_t len = sizeof(v6only);
s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
if (s >= 0) { if (s >= 0) {

View File

@@ -1 +0,0 @@
checkdsa.sh

View File

@@ -1,17 +0,0 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
if [ "@CHECK_DSA@" -eq 0 ]; then
exit 1
fi
if [ ! -r /dev/random -o ! -r /dev/urandom ]; then
exit 1
fi
exit 0

View File

@@ -135,22 +135,6 @@ rm -f K${zone}.+*+*.private
for alg in ECDSAP256SHA256 NSEC3RSASHA1 DSA for alg in ECDSAP256SHA256 NSEC3RSASHA1 DSA
do do
case $alg in
DSA)
$SHELL ../checkdsa.sh 2> /dev/null || continue
checkfile=../checkdsa
touch $checkfile ;;
ECDSAP256SHA256)
fail=0
$KEYGEN -q -a ecdsap256sha256 test > /dev/null 2>&1 || fail=1
rm -f Ktest*
[ $fail != 0 ] && continue
$SHELL ../checkdsa.sh 2> /dev/null || continue
checkfile=../checkecdsa
touch $checkfile ;;
*) ;;
esac
k1=`$KEYGEN -q -a $alg -b 1024 -n zone -f KSK $zone` k1=`$KEYGEN -q -a $alg -b 1024 -n zone -f KSK $zone`
k2=`$KEYGEN -q -a $alg -b 1024 -n zone $zone` k2=`$KEYGEN -q -a $alg -b 1024 -n zone $zone`
k3=`$KEYGEN -q -a $alg -b 1024 -n zone $zone` k3=`$KEYGEN -q -a $alg -b 1024 -n zone $zone`
@@ -161,9 +145,9 @@ do
rm -f $k1.private rm -f $k1.private
mv $k1.key a-file mv $k1.key a-file
$IMPORTKEY -P now -D now+3600 -f a-file $zone > /dev/null 2>&1 || $IMPORTKEY -P now -D now+3600 -f a-file $zone > /dev/null 2>&1 ||
( echo "importkey failed: $alg"; rm -f $checkfile ) ( echo "importkey failed: $alg" )
rm -f $k2.private rm -f $k2.private
mv $k2.key a-file mv $k2.key a-file
$IMPORTKEY -f a-file $zone > /dev/null 2>&1 || $IMPORTKEY -f a-file $zone > /dev/null 2>&1 ||
( echo "importkey failed: $alg"; rm -f $checkfile ) ( echo "importkey failed: $alg" )
done done

View File

@@ -1,84 +1,4 @@
/* config.h.in. Generated from configure.in by autoheader. */ /* config.h.in. Generated from configure.in by autoheader. */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file */
/***
*** This file is not to be included by any public header files, because
*** it does not get installed.
***/
/** define if your system needs pthread_init() before using pthreads */
#undef NEED_PTHREAD_INIT
/** define if your system has sigwait() */
#undef HAVE_SIGWAIT
/** define if sigwait() is the UnixWare flavor */
#undef HAVE_UNIXWARE_SIGWAIT
/** define if LinuxThreads is in use */
#undef HAVE_LINUXTHREADS
/** define if sysconf() is available */
#undef HAVE_SYSCONF
/** define if sysctlbyname() is available */
#undef HAVE_SYSCTLBYNAME
/** define if catgets() is available */
#undef HAVE_CATGETS
/** define if getifaddrs() exists */
#undef HAVE_GETIFADDRS
/** define if you have the NET_RT_IFLIST sysctl variable and sys/sysctl.h */
#undef HAVE_IFLIST_SYSCTL
/** define if tzset() is available */
#undef HAVE_TZSET
/**
* define if pthread_setconcurrency() should be called to tell the
* OS how many threads we might want to run.
*/
#undef CALL_PTHREAD_SETCONCURRENCY
/** define if flockfile() is available */
#undef HAVE_FLOCKFILE
/** define if getc_unlocked() is available */
#undef HAVE_GETCUNLOCKED
/** define if the system has a random number generating device */
#undef PATH_RANDOMDEV
/** define if pthread_attr_getstacksize() is available */
#undef HAVE_PTHREAD_ATTR_GETSTACKSIZE
/** define if pthread_attr_setstacksize() is available */
#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
/** define if you have strerror in the C library. */
#undef HAVE_STRERROR
/* Define to the length type used by the socket API (socklen_t, size_t, int). */
#undef ISC_SOCKADDR_LEN_T
/* Define if threads need PTHREAD_SCOPE_SYSTEM */
#undef NEED_PTHREAD_SCOPE_SYSTEM
/* Define to 1 if you have the uname library function. */
#undef HAVE_UNAME
/* Define if building universal (internal helper macro) */ /* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD #undef AC_APPLE_UNIVERSAL_BUILD
@@ -110,6 +30,9 @@
/* Define to enable rpz nsip rules. */ /* Define to enable rpz nsip rules. */
#undef ENABLE_RPZ_NSIP #undef ENABLE_RPZ_NSIP
/* define if you want TCP_FASTOPEN enabled if available */
#undef ENABLE_TCP_FASTOPEN
/* Solaris hack to get select_large_fdset. */ /* Solaris hack to get select_large_fdset. */
#undef FD_SETSIZE #undef FD_SETSIZE
@@ -137,6 +60,9 @@
/* Define to 1 if the compiler supports __builtin_expect. */ /* Define to 1 if the compiler supports __builtin_expect. */
#undef HAVE_BUILTIN_EXPECT #undef HAVE_BUILTIN_EXPECT
/* Define to 1 if you have the `catgets' function. */
#undef HAVE_CATGETS
/* Define to 1 if you have the `chroot' function. */ /* Define to 1 if you have the `chroot' function. */
#undef HAVE_CHROOT #undef HAVE_CHROOT
@@ -188,6 +114,9 @@
/* Define to 1 if you have the <edit/readline/readline.h> header file. */ /* Define to 1 if you have the <edit/readline/readline.h> header file. */
#undef HAVE_EDIT_READLINE_READLINE_H #undef HAVE_EDIT_READLINE_READLINE_H
/* Define to 1 if you have the `epoll_create1' function. */
#undef HAVE_EPOLL_CREATE1
/* Define to 1 if you have the `EVP_aes_128_ecb' function. */ /* Define to 1 if you have the `EVP_aes_128_ecb' function. */
#undef HAVE_EVP_AES_128_ECB #undef HAVE_EVP_AES_128_ECB
@@ -251,7 +180,7 @@
/* Define to 1 if you have the <idn2.h> header file. */ /* Define to 1 if you have the <idn2.h> header file. */
#undef HAVE_IDN2_H #undef HAVE_IDN2_H
/* Define to 1 if you have the if_nametoindex function. */ /* Define to 1 if you have the `if_nametoindex' function. */
#undef HAVE_IF_NAMETOINDEX #undef HAVE_IF_NAMETOINDEX
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
@@ -266,13 +195,16 @@
/* Define to 1 if you have the <kerberosv5/krb5.h> header file. */ /* Define to 1 if you have the <kerberosv5/krb5.h> header file. */
#undef HAVE_KERBEROSV5_KRB5_H #undef HAVE_KERBEROSV5_KRB5_H
/* Define to 1 if you have the `kqueue' function. */
#undef HAVE_KQUEUE
/* Define to 1 if you have the <krb5.h> header file. */ /* Define to 1 if you have the <krb5.h> header file. */
#undef HAVE_KRB5_H #undef HAVE_KRB5_H
/* Define to 1 if you have the <krb5/krb5.h> header file. */ /* Define to 1 if you have the <krb5/krb5.h> header file. */
#undef HAVE_KRB5_KRB5_H #undef HAVE_KRB5_KRB5_H
/* if system have backtrace function */ /* define if system have backtrace function */
#undef HAVE_LIBCTRACE #undef HAVE_LIBCTRACE
/* Define if libidn2 was found */ /* Define if libidn2 was found */
@@ -389,6 +321,9 @@
/* Define to 1 if you have the `sigwait' function. */ /* Define to 1 if you have the `sigwait' function. */
#undef HAVE_SIGWAIT #undef HAVE_SIGWAIT
/* define if struct stat has st_mtim.tv_nsec field */
#undef HAVE_STAT_NSEC
/* Define to 1 if you have the <stdatomic.h> header file. */ /* Define to 1 if you have the <stdatomic.h> header file. */
#undef HAVE_STDATOMIC_H #undef HAVE_STDATOMIC_H
@@ -404,6 +339,18 @@
/* Define to 1 if you have the <string.h> header file. */ /* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H #undef HAVE_STRING_H
/* Define to 1 if you have the `strlcat' function. */
#undef HAVE_STRLCAT
/* Define to 1 if you have the `strlcpy' function. */
#undef HAVE_STRLCPY
/* Define to 1 if you have the `sysconf' function. */
#undef HAVE_SYSCONF
/* Define to 1 if you have the `sysctlbyname' function. */
#undef HAVE_SYSCTLBYNAME
/* Define to 1 if you have the <sys/capability.h> header file. */ /* Define to 1 if you have the <sys/capability.h> header file. */
#undef HAVE_SYS_CAPABILITY_H #undef HAVE_SYS_CAPABILITY_H
@@ -416,9 +363,6 @@
/* Define to 1 if you have the <sys/param.h> header file. */ /* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H #undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/prctl.h> header file. */
#undef HAVE_SYS_PRCTL_H
/* Define to 1 if you have the <sys/select.h> header file. */ /* Define to 1 if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H #undef HAVE_SYS_SELECT_H
@@ -452,12 +396,18 @@
/* Define if Thread-Local Storage is available */ /* Define if Thread-Local Storage is available */
#undef HAVE_TLS #undef HAVE_TLS
/* Define to 1 if you have the `tzset' function. */
#undef HAVE_TZSET
/* Define to 1 if you have the <uchar.h> header file. */ /* Define to 1 if you have the <uchar.h> header file. */
#undef HAVE_UCHAR_H #undef HAVE_UCHAR_H
/* Define to 1 if the system has the type `uintptr_t'. */ /* Define to 1 if the system has the type `uintptr_t'. */
#undef HAVE_UINTPTR_T #undef HAVE_UINTPTR_T
/* define if uname is available */
#undef HAVE_UNAME
/* Define to 1 if you have the <unistd.h> header file. */ /* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
@@ -539,6 +489,9 @@
/* Define to use large-system tuning. */ /* Define to use large-system tuning. */
#undef TUNE_LARGE #undef TUNE_LARGE
/* define if we can use backtrace */
#undef USE_BACKTRACE
/* Enable DNS Response Policy Service API */ /* Enable DNS Response Policy Service API */
#undef USE_DNSRPS #undef USE_DNSRPS

View File

@@ -67,24 +67,15 @@
/* define on DEC OSF to enable 4.4BSD style sa_len support */ /* define on DEC OSF to enable 4.4BSD style sa_len support */
/* #undef _SOCKADDR_LEN */ /* #undef _SOCKADDR_LEN */
/* define if your system needs pthread_init() before using pthreads */
/* #undef NEED_PTHREAD_INIT */
/* define if your system has sigwait() */ /* define if your system has sigwait() */
/* #undef HAVE_SIGWAIT */ /* #undef HAVE_SIGWAIT */
/* define on Solaris to get sigwait() to work using pthreads semantics */ /* define on Solaris to get sigwait() to work using pthreads semantics */
/* #undef _POSIX_PTHREAD_SEMANTICS */ /* #undef _POSIX_PTHREAD_SEMANTICS */
/* define if LinuxThreads is in use */
/* #undef HAVE_LINUXTHREADS */
/* define if catgets() is available */ /* define if catgets() is available */
/* #undef HAVE_CATGETS */ /* #undef HAVE_CATGETS */
/* define if you have the NET_RT_IFLIST sysctl variable. */
#define HAVE_IFLIST_SYSCTL 1
/* define if you need to #define _XPG4_2 before including sys/socket.h */ /* define if you need to #define _XPG4_2 before including sys/socket.h */
/* #undef NEED_XPG4_2_BEFORE_SOCKET_H */ /* #undef NEED_XPG4_2_BEFORE_SOCKET_H */
@@ -236,9 +227,6 @@ typedef __int64 off_t;
*/ */
#include <versions.h> #include <versions.h>
/* We actually are using the CryptAPI and not a device */
#define PATH_RANDOMDEV "CryptAPI"
#include <stddef.h> #include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
@@ -367,6 +355,9 @@ typedef __int64 off_t;
/* Large system tuning */ /* Large system tuning */
@TUNE_LARGE@ @TUNE_LARGE@
/* define if we can use backtrace */
@USE_BACKTRACE@
/* the default value of dnssec-validation option */ /* the default value of dnssec-validation option */
@VALIDATION_DEFAULT@ @VALIDATION_DEFAULT@

763
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -458,9 +458,10 @@ AC_CHECK_HEADERS([threads.h],
AC_C_CONST AC_C_CONST
AC_C_INLINE AC_C_INLINE
AC_C_VOLATILE AC_C_VOLATILE
AC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
AC_C_FLEXIBLE_ARRAY_MEMBER AC_C_FLEXIBLE_ARRAY_MEMBER
AC_CHECK_FUNCS([sysctlbyname])
# #
# Check for the existence of mmap to enable the fast format zones # Check for the existence of mmap to enable the fast format zones
# #
@@ -476,43 +477,29 @@ AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T AC_TYPE_SSIZE_T
AC_TYPE_UINTPTR_T AC_TYPE_UINTPTR_T
AC_CHECK_TYPE(socklen_t,
[AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
[
AC_TRY_COMPILE(
[
#include <sys/types.h>
#include <sys/socket.h>
int getsockname(int, struct sockaddr *, size_t *);
],[],
[AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
[AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
],
[
#include <sys/types.h>
#include <sys/socket.h>
])
AC_SUBST(ISC_SOCKADDR_LEN_T)
AC_HEADER_TIME AC_HEADER_TIME
# #
# check for uname library routine # check for uname library routine
# #
AC_MSG_CHECKING(for uname) AC_MSG_CHECKING([for uname])
AC_TRY_COMPILE([ AC_COMPILE_IFELSE(
#include <sys/utsname.h> [AC_LANG_PROGRAM(
#include <stdio.h> [[#include <sys/utsname.h>
], #include <stdio.h>
[ ]],
struct utsname uts; [[
uname(&uts); struct utsname uts;
printf("running on %s %s %s for %s\n", uname(&uts);
uts.sysname, uts.release, uts.version, uts.machine); printf("running on %s %s %s for %s\n",
], uts.sysname, uts.release, uts.version, uts.machine);
[AC_MSG_RESULT(yes) ]])],
AC_DEFINE(HAVE_UNAME)], [AC_MSG_RESULT(yes)
[AC_MSG_RESULT(no) AC_DEFINE([HAVE_UNAME], [1], [define if uname is available])
AC_MSG_WARN([uname is not correctly supported])]) ],
[AC_MSG_RESULT(no)
AC_MSG_WARN([uname is not correctly supported])
])
# #
# check for GCC noreturn attribute # check for GCC noreturn attribute
@@ -528,142 +515,38 @@ AC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
AC_SUBST(ISC_PLATFORM_NORETURN_PRE) AC_SUBST(ISC_PLATFORM_NORETURN_PRE)
AC_SUBST(ISC_PLATFORM_NORETURN_POST) AC_SUBST(ISC_PLATFORM_NORETURN_POST)
#
# check if we have lifconf
#
AC_MSG_CHECKING(for struct lifconf)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
],
[
struct lifconf lifconf;
lifconf.lifc_len = 0;
]
,
[AC_MSG_RESULT(yes)
ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
AC_SUBST(ISC_PLATFORM_HAVELIFCONF)
# #
# check if we have kqueue # check if we have kqueue
# #
AC_ARG_ENABLE(kqueue, AC_ARG_ENABLE([kqueue],
AS_HELP_STRING([--enable-kqueue], [AS_HELP_STRING([--enable-kqueue],
[use BSD kqueue when available [default=yes]]), [use BSD kqueue when available [default=yes]])],
want_kqueue="$enableval", want_kqueue="yes") [], enable_kqueue="yes")
case $want_kqueue in
yes) AS_IF([test "$enable_kqueue" = "yes"],
AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no) [AC_CHECK_FUNCS([kqueue])])
case $ac_cv_have_kqueue in
yes)
ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
;;
*)
ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
;;
esac
;;
*)
ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
;;
esac
AC_SUBST(ISC_PLATFORM_HAVEKQUEUE)
# #
# check if we have epoll. Linux kernel 2.4 has epoll_create() which fails, # check if we have epoll. Linux kernel 2.4 has epoll_create() which fails,
# so we need to try running the code, not just test its existence. # so we need to try running the code, not just test its existence.
# #
AC_ARG_ENABLE(epoll, AC_ARG_ENABLE([epoll],
AS_HELP_STRING([--enable-epoll], [AS_HELP_STRING([--enable-epoll],
[use Linux epoll when available [default=auto]]), [use Linux epoll when available [default=auto]])],
want_epoll="$enableval", want_epoll="auto") [], [enable_epoll="yes"])
case $want_epoll in
auto) AS_IF([test "$enable_epoll" = "yes"],
AC_MSG_CHECKING(epoll support) [AC_CHECK_FUNCS([epoll_create1])])
AC_TRY_RUN([
#include <sys/epoll.h>
int main() {
if (epoll_create(1) < 0)
return (1);
return (0);
}
],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"])
;;
yes)
ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
;;
*)
ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
;;
esac
AC_SUBST(ISC_PLATFORM_HAVEEPOLL)
# #
# check if we support /dev/poll # check if we support /dev/poll
# #
AC_ARG_ENABLE(devpoll, AC_ARG_ENABLE([devpoll],
AS_HELP_STRING([--enable-devpoll], [AS_HELP_STRING([--enable-devpoll],
[use /dev/poll when available [default=yes]]), [use /dev/poll when available [default=yes]])],
want_devpoll="$enableval", want_devpoll="yes") [], [enable_devpoll="yes"])
case $want_devpoll in AS_IF([test "$enable_devpoll" = "yes"],
yes) [AC_CHECK_HEADERS([sys/devpoll.h devpoll.h])])
AC_CHECK_HEADERS(sys/devpoll.h devpoll.h,
ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
,
ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
)
;;
*)
ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
;;
esac
AC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
#
# check if we need to #include sys/select.h explicitly
#
case $ac_cv_header_unistd_h in
yes)
AC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
AC_TRY_COMPILE([
#include <sys/types.h> /* Ultrix */
#include <unistd.h>],
[fd_set read_set; return (0);],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"],
[AC_MSG_RESULT(no)
case $ac_cv_header_sys_select_h in
yes)
ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
;;
no)
AC_MSG_ERROR([need either working unistd.h or sys/select.h])
;;
esac
])
;;
no)
case $ac_cv_header_sys_select_h in
yes)
ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
;;
no)
AC_MSG_ERROR([need either unistd.h or sys/select.h])
;;
esac
;;
esac
AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
# #
# Find the machine's endian flavor. # Find the machine's endian flavor.
@@ -767,22 +650,6 @@ esac
AC_SUBST(GEOIPLINKSRCS) AC_SUBST(GEOIPLINKSRCS)
AC_SUBST(GEOIPLINKOBJS) AC_SUBST(GEOIPLINKOBJS)
# XXXOND: Change this to deterministic DSA generation
#
# Only check dsa signature generation on these platforms when performing
# system tests.
#
CHECK_DSA=0
if grep "#define PATH_RANDOMDEV " confdefs.h > /dev/null
then
case "$host" in
*darwin*|*freebsd*)
CHECK_DSA=1
;;
esac
fi
AC_SUBST(CHECK_DSA)
# #
# Do we have arc4random(), etc ? # Do we have arc4random(), etc ?
# #
@@ -834,34 +701,6 @@ AC_CHECK_HEADERS([sched.h])
AC_SEARCH_LIBS([sched_yield],[rt]) AC_SEARCH_LIBS([sched_yield],[rt])
AC_CHECK_FUNCS([sched_yield pthread_yield pthread_yield_np]) AC_CHECK_FUNCS([sched_yield pthread_yield pthread_yield_np])
#
# Additional OS-specific issues related to pthreads and sigwait.
#
case "$host" in
#
# One more place to look for sigwait.
#
*-freebsd*)
AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
case $host in
*-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
*-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
;;
*-freebsd6.*)
AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
;;
esac
;;
#
# LinuxThreads requires some changes to the way we
# deal with signals.
#
*-linux*)
AC_DEFINE(HAVE_LINUXTHREADS)
;;
esac
# Look for functions relating to thread naming # Look for functions relating to thread naming
AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np]) AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np])
AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>]) AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>])
@@ -869,7 +708,7 @@ AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>])
# #
# Look for sysconf to allow detection of the number of processors. # Look for sysconf to allow detection of the number of processors.
# #
AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),) AC_CHECK_FUNCS([sysconf])
AC_SUBST(ALWAYS_DEFINES) AC_SUBST(ALWAYS_DEFINES)
@@ -1637,14 +1476,6 @@ AC_SUBST(ZLIB)
# #
AC_CHECK_LIB(scf, smf_enable_instance) AC_CHECK_LIB(scf, smf_enable_instance)
#
# flockfile is usually provided by pthreads, but we may want to use it
# even if compiled with --disable-threads. getc_unlocked might also not
# be defined.
#
AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
AC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
# #
# Large File # Large File
# #
@@ -1714,7 +1545,7 @@ AC_SUBST(MKDEPPROG)
# #
# NLS # NLS
# #
AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),) AC_CHECK_FUNCS([catgets])
# #
# -lxnet buys us one big porting headache... standards, gotta love 'em. # -lxnet buys us one big porting headache... standards, gotta love 'em.
@@ -1811,22 +1642,20 @@ esac
# enable/disable dumping stack backtrace. Also check if the system supports # enable/disable dumping stack backtrace. Also check if the system supports
# glibc-compatible backtrace() function. # glibc-compatible backtrace() function.
# #
AC_ARG_ENABLE(backtrace, AC_ARG_ENABLE([backtrace],
AS_HELP_STRING([--enable-backtrace], [AS_HELP_STRING([--enable-backtrace],
[log stack backtrace on abort [default=yes]]), [log stack backtrace on abort [default=yes]])],
want_backtrace="$enableval", want_backtrace="yes") [], [enable_backtrace="yes"])
case $want_backtrace in
yes) AS_IF([test "$enable_backtrace" = "yes"],
ISC_PLATFORM_USEBACKTRACE="#define ISC_PLATFORM_USEBACKTRACE 1" [AC_DEFINE([USE_BACKTRACE], [1], [define if we can use backtrace])
AC_TRY_LINK([#include <execinfo.h>], AC_LINK_IFELSE(
[return (backtrace((void **)0, 0));], [AC_LANG_PROGRAM(
[AC_DEFINE([HAVE_LIBCTRACE], [], [if system have backtrace function])],) [[#include <execinfo.h>]],
;; [[return (backtrace((void **)0, 0));]]
*) )],
ISC_PLATFORM_USEBACKTRACE="#undef ISC_PLATFORM_USEBACKTRACE" [AC_DEFINE([HAVE_LIBCTRACE], [1], [define if system have backtrace function])]
;; )])
esac
AC_SUBST(ISC_PLATFORM_USEBACKTRACE)
AC_ARG_ENABLE(symtable, AC_ARG_ENABLE(symtable,
AS_HELP_STRING([--enable-symtable], AS_HELP_STRING([--enable-symtable],
@@ -1916,74 +1745,24 @@ AC_COMPILE_IFELSE(
[AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])],
[AC_MSG_FAILURE([IPv6 support is mandatory])]) [AC_MSG_FAILURE([IPv6 support is mandatory])])
AC_MSG_CHECKING([for struct if_laddrreq])
AC_TRY_LINK([
#include <sys/types.h>
#include <net/if6.h>
],[ struct if_laddrreq a; ],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
AC_MSG_CHECKING([for struct if_laddrconf])
AC_TRY_LINK([
#include <sys/types.h>
#include <net/if6.h>
],[ struct if_laddrconf a; ],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
# #
# Allow forcibly disabling TCP Fast Open support as autodetection might yield # Allow forcibly disabling TCP Fast Open support as autodetection might yield
# confusing results on some systems (e.g. FreeBSD; see set_tcp_fastopen() # confusing results on some systems (e.g. FreeBSD; see set_tcp_fastopen()
# comment in lib/isc/unix/socket.c). # comment in lib/isc/unix/socket.c).
# #
AC_ARG_ENABLE(tcp_fastopen, AC_ARG_ENABLE([tcp_fastopen],
AS_HELP_STRING([--disable-tcp-fastopen], [AS_HELP_STRING([--disable-tcp-fastopen],
[disable TCP Fast Open support [default=autodetect]])) [disable TCP Fast Open support [default=yes]])],
[], [enable_tcp_fastopen="yes"])
AC_MSG_CHECKING(for TCP_FASTOPEN socket option) AS_IF([test "$enable_tcp_fastopen" = "yes"],
case "$enable_tcp_fastopen" in [AC_DEFINE([ENABLE_TCP_FASTOPEN], [1], [define if you want TCP_FASTOPEN enabled if available])])
yes|''|autodetect)
AC_EGREP_CPP(has_tfo, [
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/tcp.h>
#ifdef TCP_FASTOPEN
int has_tfo() { return (0); }
#endif
],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_HAVETFO="#define ISC_PLATFORM_HAVETFO 1"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_HAVETFO="#undef ISC_PLATFORM_HAVETFO"])
;;
no)
AC_MSG_RESULT(disabled)
ISC_PLATFORM_HAVETFO="#undef ISC_PLATFORM_HAVETFO"
;;
esac
AC_SUBST(ISC_PLATFORM_HAVETFO)
# #
# Check for some other useful functions that are not ever-present. # Check for some other useful functions that are not ever-present.
# #
AC_CHECK_FUNC(strlcpy, AC_CHECK_FUNCS([strlcpy strlcat])
[ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
[ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
AC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
AC_CHECK_FUNC(strlcat,
[ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
[ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
AC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
AC_SUBST(READLINE_LIB) AC_SUBST(READLINE_LIB)
AC_ARG_WITH(readline, AC_ARG_WITH(readline,
@@ -2112,8 +1891,6 @@ AS_IF([test "$enable_linux_caps" = "yes"],
[AC_MSG_RESULT([no])]) [AC_MSG_RESULT([no])])
AC_SUBST([LIBCAP_LIBS]) AC_SUBST([LIBCAP_LIBS])
AC_CHECK_HEADERS(sys/prctl.h)
AC_CHECK_HEADERS(sys/un.h, AC_CHECK_HEADERS(sys/un.h,
ISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1" ISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
, ,
@@ -2131,7 +1908,7 @@ esac
# #
# Time Zone Stuff # Time Zone Stuff
# #
AC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET)) AC_CHECK_FUNCS([tzset])
AC_MSG_CHECKING(for optarg declaration) AC_MSG_CHECKING(for optarg declaration)
AC_TRY_COMPILE([ AC_TRY_COMPILE([
@@ -2146,51 +1923,19 @@ AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
# #
# Check for nanoseconds in file stats # Check for nanoseconds in file stats
# #
AC_MSG_CHECKING(st_mtim.tv_nsec) AC_MSG_CHECKING([for st_mtim.tv_nsec])
AC_TRY_COMPILE([#include <sys/fcntl.h>],[struct stat s; return(s.st_mtim.tv_nsec);], AC_COMPILE_IFELSE(
[AC_MSG_RESULT(yes) [AC_LANG_PROGRAM(
ISC_PLATFORM_HAVESTATNSEC="#define ISC_PLATFORM_HAVESTATNSEC 1"], [[#include <sys/fcntl.h>]],
[AC_MSG_RESULT(no) [[struct stat s;
ISC_PLATFORM_HAVESTATNSEC="#undef ISC_PLATFORM_HAVESTATNSEC"]) return(s.st_mtim.tv_nsec);
AC_SUBST(ISC_PLATFORM_HAVESTATNSEC) ]])],
[AC_DEFINE([HAVE_STAT_NSEC], [1], [define if struct stat has st_mtim.tv_nsec field])])
#
# Microsoft has their own way of handling shared libraries that requires
# additional qualifiers on extern variables. Unix systems don't need it.
#
AC_SUBST(ISC_PLATFORM_USEDECLSPEC)
ISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
AC_SUBST(IRS_PLATFORM_USEDECLSPEC)
IRS_PLATFORM_USEDECLSPEC="#undef IRS_PLATFORM_USEDECLSPEC"
#
# Random remaining OS-specific issues involving compiler warnings.
# XXXDCL print messages to indicate some compensation is being done?
#
AC_CHECK_HEADERS(strings.h,
ISC_PLATFORM_HAVESTRINGSH="#define ISC_PLATFORM_HAVESTRINGSH 1"
,
ISC_PLATFORM_HAVESTRINGSH="#undef ISC_PLATFORM_HAVESTRINGSH"
)
AC_SUBST(ISC_PLATFORM_HAVESTRINGSH)
# #
# Check for if_nametoindex() for IPv6 scoped addresses support # Check for if_nametoindex() for IPv6 scoped addresses support
# #
AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes, AC_CHECK_FUNCS([if_nametoindex])
ac_cv_have_if_nametoindex=no)
case $ac_cv_have_if_nametoindex in
yes)
ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
AC_DEFINE(HAVE_IF_NAMETOINDEX, 1,
[Define to 1 if you have the if_nametoindex function.])
;;
*)
ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
;;
esac
AC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
AC_CHECK_FUNCS(nanosleep usleep explicit_bzero) AC_CHECK_FUNCS(nanosleep usleep explicit_bzero)
@@ -2277,55 +2022,6 @@ if test "yes" = "$have_builtin_clz"; then
AC_DEFINE(HAVE_BUILTIN_CLZ, 1, [Define to 1 if the compiler supports __builtin_clz.]) AC_DEFINE(HAVE_BUILTIN_CLZ, 1, [Define to 1 if the compiler supports __builtin_clz.])
fi fi
#
# CPU relax (for spin locks)
#
case "$host" in
[i[3456]86-*])
# x86_32
AC_MSG_CHECKING([if asm("rep; nop"); works])
AC_TRY_COMPILE(,[asm("rep; nop");],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"rep; nop\")"],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT([cross compile, assume yes])
ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"rep; nop\")"])
;;
x86_64-*|amd64-*)
# x86_64
AC_MSG_CHECKING([if asm("rep; nop"); works])
AC_TRY_COMPILE(,[asm("rep; nop");],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"rep; nop\")"],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT([cross compile, assume yes])
ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"rep; nop\")"])
;;
ia64-*)
# ia64
AC_MSG_CHECKING([if asm("hint @pause"); works])
AC_TRY_COMPILE(,[asm("hint @pause");],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"hint @pause\")"],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT([cross compile, assume yes])
ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"hint @pause\")"])
;;
sparc-*)
# sparc
AC_MSG_CHECKING([if cpu_relax(); or __cpu_relax(); works])
AC_CHECK_FUNC(cpu_relax,
[AC_MSG_RESULT(yes)
ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP cpu_relax()"],
[AC_CHECK_FUNC(__cpu_relax,
[AC_MSG_RESULT(yes)
ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP __cpu_relax()"],
[AC_MSG_RESULT(no)])])
;;
esac
AC_SUBST(ISC_PLATFORM_BUSYWAITNOP)
# #
# Activate "rrset-order fixed" or not? # Activate "rrset-order fixed" or not?
# #
@@ -3329,7 +3025,6 @@ AC_CONFIG_FILES([
bin/tests/system/dlzexternal/ns1/dlzs.conf bin/tests/system/dlzexternal/ns1/dlzs.conf
bin/tests/system/dyndb/Makefile bin/tests/system/dyndb/Makefile
bin/tests/system/dyndb/driver/Makefile bin/tests/system/dyndb/driver/Makefile
bin/tests/system/inline/checkdsa.sh
bin/tests/system/pipelined/Makefile bin/tests/system/pipelined/Makefile
bin/tests/system/rndc/Makefile bin/tests/system/rndc/Makefile
bin/tests/system/rpz/Makefile bin/tests/system/rpz/Makefile

View File

@@ -18,15 +18,7 @@
***** Platform-dependent defines. ***** Platform-dependent defines.
*****/ *****/
#ifndef IRS_PLATFORM_USEDECLSPEC
#define LIBIRS_EXTERNAL_DATA #define LIBIRS_EXTERNAL_DATA
#else
#ifdef LIBIRS_EXPORTS
#define LIBIRS_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBIRS_EXTERNAL_DATA __declspec(dllimport)
#endif
#endif
/* /*
* Tell Emacs to use C mode on this file. * Tell Emacs to use C mode on this file.

View File

@@ -18,15 +18,11 @@
***** Platform-dependent defines. ***** Platform-dependent defines.
*****/ *****/
#ifndef IRS_PLATFORM_USEDECLSPEC
#define LIBIRS_EXTERNAL_DATA
#else
#ifdef LIBIRS_EXPORTS #ifdef LIBIRS_EXPORTS
#define LIBIRS_EXTERNAL_DATA __declspec(dllexport) #define LIBIRS_EXTERNAL_DATA __declspec(dllexport)
#else #else
#define LIBIRS_EXTERNAL_DATA __declspec(dllimport) #define LIBIRS_EXTERNAL_DATA __declspec(dllimport)
#endif #endif
#endif
/* /*
* Tell Emacs to use C mode on this file. * Tell Emacs to use C mode on this file.

View File

@@ -24,7 +24,7 @@
#include <isc/result.h> #include <isc/result.h>
#include <isc/util.h> #include <isc/util.h>
#ifdef ISC_PLATFORM_USEBACKTRACE #ifdef USE_BACKTRACE
/* /*
* Getting a back trace of a running process is tricky and highly platform * Getting a back trace of a running process is tricky and highly platform
* dependent. Our current approach is as follows: * dependent. Our current approach is as follows:
@@ -52,9 +52,9 @@
#else #else
#define BACKTRACE_DISABLED #define BACKTRACE_DISABLED
#endif /* HAVE_LIBCTRACE */ #endif /* HAVE_LIBCTRACE */
#else /* !ISC_PLATFORM_USEBACKTRACE */ #else /* USE_BACKTRACE */
#define BACKTRACE_DISABLED #define BACKTRACE_DISABLED
#endif /* ISC_PLATFORM_USEBACKTRACE */ #endif /* USE_BACKTRACE */
#ifdef BACKTRACE_LIBC #ifdef BACKTRACE_LIBC
isc_result_t isc_result_t

View File

@@ -32,80 +32,10 @@
#define ISC_STRERRORSIZE 128 #define ISC_STRERRORSIZE 128
/***
*** Network.
***/
/*! \brief
* Define if the system has struct lifconf which is a extended struct ifconf
* for IPv6.
*/
@ISC_PLATFORM_HAVELIFCONF@
/*! \brief
* Define if the system has struct if_laddrconf which is a extended struct
* ifconf for IPv6.
*/
@ISC_PLATFORM_HAVEIF_LADDRCONF@
/*! \brief
* Define if the system has struct if_laddrreq.
*/
@ISC_PLATFORM_HAVEIF_LADDRREQ@
/*! \brief
* Define if the system supports if_nametoindex.
*/
@ISC_PLATFORM_HAVEIFNAMETOINDEX@
/*! \brief
* Define if the system has TCP_FASTOPEN socket option.
*/
@ISC_PLATFORM_HAVETFO@
/*! \brief
* Define if the system supports kqueue multiplexing
*/
@ISC_PLATFORM_HAVEKQUEUE@
/*! \brief
* Define if the system supports epoll multiplexing
*/
@ISC_PLATFORM_HAVEEPOLL@
/*! \brief
* Define if the system supports /dev/poll multiplexing
*/
@ISC_PLATFORM_HAVEDEVPOLL@
/*! \brief
* Define if we want to log backtrace
*/
@ISC_PLATFORM_USEBACKTRACE@
/*
*** Printing.
***/
/*
* If the system needs strlcpy(), ISC_PLATFORM_NEEDSTRLCPY will be defined.
*/
@ISC_PLATFORM_NEEDSTRLCPY@
/*
* If the system needs strlcat(), ISC_PLATFORM_NEEDSTRLCAT will be defined.
*/
@ISC_PLATFORM_NEEDSTRLCAT@
/*** /***
*** Miscellaneous. *** Miscellaneous.
***/ ***/
/*
* Defined if unistd.h does not cause fd_set to be delared.
*/
@ISC_PLATFORM_NEEDSYSSELECTH@
/* /*
* Defined to <gssapi.h> or <gssapi/gssapi.h> for how to include * Defined to <gssapi.h> or <gssapi/gssapi.h> for how to include
* the GSSAPI header. * the GSSAPI header.
@@ -124,31 +54,11 @@
*/ */
@ISC_PLATFORM_KRB5HEADER@ @ISC_PLATFORM_KRB5HEADER@
/*
* Define if the system has nanosecond-level accuracy in file stats.
*/
@ISC_PLATFORM_HAVESTATNSEC@
/*
* Used to control how extern data is linked; needed for Win32 platforms.
*/
@ISC_PLATFORM_USEDECLSPEC@
/* /*
* Define if the platform has <sys/un.h>. * Define if the platform has <sys/un.h>.
*/ */
@ISC_PLATFORM_HAVESYSUNH@ @ISC_PLATFORM_HAVESYSUNH@
/*
* Define with the busy wait nop asm or function call.
*/
@ISC_PLATFORM_BUSYWAITNOP@
/*
* Define if the platform has <strings.h>.
*/
@ISC_PLATFORM_HAVESTRINGSH@
/* /*
* Defines for the noreturn attribute. * Defines for the noreturn attribute.
*/ */
@@ -159,7 +69,6 @@
*** Windows dll support. *** Windows dll support.
***/ ***/
#ifndef ISC_PLATFORM_USEDECLSPEC
#define LIBISC_EXTERNAL_DATA #define LIBISC_EXTERNAL_DATA
#define LIBDNS_EXTERNAL_DATA #define LIBDNS_EXTERNAL_DATA
#define LIBISCCC_EXTERNAL_DATA #define LIBISCCC_EXTERNAL_DATA
@@ -167,43 +76,6 @@
#define LIBNS_EXTERNAL_DATA #define LIBNS_EXTERNAL_DATA
#define LIBBIND9_EXTERNAL_DATA #define LIBBIND9_EXTERNAL_DATA
#define LIBTESTS_EXTERNAL_DATA #define LIBTESTS_EXTERNAL_DATA
#else /*! \brief ISC_PLATFORM_USEDECLSPEC */
#ifdef LIBISC_EXPORTS
#define LIBISC_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBISC_EXTERNAL_DATA __declspec(dllimport)
#endif
#ifdef LIBDNS_EXPORTS
#define LIBDNS_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBDNS_EXTERNAL_DATA __declspec(dllimport)
#endif
#ifdef LIBISCCC_EXPORTS
#define LIBISCCC_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBISCCC_EXTERNAL_DATA __declspec(dllimport)
#endif
#ifdef LIBISCCFG_EXPORTS
#define LIBISCCFG_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBISCCFG_EXTERNAL_DATA __declspec(dllimport)
#endif
#ifdef LIBNS_EXPORTS
#define LIBNS_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBNS_EXTERNAL_DATA __declspec(dllimport)
#endif
#ifdef LIBBIND9_EXPORTS
#define LIBBIND9_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBBIND9_EXTERNAL_DATA __declspec(dllimport)
#endif
#ifdef LIBTESTS_EXPORTS
#define LIBTESTS_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBTESTS_EXTERNAL_DATA __declspec(dllimport)
#endif
#endif /*! \brief ISC_PLATFORM_USEDECLSPEC */
/* /*
* Tell emacs to use C mode for this file. * Tell emacs to use C mode for this file.

View File

@@ -20,18 +20,14 @@
ISC_LANG_BEGINDECLS ISC_LANG_BEGINDECLS
#if !defined(HAVE_STRLCPY)
size_t size_t
isc_string_strlcpy(char *dst, const char *src, size_t size); strlcpy(char *dst, const char *src, size_t size);
#endif /* !defined(HAVE_STRLCPY) */
#ifdef ISC_PLATFORM_NEEDSTRLCPY
#define strlcpy isc_string_strlcpy
#endif
#if !defined(HAVE_STRLCAT)
size_t size_t
isc_string_strlcat(char *dst, const char *src, size_t size); strlcat(char *dst, const char *src, size_t size);
#ifdef ISC_PLATFORM_NEEDSTRLCAT
#define strlcat isc_string_strlcat
#endif #endif
int int

View File

@@ -24,7 +24,7 @@
isc_result_t isc_result_t
isc_netscope_pton(int af, char *scopename, void *addr, uint32_t *zoneid) { isc_netscope_pton(int af, char *scopename, void *addr, uint32_t *zoneid) {
char *ep; char *ep;
#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX #ifdef HAVE_IF_NAMETOINDEX
unsigned int ifid; unsigned int ifid;
struct in6_addr *in6; struct in6_addr *in6;
#endif #endif
@@ -43,7 +43,7 @@ isc_netscope_pton(int af, char *scopename, void *addr, uint32_t *zoneid) {
* interface names as link names, assuming one to one mapping between * interface names as link names, assuming one to one mapping between
* interfaces and links. * interfaces and links.
*/ */
#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX #ifdef HAVE_IF_NAMETOINDEX
in6 = (struct in6_addr *)addr; in6 = (struct in6_addr *)addr;
if (IN6_IS_ADDR_LINKLOCAL(in6) && if (IN6_IS_ADDR_LINKLOCAL(in6) &&
(ifid = if_nametoindex((const char *)scopename)) != 0) (ifid = if_nametoindex((const char *)scopename)) != 0)
@@ -58,7 +58,7 @@ isc_netscope_pton(int af, char *scopename, void *addr, uint32_t *zoneid) {
zone = (uint32_t)(llz & 0xffffffffUL); zone = (uint32_t)(llz & 0xffffffffUL);
if (zone != llz) if (zone != llz)
return (ISC_R_FAILURE); return (ISC_R_FAILURE);
#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX #ifdef HAVE_IF_NAMETOINDEX
} }
#endif #endif

View File

@@ -51,12 +51,6 @@ isc_thread_create(isc_threadfunc_t func, isc_threadarg_t arg,
} }
#endif #endif
#if defined(PTHREAD_SCOPE_SYSTEM) && defined(NEED_PTHREAD_SCOPE_SYSTEM)
ret = pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
if (ret != 0)
return (ISC_R_UNEXPECTED);
#endif
ret = pthread_create(thread, &attr, func, arg); ret = pthread_create(thread, &attr, func, arg);
if (ret != 0) if (ret != 0)
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
@@ -68,11 +62,7 @@ isc_thread_create(isc_threadfunc_t func, isc_threadarg_t arg,
void void
isc_thread_setconcurrency(unsigned int level) { isc_thread_setconcurrency(unsigned int level) {
#if defined(CALL_PTHREAD_SETCONCURRENCY)
(void)pthread_setconcurrency(level); (void)pthread_setconcurrency(level);
#else
UNUSED(level);
#endif
} }
void void

View File

@@ -41,6 +41,25 @@
#define RWLOCK_MAX_ADAPTIVE_COUNT 100 #define RWLOCK_MAX_ADAPTIVE_COUNT 100
#endif #endif
#if defined(_MSC_VER)
# include <intrin.h>
# define isc_rwlock_pause() YieldProcessor()
#elif defined(__x86_64__) || defined(__i386__)
# include <immintrin.h>
# define isc_rwlock_pause() _mm_pause()
#elif defined(__ia64__)
# define isc_rwlock_pause() __asm__ __volatile__ ("hint @pause")
#elif defined(__arm__)
# define isc_rwlock_pause() __asm__ __volatile__ ("yield")
#elif defined(__sparc) || defined(__sparc__)
# define plasma_spin_pause() __asm__ __volatile__ ("pause")
#elif defined(__ppc__) || defined(_ARCH_PPC) || \
defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_POWER)
# define isc_rwlock_pause() __asm__ volatile ("or 27,27,27")
#else
# define isc_rwlock_pause()
#endif
static isc_result_t static isc_result_t
isc__rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type); isc__rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type);
@@ -350,9 +369,7 @@ isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
result = isc__rwlock_lock(rwl, type); result = isc__rwlock_lock(rwl, type);
break; break;
} }
#ifdef ISC_PLATFORM_BUSYWAITNOP isc_rwlock_pause();
ISC_PLATFORM_BUSYWAITNOP;
#endif
} while (isc_rwlock_trylock(rwl, type) != ISC_R_SUCCESS); } while (isc_rwlock_trylock(rwl, type) != ISC_R_SUCCESS);
rwl->spins += (cnt - rwl->spins) / 8; rwl->spins += (cnt - rwl->spins) / 8;

View File

@@ -49,8 +49,9 @@
#include "isc/string.h" // IWYU pragma: keep #include "isc/string.h" // IWYU pragma: keep
#if !defined(HAVE_STRLCPY)
size_t size_t
isc_string_strlcpy(char *dst, const char *src, size_t size) strlcpy(char *dst, const char *src, size_t size)
{ {
char *d = dst; char *d = dst;
const char *s = src; const char *s = src;
@@ -76,9 +77,11 @@ isc_string_strlcpy(char *dst, const char *src, size_t size)
return(s - src - 1); /* count does not include NUL */ return(s - src - 1); /* count does not include NUL */
} }
#endif /* !defined(HAVE_STRLCPY) */
#if !defined(HAVE_STRLCAT)
size_t size_t
isc_string_strlcat(char *dst, const char *src, size_t size) strlcat(char *dst, const char *src, size_t size)
{ {
char *d = dst; char *d = dst;
const char *s = src; const char *s = src;
@@ -106,6 +109,7 @@ isc_string_strlcat(char *dst, const char *src, size_t size)
return(dlen + (s - src)); /* count does not include NUL */ return(dlen + (s - src)); /* count does not include NUL */
} }
#endif /* !defined(HAVE_STRLCAT) */
int int
isc_string_strerror_r(int errnum, char *buf, size_t buflen) { isc_string_strerror_r(int errnum, char *buf, size_t buflen) {

View File

@@ -3,7 +3,6 @@ Content-Type: application/X-atf-atffile; version="1"
prop: test-suite = bind9 prop: test-suite = bind9
tp: aes_test tp: aes_test
tp: atomic_test
tp: buffer_test tp: buffer_test
tp: counter_test tp: counter_test
tp: errno_test tp: errno_test

View File

@@ -2,7 +2,6 @@ syntax(2)
test_suite('bind9') test_suite('bind9')
atf_test_program{name='aes_test'} atf_test_program{name='aes_test'}
atf_test_program{name='atomic_test'}
atf_test_program{name='buffer_test'} atf_test_program{name='buffer_test'}
atf_test_program{name='counter_test'} atf_test_program{name='counter_test'}
atf_test_program{name='errno_test'} atf_test_program{name='errno_test'}

View File

@@ -31,7 +31,7 @@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@
CMOCKA_LIBS = @CMOCKA_LIBS@ CMOCKA_LIBS = @CMOCKA_LIBS@
OBJS = isctest.@O@ OBJS = isctest.@O@
SRCS = isctest.c aes_test.c atomic_test.c buffer_test.c \ SRCS = isctest.c aes_test.c buffer_test.c \
counter_test.c errno_test.c file_test.c hash_test.c \ counter_test.c errno_test.c file_test.c hash_test.c \
heap_test.c ht_test.c lex_test.c \ heap_test.c ht_test.c lex_test.c \
mem_test.c netaddr_test.c parse_test.c pool_test.c \ mem_test.c netaddr_test.c parse_test.c pool_test.c \
@@ -41,7 +41,7 @@ SRCS = isctest.c aes_test.c atomic_test.c buffer_test.c \
taskpool_test.c time_test.c timer_test.c taskpool_test.c time_test.c timer_test.c
SUBDIRS = SUBDIRS =
TARGETS = aes_test@EXEEXT@ atomic_test@EXEEXT@ buffer_test@EXEEXT@ \ TARGETS = aes_test@EXEEXT@ buffer_test@EXEEXT@ \
counter_test@EXEEXT@ errno_test@EXEEXT@ file_test@EXEEXT@ \ counter_test@EXEEXT@ errno_test@EXEEXT@ file_test@EXEEXT@ \
hash_test@EXEEXT@ heap_test@EXEEXT@ ht_test@EXEEXT@ \ hash_test@EXEEXT@ heap_test@EXEEXT@ ht_test@EXEEXT@ \
lex_test@EXEEXT@ mem_test@EXEEXT@ \ lex_test@EXEEXT@ mem_test@EXEEXT@ \
@@ -54,10 +54,6 @@ TARGETS = aes_test@EXEEXT@ atomic_test@EXEEXT@ buffer_test@EXEEXT@ \
@BIND9_MAKE_RULES@ @BIND9_MAKE_RULES@
atomic_test@EXEEXT@: atomic_test.@O@ isctest.@O@ ${ISCDEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
atomic_test.@O@ isctest.@O@ ${ISCLIBS} ${LIBS}
aes_test@EXEEXT@: aes_test.@O@ ${ISCDEPLIBS} aes_test@EXEEXT@: aes_test.@O@ ${ISCDEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
aes_test.@O@ ${ISCLIBS} ${LIBS} aes_test.@O@ ${ISCLIBS} ${LIBS}

View File

@@ -1,354 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
#include <config.h>
#include <inttypes.h>
#include <stdlib.h>
#include <atf-c.h>
#include <isc/atomic.h>
#include <isc/print.h>
#include <isc/result.h>
#include "isctest.h"
#define TASKS 32
#define ITERATIONS 1000
#define COUNTS_PER_ITERATION 1000
#define INCREMENT_64 (int64_t)0x0000000010000000
#define EXPECTED_COUNT_32 (TASKS * ITERATIONS * COUNTS_PER_ITERATION)
#define EXPECTED_COUNT_64 (TASKS * ITERATIONS * COUNTS_PER_ITERATION * INCREMENT_64)
typedef struct {
uint32_t iteration;
} counter_t;
counter_t counters[TASKS];
#if defined(ISC_PLATFORM_HAVEXADD)
static int32_t counter_32;
static void
do_xadd(isc_task_t *task, isc_event_t *ev) {
counter_t *state = (counter_t *)ev->ev_arg;
int i;
for (i = 0 ; i < COUNTS_PER_ITERATION ; i++) {
isc_atomic_xadd(&counter_32, 1);
}
state->iteration++;
if (state->iteration < ITERATIONS) {
isc_task_send(task, &ev);
} else {
isc_event_free(&ev);
}
}
ATF_TC(atomic_xadd);
ATF_TC_HEAD(atomic_xadd, tc) {
atf_tc_set_md_var(tc, "descr", "atomic XADD");
}
ATF_TC_BODY(atomic_xadd, tc) {
isc_result_t result;
isc_task_t *tasks[TASKS];
isc_event_t *event = NULL;
int i;
UNUSED(tc);
result = isc_test_begin(NULL, true, 0);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
memset(counters, 0, sizeof(counters));
counter_32 = 0;
/*
* Create our tasks, and allocate an event to get the counters going.
*/
for (i = 0 ; i < TASKS ; i++) {
tasks[i] = NULL;
ATF_REQUIRE_EQ(isc_task_create(taskmgr, 0, &tasks[i]),
ISC_R_SUCCESS);
event = isc_event_allocate(mctx, NULL, 1000, do_xadd,
&counters[i],
sizeof(struct isc_event));
ATF_REQUIRE(event != NULL);
isc_task_sendanddetach(&tasks[i], &event);
}
isc_test_end();
printf("32-bit counter %d, expected %d\n",
counter_32, EXPECTED_COUNT_32);
ATF_CHECK_EQ(counter_32, EXPECTED_COUNT_32);
counter_32 = 0;
}
#endif
#if defined(ISC_PLATFORM_HAVEXADDQ)
static int64_t counter_64;
static void
do_xaddq(isc_task_t *task, isc_event_t *ev) {
counter_t *state = (counter_t *)ev->ev_arg;
int i;
for (i = 0 ; i < COUNTS_PER_ITERATION ; i++) {
isc_atomic_xaddq(&counter_64, INCREMENT_64);
}
state->iteration++;
if (state->iteration < ITERATIONS) {
isc_task_send(task, &ev);
} else {
isc_event_free(&ev);
}
}
ATF_TC(atomic_xaddq);
ATF_TC_HEAD(atomic_xaddq, tc) {
atf_tc_set_md_var(tc, "descr", "atomic XADDQ");
}
ATF_TC_BODY(atomic_xaddq, tc) {
isc_result_t result;
isc_task_t *tasks[TASKS];
isc_event_t *event = NULL;
int i;
UNUSED(tc);
result = isc_test_begin(NULL, true, 0);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
memset(counters, 0, sizeof(counters));
counter_64 = 0;
/*
* Create our tasks, and allocate an event to get the counters going.
*/
for (i = 0 ; i < TASKS ; i++) {
tasks[i] = NULL;
ATF_REQUIRE_EQ(isc_task_create(taskmgr, 0, &tasks[i]),
ISC_R_SUCCESS);
event = isc_event_allocate(mctx, NULL, 1000, do_xaddq,
&counters[i],
sizeof(struct isc_event));
ATF_REQUIRE(event != NULL);
isc_task_sendanddetach(&tasks[i], &event);
}
isc_test_end();
printf("64-bit counter %" PRId64 ", "
"expected %" PRId64 "\n",
counter_64, EXPECTED_COUNT_64);
ATF_CHECK_EQ(counter_64, EXPECTED_COUNT_64);
counter_32 = 0;
}
#endif
#if defined(ISC_PLATFORM_HAVEATOMICSTORE)
static int32_t store_32;
static void
do_store(isc_task_t *task, isc_event_t *ev) {
counter_t *state = (counter_t *)ev->ev_arg;
int i;
uint32_t r;
uint32_t val;
r = random() % 256;
val = (r << 24) | (r << 16) | (r << 8) | r;
for (i = 0 ; i < COUNTS_PER_ITERATION ; i++) {
isc_atomic_store(&store_32, val);
}
state->iteration++;
if (state->iteration < ITERATIONS) {
isc_task_send(task, &ev);
} else {
isc_event_free(&ev);
}
}
ATF_TC(atomic_store);
ATF_TC_HEAD(atomic_store, tc) {
atf_tc_set_md_var(tc, "descr", "atomic STORE");
}
ATF_TC_BODY(atomic_store, tc) {
isc_result_t result;
isc_task_t *tasks[TASKS];
isc_event_t *event = NULL;
uint32_t val;
uint32_t r;
int i;
UNUSED(tc);
result = isc_test_begin(NULL, true, 0);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
memset(counters, 0, sizeof(counters));
store_32 = 0;
/*
* Create our tasks, and allocate an event to get the counters
* going.
*/
for (i = 0 ; i < TASKS ; i++) {
tasks[i] = NULL;
ATF_REQUIRE_EQ(isc_task_create(taskmgr, 0, &tasks[i]),
ISC_R_SUCCESS);
event = isc_event_allocate(mctx, NULL, 1000, do_store,
&counters[i],
sizeof(struct isc_event));
ATF_REQUIRE(event != NULL);
isc_task_sendanddetach(&tasks[i], &event);
}
isc_test_end();
r = store_32 & 0xff;
val = (r << 24) | (r << 16) | (r << 8) | r;
printf("32-bit store 0x%x, expected 0x%x\n",
(uint32_t) store_32, val);
ATF_CHECK_EQ((uint32_t) store_32, val);
store_32 = 0;
}
#endif
#if defined(ISC_PLATFORM_HAVEATOMICSTOREQ)
static int64_t store_64;
static void
do_storeq(isc_task_t *task, isc_event_t *ev) {
counter_t *state = (counter_t *)ev->ev_arg;
int i;
uint8_t r;
uint64_t val;
r = random() % 256;
val = (((uint64_t) r << 24) |
((uint64_t) r << 16) |
((uint64_t) r << 8) |
(uint64_t) r);
val |= ((uint64_t) val << 32);
for (i = 0 ; i < COUNTS_PER_ITERATION ; i++) {
isc_atomic_storeq(&store_64, val);
}
state->iteration++;
if (state->iteration < ITERATIONS) {
isc_task_send(task, &ev);
} else {
isc_event_free(&ev);
}
}
ATF_TC(atomic_storeq);
ATF_TC_HEAD(atomic_storeq, tc) {
atf_tc_set_md_var(tc, "descr", "atomic STOREQ");
}
ATF_TC_BODY(atomic_storeq, tc) {
isc_result_t result;
isc_task_t *tasks[TASKS];
isc_event_t *event = NULL;
uint64_t val;
uint32_t r;
int i;
UNUSED(tc);
result = isc_test_begin(NULL, true, 0);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
memset(counters, 0, sizeof(counters));
store_64 = 0;
/*
* Create our tasks, and allocate an event to get the counters
* going.
*/
for (i = 0 ; i < TASKS ; i++) {
tasks[i] = NULL;
ATF_REQUIRE_EQ(isc_task_create(taskmgr, 0, &tasks[i]),
ISC_R_SUCCESS);
event = isc_event_allocate(mctx, NULL, 1000, do_storeq,
&counters[i],
sizeof(struct isc_event));
ATF_REQUIRE(event != NULL);
isc_task_sendanddetach(&tasks[i], &event);
}
isc_test_end();
r = store_64 & 0xff;
val = (((uint64_t) r << 24) |
((uint64_t) r << 16) |
((uint64_t) r << 8) |
(uint64_t) r);
val |= ((uint64_t) val << 32);
printf("64-bit store 0x%" PRIx64 ", "
"expected 0x%" PRIx64 "\n",
(uint64_t) store_64, val);
ATF_CHECK_EQ((uint64_t) store_64, val);
store_64 = 0;
}
#endif
#if !defined(ISC_PLATFORM_HAVEXADD) && \
!defined(ISC_PLATFORM_HAVEXADDQ) && \
!defined(ISC_PLATFORM_HAVEATOMICSTOREQ)
ATF_TC(untested);
ATF_TC_HEAD(untested, tc) {
atf_tc_set_md_var(tc, "descr", "skipping aes test");
}
ATF_TC_BODY(untested, tc) {
UNUSED(tc);
atf_tc_skip("AES not available");
}
#endif /* !HAVEXADD, !HAVEXADDQ, !HAVEATOMICSTOREQ */
/*
* Main
*/
ATF_TP_ADD_TCS(tp) {
#if defined(ISC_PLATFORM_HAVEXADD)
ATF_TP_ADD_TC(tp, atomic_xadd);
#endif
#if defined(ISC_PLATFORM_HAVEXADDQ)
ATF_TP_ADD_TC(tp, atomic_xaddq);
#endif
#ifdef ISC_PLATFORM_HAVEATOMICSTORE
ATF_TP_ADD_TC(tp, atomic_store);
#endif
#if defined(ISC_PLATFORM_HAVEATOMICSTOREQ)
ATF_TP_ADD_TC(tp, atomic_storeq);
#endif
#if !defined(ISC_PLATFORM_HAVEXADD) && \
!defined(ISC_PLATFORM_HAVEXADDQ) && \
!defined(ISC_PLATFORM_HAVEATOMICSTOREQ)
ATF_TP_ADD_TC(tp, untested);
#endif
return (atf_no_error());
}

View File

@@ -144,20 +144,6 @@ static struct {
(void *)isc__app_unblock (void *)isc__app_unblock
}; };
#ifdef HAVE_LINUXTHREADS
/*!
* Linux has sigwait(), but it appears to prevent signal handlers from
* running, even if they're not in the set being waited for. This makes
* it impossible to get the default actions for SIGILL, SIGSEGV, etc.
* Instead of messing with it, we just use sigsuspend() instead.
*/
#undef HAVE_SIGWAIT
/*!
* We need to remember which thread is the main thread...
*/
static pthread_t main_thread;
#endif
#ifndef HAVE_SIGWAIT #ifndef HAVE_SIGWAIT
static void static void
exit_action(int arg) { exit_action(int arg) {
@@ -208,23 +194,6 @@ isc__app_ctxstart(isc_appctx_t *ctx0) {
* Start an ISC library application. * Start an ISC library application.
*/ */
#ifdef NEED_PTHREAD_INIT
/*
* BSDI 3.1 seg faults in pthread_sigmask() if we don't do this.
*/
presult = pthread_init();
if (presult != 0) {
strerror_r(presult, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_app_start() pthread_init: %s", strbuf);
return (ISC_R_UNEXPECTED);
}
#endif
#ifdef HAVE_LINUXTHREADS
main_thread = pthread_self();
#endif /* HAVE_LINUXTHREADS */
result = isc_mutex_init(&ctx->readylock); result = isc_mutex_init(&ctx->readylock);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
return (result); return (result);
@@ -401,10 +370,6 @@ isc__app_ctxrun(isc_appctx_t *ctx0) {
REQUIRE(VALID_APPCTX(ctx)); REQUIRE(VALID_APPCTX(ctx));
#ifdef HAVE_LINUXTHREADS
REQUIRE(main_thread == pthread_self());
#endif
LOCK(&ctx->lock); LOCK(&ctx->lock);
if (!ctx->running) { if (!ctx->running) {
@@ -458,7 +423,6 @@ isc__app_ctxrun(isc_appctx_t *ctx0) {
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
#ifndef HAVE_UNIXWARE_SIGWAIT
result = sigwait(&sset, &sig); result = sigwait(&sset, &sig);
if (result == 0) { if (result == 0) {
if (sig == SIGINT || sig == SIGTERM) if (sig == SIGINT || sig == SIGTERM)
@@ -467,15 +431,6 @@ isc__app_ctxrun(isc_appctx_t *ctx0) {
ctx->want_reload = true; ctx->want_reload = true;
} }
#else /* Using UnixWare sigwait semantics. */
sig = sigwait(&sset);
if (sig >= 0) {
if (sig == SIGINT || sig == SIGTERM)
ctx->want_shutdown = true;
else if (sig == SIGHUP)
ctx->want_reload = true;
}
#endif /* HAVE_UNIXWARE_SIGWAIT */
} else { } else {
/* /*
* External, or BIND9 using multiple contexts: * External, or BIND9 using multiple contexts:
@@ -577,23 +532,6 @@ isc__app_ctxshutdown(isc_appctx_t *ctx0) {
/* BIND9 internal, but using multiple contexts */ /* BIND9 internal, but using multiple contexts */
ctx->want_shutdown = true; ctx->want_shutdown = true;
else { else {
#ifdef HAVE_LINUXTHREADS
if (isc_bind9) {
/* BIND9 internal, single context */
int result;
result = pthread_kill(main_thread, SIGTERM);
if (result != 0) {
strerror_r(result,
strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_app_shutdown() "
"pthread_kill: %s",
strbuf);
return (ISC_R_UNEXPECTED);
}
}
#else
if (isc_bind9) { if (isc_bind9) {
/* BIND9 internal, single context */ /* BIND9 internal, single context */
if (kill(getpid(), SIGTERM) < 0) { if (kill(getpid(), SIGTERM) < 0) {
@@ -605,7 +543,6 @@ isc__app_ctxshutdown(isc_appctx_t *ctx0) {
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
} }
#endif /* HAVE_LINUXTHREADS */
else { else {
/* External, multiple contexts */ /* External, multiple contexts */
LOCK(&ctx->readylock); LOCK(&ctx->readylock);
@@ -650,23 +587,6 @@ isc__app_ctxsuspend(isc_appctx_t *ctx0) {
ctx->want_reload = true; ctx->want_reload = true;
else { else {
ctx->want_reload = true; ctx->want_reload = true;
#ifdef HAVE_LINUXTHREADS
if (isc_bind9) {
/* BIND9 internal, single context */
int result;
result = pthread_kill(main_thread, SIGHUP);
if (result != 0) {
strerror_r(result,
strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_app_reload() "
"pthread_kill: %s",
strbuf);
return (ISC_R_UNEXPECTED);
}
}
#else
if (isc_bind9) { if (isc_bind9) {
/* BIND9 internal, single context */ /* BIND9 internal, single context */
if (kill(getpid(), SIGHUP) < 0) { if (kill(getpid(), SIGHUP) < 0) {
@@ -678,7 +598,6 @@ isc__app_ctxsuspend(isc_appctx_t *ctx0) {
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
} }
#endif /* HAVE_LINUXTHREADS */
else { else {
/* External, multiple contexts */ /* External, multiple contexts */
LOCK(&ctx->readylock); LOCK(&ctx->readylock);

View File

@@ -146,7 +146,7 @@ isc_file_getmodtime(const char *file, isc_time_t *modtime) {
result = file_stats(file, &stats); result = file_stats(file, &stats);
if (result == ISC_R_SUCCESS) if (result == ISC_R_SUCCESS)
#ifdef ISC_PLATFORM_HAVESTATNSEC #if defined(HAVE_STAT_NSEC)
isc_time_set(modtime, stats.st_mtime, stats.st_mtim.tv_nsec); isc_time_set(modtime, stats.st_mtime, stats.st_mtim.tv_nsec);
#else #else
isc_time_set(modtime, stats.st_mtime, 0); isc_time_set(modtime, stats.st_mtime, 0);

View File

@@ -62,7 +62,7 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src,
{ {
struct sockaddr_in6 *sa6; struct sockaddr_in6 *sa6;
#if !defined(ISC_PLATFORM_HAVEIFNAMETOINDEX) #if !defined(HAVE_IF_NAMETOINDEX)
UNUSED(ifname); UNUSED(ifname);
#endif #endif
@@ -106,7 +106,7 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src,
(uint32_t)zone16); (uint32_t)zone16);
dst->type.in6.s6_addr[2] = 0; dst->type.in6.s6_addr[2] = 0;
dst->type.in6.s6_addr[3] = 0; dst->type.in6.s6_addr[3] = 0;
#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX #ifdef HAVE_IF_NAMETOINDEX
} else if (ifname != NULL) { } else if (ifname != NULL) {
unsigned int zone; unsigned int zone;

View File

@@ -36,8 +36,8 @@
#include <isc/string.h> #include <isc/string.h>
#include <isc/util.h> #include <isc/util.h>
#ifndef ISC_SOCKADDR_LEN_T #ifndef socklen_t
#define ISC_SOCKADDR_LEN_T unsigned int #define socklen_t unsigned int
#endif #endif
/*% /*%
@@ -366,24 +366,24 @@ isc_net_probe_ipv6pktinfo(void) {
#if ISC_CMSG_IP_TOS || defined(IPV6_TCLASS) #if ISC_CMSG_IP_TOS || defined(IPV6_TCLASS)
static inline ISC_SOCKADDR_LEN_T static inline socklen_t
cmsg_len(ISC_SOCKADDR_LEN_T len) { cmsg_len(socklen_t len) {
#ifdef CMSG_LEN #ifdef CMSG_LEN
return (CMSG_LEN(len)); return (CMSG_LEN(len));
#else #else
ISC_SOCKADDR_LEN_T hdrlen; socklen_t hdrlen;
/* /*
* Cast NULL so that any pointer arithmetic performed by CMSG_DATA * Cast NULL so that any pointer arithmetic performed by CMSG_DATA
* is correct. * is correct.
*/ */
hdrlen = (ISC_SOCKADDR_LEN_T)CMSG_DATA(((struct cmsghdr *)NULL)); hdrlen = (socklen_t)CMSG_DATA(((struct cmsghdr *)NULL));
return (hdrlen + len); return (hdrlen + len);
#endif #endif
} }
static inline ISC_SOCKADDR_LEN_T static inline socklen_t
cmsg_space(ISC_SOCKADDR_LEN_T len) { cmsg_space(socklen_t len) {
#ifdef CMSG_SPACE #ifdef CMSG_SPACE
return (CMSG_SPACE(len)); return (CMSG_SPACE(len));
#else #else
@@ -448,7 +448,7 @@ static bool
cmsgsend(int s, int level, int type, struct addrinfo *res) { cmsgsend(int s, int level, int type, struct addrinfo *res) {
char strbuf[ISC_STRERRORSIZE]; char strbuf[ISC_STRERRORSIZE];
struct sockaddr_storage ss; struct sockaddr_storage ss;
ISC_SOCKADDR_LEN_T len = sizeof(ss); socklen_t len = sizeof(ss);
struct msghdr msg; struct msghdr msg;
union { union {
struct cmsghdr h; struct cmsghdr h;

View File

@@ -65,19 +65,17 @@
#ifdef ISC_PLATFORM_HAVESYSUNH #ifdef ISC_PLATFORM_HAVESYSUNH
#include <sys/un.h> #include <sys/un.h>
#endif #endif
#ifdef ISC_PLATFORM_HAVEKQUEUE #ifdef HAVE_KQUEUE
#include <sys/event.h> #include <sys/event.h>
#endif #endif
#ifdef ISC_PLATFORM_HAVEEPOLL #ifdef HAVE_EPOLL_CREATE1
#include <sys/epoll.h> #include <sys/epoll.h>
#endif #endif
#ifdef ISC_PLATFORM_HAVEDEVPOLL
#if defined(HAVE_SYS_DEVPOLL_H) #if defined(HAVE_SYS_DEVPOLL_H)
#include <sys/devpoll.h> #include <sys/devpoll.h>
#elif defined(HAVE_DEVPOLL_H) #elif defined(HAVE_DEVPOLL_H)
#include <devpoll.h> #include <devpoll.h>
#endif #endif
#endif
#include <netinet/tcp.h> #include <netinet/tcp.h>
@@ -87,18 +85,18 @@
#include <sys/utsname.h> #include <sys/utsname.h>
#endif #endif
#ifdef ISC_PLATFORM_HAVETFO #ifdef ENABLE_TCP_FASTOPEN
#include <netinet/tcp.h> #include <netinet/tcp.h>
#endif #endif
/*% /*%
* Choose the most preferable multiplex method. * Choose the most preferable multiplex method.
*/ */
#ifdef ISC_PLATFORM_HAVEKQUEUE #if defined(HAVE_KQUEUE)
#define USE_KQUEUE #define USE_KQUEUE
#elif defined (ISC_PLATFORM_HAVEEPOLL) #elif defined(HAVE_EPOLL_CREATE1)
#define USE_EPOLL #define USE_EPOLL
#elif defined (ISC_PLATFORM_HAVEDEVPOLL) #elif defined(HAVE_SYS_DEVPOLL_H) || defined(HAVE_DEVPOLL_H)
#define USE_DEVPOLL #define USE_DEVPOLL
typedef struct { typedef struct {
unsigned int want_read : 1, unsigned int want_read : 1,
@@ -106,7 +104,7 @@ typedef struct {
} pollinfo_t; } pollinfo_t;
#else #else
#define USE_SELECT #define USE_SELECT
#endif /* ISC_PLATFORM_HAVEKQUEUE */ #endif /* HAVE_KQUEUE */
/* /*
* Set by the -T dscp option on the command line. If set to a value * Set by the -T dscp option on the command line. If set to a value
@@ -209,8 +207,8 @@ typedef enum { poll_idle, poll_active, poll_checking } pollstate_t;
* Some systems define the socket length argument as an int, some as size_t, * Some systems define the socket length argument as an int, some as size_t,
* some as socklen_t. This is here so it can be easily changed if needed. * some as socklen_t. This is here so it can be easily changed if needed.
*/ */
#ifndef ISC_SOCKADDR_LEN_T #ifndef socklen_t
#define ISC_SOCKADDR_LEN_T unsigned int #define socklen_t unsigned int
#endif #endif
/*% /*%
@@ -1197,24 +1195,24 @@ make_nonblock(int fd) {
* Note that cmsg_space() could run slow on OSes that do not have * Note that cmsg_space() could run slow on OSes that do not have
* CMSG_SPACE. * CMSG_SPACE.
*/ */
static inline ISC_SOCKADDR_LEN_T static inline socklen_t
cmsg_len(ISC_SOCKADDR_LEN_T len) { cmsg_len(socklen_t len) {
#ifdef CMSG_LEN #ifdef CMSG_LEN
return (CMSG_LEN(len)); return (CMSG_LEN(len));
#else #else
ISC_SOCKADDR_LEN_T hdrlen; socklen_t hdrlen;
/* /*
* Cast NULL so that any pointer arithmetic performed by CMSG_DATA * Cast NULL so that any pointer arithmetic performed by CMSG_DATA
* is correct. * is correct.
*/ */
hdrlen = (ISC_SOCKADDR_LEN_T)CMSG_DATA(((struct cmsghdr *)NULL)); hdrlen = (socklen_t)CMSG_DATA(((struct cmsghdr *)NULL));
return (hdrlen + len); return (hdrlen + len);
#endif #endif
} }
static inline ISC_SOCKADDR_LEN_T static inline socklen_t
cmsg_space(ISC_SOCKADDR_LEN_T len) { cmsg_space(socklen_t len) {
#ifdef CMSG_SPACE #ifdef CMSG_SPACE
return (CMSG_SPACE(len)); return (CMSG_SPACE(len));
#else #else
@@ -2276,7 +2274,7 @@ static void
set_rcvbuf(void) { set_rcvbuf(void) {
int fd; int fd;
int max = rcvbuf, min; int max = rcvbuf, min;
ISC_SOCKADDR_LEN_T len; socklen_t len;
fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (fd == -1) { if (fd == -1) {
@@ -2330,7 +2328,7 @@ static void
set_sndbuf(void) { set_sndbuf(void) {
int fd; int fd;
int max = sndbuf, min; int max = sndbuf, min;
ISC_SOCKADDR_LEN_T len; socklen_t len;
fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
#if defined(ISC_PLATFORM_HAVEIPV6) #if defined(ISC_PLATFORM_HAVEIPV6)
@@ -2465,7 +2463,7 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
int on = 1; int on = 1;
#endif #endif
#if defined(SO_RCVBUF) || defined(SO_SNDBUF) #if defined(SO_RCVBUF) || defined(SO_SNDBUF)
ISC_SOCKADDR_LEN_T optlen; socklen_t optlen;
int size = 0; int size = 0;
#endif #endif
@@ -3414,7 +3412,7 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
isc__socketmgr_t *manager; isc__socketmgr_t *manager;
isc_socket_newconnev_t *dev; isc_socket_newconnev_t *dev;
isc_task_t *task; isc_task_t *task;
ISC_SOCKADDR_LEN_T addrlen; socklen_t addrlen;
int fd; int fd;
isc_result_t result = ISC_R_SUCCESS; isc_result_t result = ISC_R_SUCCESS;
char strbuf[ISC_STRERRORSIZE]; char strbuf[ISC_STRERRORSIZE];
@@ -5466,7 +5464,7 @@ isc__socket_filter(isc_socket_t *sock0, const char *filter) {
*/ */
static void static void
set_tcp_fastopen(isc__socket_t *sock, unsigned int backlog) { set_tcp_fastopen(isc__socket_t *sock, unsigned int backlog) {
#if defined(ISC_PLATFORM_HAVETFO) && defined(TCP_FASTOPEN) #if defined(ENABLE_TCP_FASTOPEN) && defined(TCP_FASTOPEN)
char strbuf[ISC_STRERRORSIZE]; char strbuf[ISC_STRERRORSIZE];
/* /*
@@ -5814,7 +5812,7 @@ internal_connect(isc_task_t *me, isc_event_t *ev) {
isc_socket_connev_t *dev; isc_socket_connev_t *dev;
int cc; int cc;
isc_result_t result; isc_result_t result;
ISC_SOCKADDR_LEN_T optlen; socklen_t optlen;
char strbuf[ISC_STRERRORSIZE]; char strbuf[ISC_STRERRORSIZE];
char peerbuf[ISC_SOCKADDR_FORMATSIZE]; char peerbuf[ISC_SOCKADDR_FORMATSIZE];
@@ -5950,7 +5948,7 @@ isc__socket_getpeername(isc_socket_t *sock0, isc_sockaddr_t *addressp) {
isc_result_t isc_result_t
isc__socket_getsockname(isc_socket_t *sock0, isc_sockaddr_t *addressp) { isc__socket_getsockname(isc_socket_t *sock0, isc_sockaddr_t *addressp) {
isc__socket_t *sock = (isc__socket_t *)sock0; isc__socket_t *sock = (isc__socket_t *)sock0;
ISC_SOCKADDR_LEN_T len; socklen_t len;
isc_result_t result; isc_result_t result;
char strbuf[ISC_STRERRORSIZE]; char strbuf[ISC_STRERRORSIZE];
@@ -6306,7 +6304,7 @@ isc_socketmgr_renderxml(isc_socketmgr_t *mgr0, xmlTextWriterPtr writer) {
isc__socket_t *sock = NULL; isc__socket_t *sock = NULL;
char peerbuf[ISC_SOCKADDR_FORMATSIZE]; char peerbuf[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_t addr; isc_sockaddr_t addr;
ISC_SOCKADDR_LEN_T len; socklen_t len;
int xmlrc; int xmlrc;
LOCK(&mgr->lock); LOCK(&mgr->lock);
@@ -6418,7 +6416,7 @@ isc_socketmgr_renderjson(isc_socketmgr_t *mgr0, json_object *stats) {
isc__socket_t *sock = NULL; isc__socket_t *sock = NULL;
char peerbuf[ISC_SOCKADDR_FORMATSIZE]; char peerbuf[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_t addr; isc_sockaddr_t addr;
ISC_SOCKADDR_LEN_T len; socklen_t len;
json_object *obj, *array = json_object_new_array(); json_object *obj, *array = json_object_new_array();
CHECKMEM(array); CHECKMEM(array);

View File

@@ -15,9 +15,7 @@
/*! \file */ /*! \file */
#ifdef ISC_PLATFORM_NEEDSYSSELECTH #include <sys/time.h>
#include <sys/select.h>
#endif
typedef struct isc_socketwait isc_socketwait_t; typedef struct isc_socketwait isc_socketwait_t;
int isc__socketmgr_waitevents(isc_socketmgr_t *, struct timeval *, int isc__socketmgr_waitevents(isc_socketmgr_t *, struct timeval *,

View File

@@ -34,6 +34,10 @@
#ifndef strtoull #ifndef strtoull
#define strtoull _strtoui64 #define strtoull _strtoui64
#endif #endif
#include <stdint.h>
typedef uint32_t socklen_t;
#endif #endif
/*** /***
@@ -46,73 +50,17 @@
#undef MSG_TRUNC #undef MSG_TRUNC
#define ISC_PLATFORM_NEEDSTRSEP
#define ISC_PLATFORM_NEEDSTRLCPY
#define ISC_PLATFORM_NEEDSTRLCAT
#define ISC_PLATFORM_NEEDSTRLCPY
/*
* Used to control how extern data is linked; needed for Win32 platforms.
*/
#define ISC_PLATFORM_USEDECLSPEC 1
/*
* Define this here for now as winsock2.h defines h_errno
* and we don't want to redeclare it.
*/
#define ISC_PLATFORM_NONSTDHERRNO
/* /*
* Define if the platform has <sys/un.h>. * Define if the platform has <sys/un.h>.
*/ */
#undef ISC_PLATFORM_HAVESYSUNH #undef ISC_PLATFORM_HAVESYSUNH
/*
* Define if we want to log backtrace
*/
@ISC_PLATFORM_USEBACKTRACE@
/* /*
* Defines for the noreturn attribute. * Defines for the noreturn attribute.
*/ */
#define ISC_PLATFORM_NORETURN_PRE __declspec(noreturn) #define ISC_PLATFORM_NORETURN_PRE __declspec(noreturn)
#define ISC_PLATFORM_NORETURN_POST #define ISC_PLATFORM_NORETURN_POST
/*
* If the "xadd" operation is available on this architecture,
* ISC_PLATFORM_HAVEXADD will be defined.
*/
@ISC_PLATFORM_HAVEXADD@
/*
* If the "xaddq" operation (64bit xadd) is available on this architecture,
* ISC_PLATFORM_HAVEXADDQ will be defined.
*/
@ISC_PLATFORM_HAVEXADDQ@
/*
* If the "atomic swap" operation is available on this architecture,
* ISC_PLATFORM_HAVEATOMICSTORE" will be defined.
*/
@ISC_PLATFORM_HAVEATOMICSTORE@
/*
* If the "compare-and-exchange" operation is available on this architecture,
* ISC_PLATFORM_HAVECMPXCHG will be defined.
*/
@ISC_PLATFORM_HAVECMPXCHG@
/*
* Define with the busy wait nop asm or function call.
*/
@ISC_PLATFORM_BUSYWAITNOP@
/*
* If the strcasestr() operation is not available on this platform,
* ISC_PLATFORM_NEEDSTRCASESTR will be defined.
*/
@ISC_PLATFORM_NEEDSTRCASESTR@
/* /*
* Set up a macro for importing and exporting from the DLL * Set up a macro for importing and exporting from the DLL
*/ */

View File

@@ -112,14 +112,6 @@ static void consistent(isc_socket_t *sock);
#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12) #define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12)
#endif #endif
/*
* Some systems define the socket length argument as an int, some as size_t,
* some as socklen_t. This is here so it can be easily changed if needed.
*/
#ifndef ISC_SOCKADDR_LEN_T
#define ISC_SOCKADDR_LEN_T unsigned int
#endif
/* /*
* Define what the possible "soft" errors can be. These are non-fatal returns * Define what the possible "soft" errors can be. These are non-fatal returns
* of various network related functions, like recv() and so on. * of various network related functions, like recv() and so on.
@@ -1649,7 +1641,7 @@ socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
int on = 1; int on = 1;
#endif #endif
#if defined(SO_RCVBUF) #if defined(SO_RCVBUF)
ISC_SOCKADDR_LEN_T optlen; socklen_t optlen;
int size; int size;
#endif #endif
int socket_errno; int socket_errno;
@@ -3318,7 +3310,7 @@ isc__socket_filter(isc_socket_t *sock, const char *filter) {
isc_result_t isc_result_t
isc__socket_listen(isc_socket_t *sock, unsigned int backlog) { isc__socket_listen(isc_socket_t *sock, unsigned int backlog) {
char strbuf[ISC_STRERRORSIZE]; char strbuf[ISC_STRERRORSIZE];
#if defined(ISC_PLATFORM_HAVETFO) && defined(TCP_FASTOPEN) #if defined(ENABLE_TCP_FASTOPEN) && defined(TCP_FASTOPEN)
char on = 1; char on = 1;
#endif #endif
@@ -3351,7 +3343,7 @@ isc__socket_listen(isc_socket_t *sock, unsigned int backlog) {
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
#if defined(ISC_PLATFORM_HAVETFO) && defined(TCP_FASTOPEN) #if defined(ENABLE_TCP_FASTOPEN) && defined(TCP_FASTOPEN)
if (setsockopt(sock->fd, IPPROTO_TCP, TCP_FASTOPEN, if (setsockopt(sock->fd, IPPROTO_TCP, TCP_FASTOPEN,
&on, sizeof(on)) < 0) { &on, sizeof(on)) < 0) {
strerror_r(errno, strbuf, sizeof(strbuf)); strerror_r(errno, strbuf, sizeof(strbuf));
@@ -3655,7 +3647,7 @@ isc__socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp) {
isc_result_t isc_result_t
isc__socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp) { isc__socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp) {
ISC_SOCKADDR_LEN_T len; socklen_t len;
isc_result_t result; isc_result_t result;
char strbuf[ISC_STRERRORSIZE]; char strbuf[ISC_STRERRORSIZE];
@@ -4007,7 +3999,7 @@ isc_socketmgr_renderxml(isc_socketmgr_t *mgr, xmlTextWriterPtr writer)
isc_socket_t *sock = NULL; isc_socket_t *sock = NULL;
char peerbuf[ISC_SOCKADDR_FORMATSIZE]; char peerbuf[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_t addr; isc_sockaddr_t addr;
ISC_SOCKADDR_LEN_T len; socklen_t len;
int xmlrc; int xmlrc;
LOCK(&mgr->lock); LOCK(&mgr->lock);
@@ -4118,7 +4110,7 @@ isc_socketmgr_renderjson(isc_socketmgr_t *mgr, json_object *stats) {
isc_socket_t *sock = NULL; isc_socket_t *sock = NULL;
char peerbuf[ISC_SOCKADDR_FORMATSIZE]; char peerbuf[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_t addr; isc_sockaddr_t addr;
ISC_SOCKADDR_LEN_T len; socklen_t len;
json_object *obj, *array = json_object_new_array(); json_object *obj, *array = json_object_new_array();
CHECKMEM(array); CHECKMEM(array);

View File

@@ -10,7 +10,6 @@
./OPTIONS X 2017,2018 ./OPTIONS X 2017,2018
./PLATFORMS X 2018 ./PLATFORMS X 2018
./README X 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./README X 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018
./acconfig.h C 1999,2000,2001,2002,2003,2004,2005,2007,2008,2012,2014,2016,2018
./aclocal.m4 X 1999,2000,2001,2012,2014,2018 ./aclocal.m4 X 1999,2000,2001,2012,2014,2018
./autogen.sh SH 2015,2016,2018 ./autogen.sh SH 2015,2016,2018
./bin/check/check-tool.c C 2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./bin/check/check-tool.c C 2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018
@@ -1331,7 +1330,6 @@
./bin/tests/system/idna/tests.sh SH 2018 ./bin/tests/system/idna/tests.sh SH 2018
./bin/tests/system/ifconfig.bat BAT 2016,2018 ./bin/tests/system/ifconfig.bat BAT 2016,2018
./bin/tests/system/ifconfig.sh SH 2000,2001,2002,2003,2004,2007,2008,2009,2010,2012,2013,2016,2018 ./bin/tests/system/ifconfig.sh SH 2000,2001,2002,2003,2004,2007,2008,2009,2010,2012,2013,2016,2018
./bin/tests/system/inline/checkdsa.sh.in SH 2013,2014,2016,2018
./bin/tests/system/inline/clean.sh SH 2011,2012,2013,2014,2015,2016,2017,2018 ./bin/tests/system/inline/clean.sh SH 2011,2012,2013,2014,2015,2016,2017,2018
./bin/tests/system/inline/ns1/named.conf.in CONF-C 2011,2016,2018 ./bin/tests/system/inline/ns1/named.conf.in CONF-C 2011,2016,2018
./bin/tests/system/inline/ns1/root.db.in ZONE 2011,2012,2013,2016,2017,2018 ./bin/tests/system/inline/ns1/root.db.in ZONE 2011,2012,2013,2016,2017,2018
@@ -3465,7 +3463,6 @@
./lib/isc/tests/Atffile X 2011,2017,2018 ./lib/isc/tests/Atffile X 2011,2017,2018
./lib/isc/tests/Kyuafile X 2017,2018 ./lib/isc/tests/Kyuafile X 2017,2018
./lib/isc/tests/aes_test.c C 2014,2016,2018 ./lib/isc/tests/aes_test.c C 2014,2016,2018
./lib/isc/tests/atomic_test.c C 2018
./lib/isc/tests/buffer_test.c C 2014,2015,2016,2017,2018 ./lib/isc/tests/buffer_test.c C 2014,2015,2016,2017,2018
./lib/isc/tests/counter_test.c C 2014,2016,2018 ./lib/isc/tests/counter_test.c C 2014,2016,2018
./lib/isc/tests/errno_test.c C 2016,2018 ./lib/isc/tests/errno_test.c C 2016,2018

View File

@@ -207,6 +207,7 @@ my @substdefh = ("AES_CC",
"HAVE_DSA_GET0_PQG", "HAVE_DSA_GET0_PQG",
"HAVE_ECDSA_SIG_GET0", "HAVE_ECDSA_SIG_GET0",
"HAVE_RSA_SET0_KEY", "HAVE_RSA_SET0_KEY",
"USE_BACKTRACE",
"USE_OPENSSL", "USE_OPENSSL",
"USE_PKCS11", "USE_PKCS11",
"HAVE_PKCS11_ED25519", "HAVE_PKCS11_ED25519",
@@ -219,27 +220,20 @@ my @substdefh = ("AES_CC",
"TUNE_LARGE", "TUNE_LARGE",
"WANT_QUERYTRACE", "WANT_QUERYTRACE",
"WITH_IDN", "WITH_IDN",
"CPU_RELAX",
"VALIDATION_DEFAULT"); "VALIDATION_DEFAULT");
# for platform.h # for platform.h
my %configdefp; my %configdefp;
my @substdefp = ("ISC_PLATFORM_BUSYWAITNOP", my @substdefp = ();
"ISC_PLATFORM_HAVEATOMICSTORE",
"ISC_PLATFORM_HAVEATOMICSTOREQ",
"ISC_PLATFORM_HAVECMPXCHG",
"ISC_PLATFORM_HAVEXADD",
"ISC_PLATFORM_HAVEXADDQ",
"ISC_PLATFORM_NEEDSTRCASESTR",
"ISC_PLATFORM_USEBACKTRACE");
# for conf.sh # for conf.sh
my %configtest; my %configtest;
my @substtest = ("CHECK_DSA", my @substtest = ("CHECKDS",
"CHECKDS",
"COVERAGE", "COVERAGE",
"DNSTAP", "DNSTAP",
"FSTRM_CAPTURE", "FSTRM_CAPTURE",
@@ -576,13 +570,11 @@ if (($want_win32 eq "yes") && ($want_x64 eq "yes")) {
$configvar{"BUILD_PLATFORM"} = "Win32"; $configvar{"BUILD_PLATFORM"} = "Win32";
$configvar{"MACHINE"} = "/machine:X86"; $configvar{"MACHINE"} = "/machine:X86";
$configvar{"BUILD_MACHINE"} = "/machine:X86"; $configvar{"BUILD_MACHINE"} = "/machine:X86";
$configdefp{"ISC_PLATFORM_BUSYWAITNOP"} = "__asm { rep nop }";
} elsif ($want_x64 eq "yes") { } elsif ($want_x64 eq "yes") {
$configvar{"PLATFORM"} = "x64"; $configvar{"PLATFORM"} = "x64";
$configvar{"BUILD_PLATFORM"} = "x64"; $configvar{"BUILD_PLATFORM"} = "x64";
$configvar{"MACHINE"} = "/machine:X64"; $configvar{"MACHINE"} = "/machine:X64";
$configvar{"BUILD_MACHINE"} = "/machine:X64"; $configvar{"BUILD_MACHINE"} = "/machine:X64";
$configdefp{"ISC_PLATFORM_BUSYWAITNOP"} = "_mm_pause()";
} }
# Standard configure variable # Standard configure variable
$configvar{"EXEEXT"} = ".exe"; $configvar{"EXEEXT"} = ".exe";
@@ -1160,12 +1152,9 @@ if ($msc_ver < 1400) {
# backtrace for >= VS 2012 # backtrace for >= VS 2012
if ($msc_ver >= 1700) { if ($msc_ver >= 1700) {
$configdefp{"ISC_PLATFORM_USEBACKTRACE"} = 1; $configdefh{"USE_BACKTRACE"} = 1;
} }
# no version of MSVS supports strcasestr() yet
$configdefp{"ISC_PLATFORM_NEEDSTRCASESTR"} = 1;
# warn when cross compiling # warn when cross compiling
if ($cross_compile eq "yes") { if ($cross_compile eq "yes") {
@@ -1231,22 +1220,6 @@ EOF
# Process arguments # Process arguments
# enable-intrinsics
if ($enable_intrinsics eq "yes") {
$configcond{"ATOMIC"} = 1;
$configvar{"INTRINSIC"} = "true";
$configvar{"COPTI"} = "/Oi";
$configdefp{"ISC_PLATFORM_HAVEXADD"} = 1;
if ($want_x64 eq "yes") {
$configdefp{"ISC_PLATFORM_HAVEXADDQ"} = 1;
$configdefp{"ISC_PLATFORM_HAVEATOMICSTOREQ"} = 1;
}
$configdefp{"ISC_PLATFORM_HAVEATOMICSTORE"} = 1;
$configdefp{"ISC_PLATFORM_HAVECMPXCHG"} = 1;
} else {
$configvar{"INTRINSIC"} = "false";
}
# enable-native-pkcs11 # enable-native-pkcs11
if ($enable_native_pkcs11 eq "yes") { if ($enable_native_pkcs11 eq "yes") {
$cryptolib = "pkcs11"; $cryptolib = "pkcs11";
@@ -1411,7 +1384,7 @@ if ($use_openssl eq "yes") {
die "find more than one OpenSSL libcrypto-*.dll DLL candidate\n"; die "find more than one OpenSSL libcrypto-*.dll DLL candidate\n";
} }
$openssl_dll = File::Spec->catdir($openssl_path, "@dirlist[0]"); $openssl_dll = File::Spec->catdir($openssl_path, "@dirlist[0]");
} }
$cryptolib = "openssl"; $cryptolib = "openssl";
$configvar{"OPENSSL_PATH"} = "$openssl_path"; $configvar{"OPENSSL_PATH"} = "$openssl_path";
@@ -2863,9 +2836,6 @@ sub makeinstallfile {
# Adjust system tests # Adjust system tests
# WIN32 not a BSD
$configtest{"CHECK_DSA"} = 0;
# dnstap not supported # dnstap not supported
#$configtest{"DNSTAP"} = "dnstap"; #$configtest{"DNSTAP"} = "dnstap";
#$configtest{"FSTRM_CAPTURE"} = "fstrm_capture"; #$configtest{"FSTRM_CAPTURE"} = "fstrm_capture";