From 02e349c0517fce8e297243b167b5391ade47717e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 21 Aug 2018 11:09:34 +0200 Subject: [PATCH] Remove legacy support for HP-UX --- bin/tests/system/ifconfig.sh | 10 +--- config.h.in | 3 - configure | 110 ----------------------------------- configure.in | 61 ------------------- lib/isc/unix/ifiter_ioctl.c | 20 ------- lib/isc/unix/os.c | 22 +------ lib/isc/unix/resource.c | 14 ----- lib/isc/unix/socket.c | 21 +++---- util/mksymtbl.pl | 30 +++------- 9 files changed, 17 insertions(+), 274 deletions(-) diff --git a/bin/tests/system/ifconfig.sh b/bin/tests/system/ifconfig.sh index ec9993fd34..478ab56c61 100755 --- a/bin/tests/system/ifconfig.sh +++ b/bin/tests/system/ifconfig.sh @@ -38,15 +38,7 @@ EOF exit 1 fi -# If running on hp-ux, don't even try to run config.guess. -# It will try to create a temporary file in the current directory, -# which fails when running as root with the current directory -# on a NFS mounted disk. - -case `uname -a` in - *HP-UX*) sys=hpux ;; - *) sys=`sh $config_guess` ;; -esac +sys=`sh $config_guess` use_ip= case "$sys" in diff --git a/config.h.in b/config.h.in index c4c801f1ac..f23b16c1af 100644 --- a/config.h.in +++ b/config.h.in @@ -429,9 +429,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DEVPOLL_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_DYNTUNE_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H diff --git a/configure b/configure index efd70310fc..381ff78791 100755 --- a/configure +++ b/configure @@ -13374,12 +13374,6 @@ case "$host" in STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET" CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET" ;; - #HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros - *-hp-hpux*) - STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" - LIBS="-lxnet $LIBS" - ;; # Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros *-solaris*) STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__" @@ -17481,12 +17475,6 @@ $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - case "$host" in - *-hp-hpux*) - CFLAGS="$CFLAGS -Wl,+vnocompatwarnings" - BACKTRACECFLAGS="$BACKTRACECFLAGS -Wl,+vnocompatwarnings" - ;; - esac if test "X$enable_warn_shadow" = Xyes; then STD_CWARNINGS="$STD_CWARNINGS -Wshadow" fi @@ -17501,27 +17489,6 @@ else CCNOOPT="$CCNOOPT -std" MKDEPCC="$CC" ;; - *-hp-hpux*) - CC="$CC -Ae -z" - # The version of the C compiler that constantly warns about - # 'const' as well as alignment issues is unfortunately not - # able to be discerned via the version of the operating - # system, nor does cc have a version flag. - case "`$CC +W 123 2>&1`" in - *Unknown?option*) - STD_CWARNINGS="+w1" - ;; - *) - # Turn off the pointlessly noisy warnings. - STD_CWARNINGS="+w1 +W 474,530,2193,2236" - ;; - esac - CCOPT="$CCOPT -Ae -z" - CCNOOPT="$CCNOOPT -Ae -z" - CFLAGS="$CFLAGS -Wl,+vnocompatwarnings" - BACKTRACECFLAGS="$BACKTRACECFLAGS -Wl,+vnocompatwarnings" - MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP' - ;; *-sgi-irix*) STD_CWARNINGS="-fullwarn -woff 1209" # @@ -19205,29 +19172,6 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# -# Older HP-UX doesn't have gettune -# -case "$host" in - *-hp-hpux*) - for ac_header in sys/dyntune.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/dyntune.h" "ac_cv_header_sys_dyntune_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_dyntune_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_DYNTUNE_H 1 -_ACEOF - -fi - -done - - ;; - *) - ;; -esac - - # # Compaq TruCluster requires more code for handling cluster IP aliases # @@ -19373,54 +19317,6 @@ else ac_cv_have_if_nametoindex=no fi -case $ac_cv_have_if_nametoindex in -no) - case "$host" in - *-hp-hpux*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for if_nametoindex in -lipv6" >&5 -$as_echo_n "checking for if_nametoindex in -lipv6... " >&6; } -if ${ac_cv_lib_ipv6_if_nametoindex+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lipv6 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char if_nametoindex (); -int -main () -{ -return if_nametoindex (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ipv6_if_nametoindex=yes -else - ac_cv_lib_ipv6_if_nametoindex=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipv6_if_nametoindex" >&5 -$as_echo "$ac_cv_lib_ipv6_if_nametoindex" >&6; } -if test "x$ac_cv_lib_ipv6_if_nametoindex" = xyes; then : - ac_cv_have_if_nametoindex=yes - LIBS="-lipv6 $LIBS" -fi - - ;; - esac -esac case $ac_cv_have_if_nametoindex in yes) ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1" @@ -22215,12 +22111,6 @@ if test "yes" = "$dlopen"; then SO_LDFLAGS="-G -z text" SO_LD="ld" ;; - *-hp-hpux*) - SO=sl - SO_CFLAGS="+z" - SO_LDFLAGS="-b +vnocompatwarnings" - SO_LD="ld" - ;; *) SO_CFLAGS="-fPIC" ;; diff --git a/configure.in b/configure.in index 8da1940493..dcd4e5fc11 100644 --- a/configure.in +++ b/configure.in @@ -403,12 +403,6 @@ case "$host" in STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET" CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET" ;; - #HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros - *-hp-hpux*) - STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" - LIBS="-lxnet $LIBS" - ;; # Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros *-solaris*) STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__" @@ -1744,12 +1738,6 @@ if test "X$GCC" = "Xyes"; then else AC_MSG_RESULT(no) fi - case "$host" in - *-hp-hpux*) - CFLAGS="$CFLAGS -Wl,+vnocompatwarnings" - BACKTRACECFLAGS="$BACKTRACECFLAGS -Wl,+vnocompatwarnings" - ;; - esac if test "X$enable_warn_shadow" = Xyes; then STD_CWARNINGS="$STD_CWARNINGS -Wshadow" fi @@ -1764,27 +1752,6 @@ else CCNOOPT="$CCNOOPT -std" MKDEPCC="$CC" ;; - *-hp-hpux*) - CC="$CC -Ae -z" - # The version of the C compiler that constantly warns about - # 'const' as well as alignment issues is unfortunately not - # able to be discerned via the version of the operating - # system, nor does cc have a version flag. - case "`$CC +W 123 2>&1`" in - *Unknown?option*) - STD_CWARNINGS="+w1" - ;; - *) - # Turn off the pointlessly noisy warnings. - STD_CWARNINGS="+w1 +W 474,530,2193,2236" - ;; - esac - CCOPT="$CCOPT -Ae -z" - CCNOOPT="$CCNOOPT -Ae -z" - CFLAGS="$CFLAGS -Wl,+vnocompatwarnings" - BACKTRACECFLAGS="$BACKTRACECFLAGS -Wl,+vnocompatwarnings" - MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP' - ;; *-sgi-irix*) STD_CWARNINGS="-fullwarn -woff 1209" # @@ -2650,18 +2617,6 @@ AC_TRY_COMPILE([#include ],[struct stat s; return(s.st_mtim.tv_nsec ISC_PLATFORM_HAVESTATNSEC="#undef ISC_PLATFORM_HAVESTATNSEC"]) AC_SUBST(ISC_PLATFORM_HAVESTATNSEC) -# -# Older HP-UX doesn't have gettune -# -case "$host" in - *-hp-hpux*) - AC_CHECK_HEADERS(sys/dyntune.h) - ;; - *) - ;; -esac - - # # Compaq TruCluster requires more code for handling cluster IP aliases # @@ -2734,16 +2689,6 @@ AC_SUBST(ISC_PLATFORM_HAVESTRINGSH) AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes, ac_cv_have_if_nametoindex=no) case $ac_cv_have_if_nametoindex in -no) - case "$host" in - *-hp-hpux*) - AC_CHECK_LIB(ipv6, if_nametoindex, - ac_cv_have_if_nametoindex=yes - LIBS="-lipv6 $LIBS",) - ;; - esac -esac -case $ac_cv_have_if_nametoindex in yes) ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1" AC_DEFINE(HAVE_IF_NAMETOINDEX, 1, @@ -3749,12 +3694,6 @@ if test "yes" = "$dlopen"; then SO_LDFLAGS="-G -z text" SO_LD="ld" ;; - *-hp-hpux*) - SO=sl - SO_CFLAGS="+z" - SO_LDFLAGS="-b +vnocompatwarnings" - SO_LD="ld" - ;; *) SO_CFLAGS="-fPIC" ;; diff --git a/lib/isc/unix/ifiter_ioctl.c b/lib/isc/unix/ifiter_ioctl.c index 9702faea1a..38c121c181 100644 --- a/lib/isc/unix/ifiter_ioctl.c +++ b/lib/isc/unix/ifiter_ioctl.c @@ -206,26 +206,6 @@ getbuf6(isc_interfaceiter_t *iter) { */ if (ioctl(iter->socket6, SIOCGLIFCONF, (char *)&iter->lifc) == -1) { -#ifdef __hpux - /* - * IPv6 interface scanning is not available on all - * kernels w/ IPv6 sockets. - */ - if (errno == ENOENT) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_INTERFACE, - ISC_LOG_DEBUG(1), - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_IFITERIOCTL, - ISC_MSG_GETIFCONFIG, - "get interface " - "configuration: %s"), - strbuf); - result = ISC_R_FAILURE; - goto cleanup; - } -#endif if (errno != EINVAL) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, diff --git a/lib/isc/unix/os.c b/lib/isc/unix/os.c index 8cff6b66eb..79409cffbc 100644 --- a/lib/isc/unix/os.c +++ b/lib/isc/unix/os.c @@ -19,7 +19,6 @@ #include -#ifndef __hpux static inline long sysconf_ncpus(void) { #if defined(_SC_NPROCESSORS_ONLN) @@ -30,25 +29,8 @@ sysconf_ncpus(void) { return (0); #endif } -#endif #endif /* HAVE_SYSCONF */ - -#ifdef __hpux - -#include - -static inline int -hpux_ncpus(void) { - struct pst_dynamic psd; - if (pstat_getdynamic(&psd, sizeof(psd), 1, 0) != -1) - return (psd.psd_proc_cnt); - else - return (0); -} - -#endif /* __hpux */ - #if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTLBYNAME) #include /* for FreeBSD */ #include /* for NetBSD */ @@ -71,9 +53,7 @@ unsigned int isc_os_ncpus(void) { long ncpus = 0; -#ifdef __hpux - ncpus = hpux_ncpus(); -#elif defined(HAVE_SYSCONF) +#if defined(HAVE_SYSCONF) ncpus = sysconf_ncpus(); #endif #if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTLBYNAME) diff --git a/lib/isc/unix/resource.c b/lib/isc/unix/resource.c index a212386bc3..99eab54184 100644 --- a/lib/isc/unix/resource.c +++ b/lib/isc/unix/resource.c @@ -28,10 +28,6 @@ #include /* To get the large NR_OPEN. */ #endif -#if defined(__hpux) && defined(HAVE_SYS_DYNTUNE_H) -#include -#endif - #include "errno2result.h" static isc_result_t @@ -170,16 +166,6 @@ isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value) { if (unixresult == 0) return (ISC_R_SUCCESS); } -#elif defined(__hpux) && defined(HAVE_SYS_DYNTUNE_H) - if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) { - uint64_t maxfiles; - if (gettune("maxfiles_lim", &maxfiles) == 0) { - rl.rlim_cur = rl.rlim_max = maxfiles; - unixresult = setrlimit(unixresource, &rl); - if (unixresult == 0) - return (ISC_R_SUCCESS); - } - } #endif if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) { if (getrlimit(unixresource, &rl) == 0) { diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index b28b8ef1cc..734b3f4386 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -1856,19 +1856,10 @@ doio_recv(isc__socket_t *sock, isc_socketevent_t *dev) { SOFT_OR_HARD(ENETUNREACH, ISC_R_NETUNREACH); SOFT_OR_HARD(EHOSTUNREACH, ISC_R_HOSTUNREACH); SOFT_OR_HARD(EHOSTDOWN, ISC_R_HOSTDOWN); - /* HPUX 11.11 can return EADDRNOTAVAIL. */ - SOFT_OR_HARD(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL); SOFT_OR_HARD(ENOBUFS, ISC_R_NORESOURCES); /* Should never get this one but it was seen. */ #ifdef ENOPROTOOPT SOFT_OR_HARD(ENOPROTOOPT, ISC_R_HOSTUNREACH); -#endif - /* - * HPUX returns EPROTO and EINVAL on receiving some ICMP/ICMPv6 - * errors. - */ -#ifdef EPROTO - SOFT_OR_HARD(EPROTO, ISC_R_HOSTUNREACH); #endif SOFT_OR_HARD(EINVAL, ISC_R_HOSTUNREACH); @@ -5686,10 +5677,14 @@ isc__socket_connect(isc_socket_t *sock0, const isc_sockaddr_t *addr, cc = connect(sock->fd, &addr->type.sa, addr->length); if (cc < 0) { /* - * HP-UX "fails" to connect a UDP socket and sets errno to - * EINPROGRESS if it's non-blocking. We'd rather regard this as - * a success and let the user detect it if it's really an error - * at the time of sending a packet on the socket. + * The socket is nonblocking and the connection cannot be + * completed immediately. It is possible to select(2) or + * poll(2) for completion by selecting the socket for writing. + * After select(2) indicates writability, use getsockopt(2) to + * read the SO_ERROR option at level SOL_SOCKET to determine + * whether connect() completed successfully (SO_ERROR is zero) + * or unsuccessfully (SO_ERROR is one of the usual error codes + * listed here, explaining the reason for the failure). */ if (sock->type == isc_sockettype_udp && errno == EINPROGRESS) { cc = 0; diff --git a/util/mksymtbl.pl b/util/mksymtbl.pl index a302fe27ad..f94fb72e89 100755 --- a/util/mksymtbl.pl +++ b/util/mksymtbl.pl @@ -37,9 +37,6 @@ if ($options{'o'}) { $nm_prog = "nm"; $ostype = `uname -s`; chop($ostype); -if ($ostype eq "HP-UX") { - $nm_prog = "/usr/ccs/bin/nm -x" -} if ($options{'i'}) { open(SYMBOLS, $options{'i'}) || die "failed to open $options{'i'}"; @@ -52,28 +49,15 @@ open(TBLFILE, ">$outputfile") || die "failed to open output file: $outputfile"; $nsyms = 0; while () { my ($addr, $symbol) = (0, ""); - if ($ostype eq "HP-UX") { - if (/(\S*)\s*\|0x([0-9a-f]*)\|([^|]*\|entry|extern\|code)/) { - $addr = $2; - $symbol = $1; - # this filter catches a massive number of awkward - # symbols such as "$START$". we are not interested in - # those and ignore them. - next if ($symbol =~ /\$/); - } - } else { - # *BSDs, Linux, etc. - if (/([0-9a-f]*)\s[tT]\s(.*)/) { - ($addr, $symbol) = ($1, $2); - # heuristics: some compilers add a "_" to all program - # defined symbols. Detect and fix it for a well known - # symbol of "main". - $need_uscorefix = 1 if ($symbol eq "_main"); - } + # *BSDs, Linux, etc. + if (/([0-9a-f]*)\s[tT]\s(.*)/) { + ($addr, $symbol) = ($1, $2); + # heuristics: some compilers add a "_" to all program + # defined symbols. Detect and fix it for a well known + # symbol of "main". + $need_uscorefix = 1 if ($symbol eq "_main"); } if ($symbol ne "") { - # XXX: HP-UX's nm can produce a duplicate entry for the same - # address. Ignore duplicate entries except the first one. next if ($symmap{$addr}); $symmap{$addr} = $symbol;