diff -Nru npth-1.2/AUTHORS npth-1.6/AUTHORS --- npth-1.2/AUTHORS 2015-04-11 11:57:35.000000000 +0000 +++ npth-1.6/AUTHORS 2017-05-16 07:15:01.000000000 +0000 @@ -1,10 +1,18 @@ Package: npth -Download: ftp://ftp.gnupg.org/gcrypt/npth/ +Download: https://gnupg.org/ftp/gcrypt/npth/ Repository: git://git.gnupg.org/npth.git Maintainer: Werner Koch Bug reports: gnupg-devel@gnupg.org Security related bug reports: security@gnupg.org -License (software): LGPLv3+/GPLv2+ +License: LGPLv2+ + + +nPth is free software. See the file COPYING.LIB for copying +conditions. License copyright years may be listed using range +notation, e.g., 2000-2013, indicating that every year in the range, +inclusive, is a copyrightable year that would otherwise be listed +individually. + * Authors @@ -15,31 +23,20 @@ * Copyright - nPth is Copyright (C) 2011, 2012, 2014, 2015 g10 Code GmbH - - nPth is free software; you can redistribute it and/or modify it - under the terms of either - - - the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at - your option) any later version. - - or - - - the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at - your option) any later version. - - or both in parallel, as here. + nPth is Copyright (C) 2011, 2012, 2014, 2015, 2017 g10 Code GmbH - nPth is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. + nPth is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of + the License, or (at your option) any later version. + + nPth is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU Lesser General Public License for more details. - You should have received a copies of the GNU General Public License - and the GNU Lesser General Public License along with this program; - if not, see . + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, see . diff -Nru npth-1.2/autogen.sh npth-1.6/autogen.sh --- npth-1.2/autogen.sh 2014-01-10 14:55:13.000000000 +0000 +++ npth-1.6/autogen.sh 2018-07-16 07:16:03.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # autogen.sh -# Copyright (C) 2003, 2014 g10 Code GmbH +# Copyright (C) 2003, 2014, 2017, 2018 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -15,7 +15,7 @@ # configure it for the respective package. It is maintained as part of # GnuPG and source copied by other packages. # -# Version: 2014-01-10 +# Version: 2018-07-10 configure_ac="configure.ac" @@ -41,7 +41,7 @@ info () { if [ -z "${SILENT}" ]; then - echo "autogen.sh:" "$*" + echo "autogen.sh:" "$*" >&2 fi } @@ -70,6 +70,8 @@ DIE=no FORCE= SILENT= +PRINT_HOST=no +PRINT_BUILD=no tmp=$(dirname "$0") tsdir=$(cd "${tmp}"; pwd) @@ -77,7 +79,18 @@ SILENT=" --silent" fi if test x"$1" = x"--help"; then - echo "usage: ./autogen.sh [--silent] [--force] [--build-TYPE] [ARGS]" + echo "usage: ./autogen.sh [OPTIONS] [ARGS]" + echo " Options:" + echo " --silent Silent operation" + echo " --force Pass --force to autoconf" + echo " --find-version Helper for configure.ac" + echo " --git-build Run all commands to build from a Git" + echo " --print-host Print only the host triplet" + echo " --print-build Print only the build platform triplet" + echo " --build-TYPE Configure to cross build for TYPE" + echo "" + echo " ARGS are passed to configure in --build-TYPE mode." + echo " Configuration for this script is expected in autogen.rc" exit 0 fi if test x"$1" = x"--silent"; then @@ -88,6 +101,14 @@ FORCE=" --force" shift fi +if test x"$1" = x"--print-host"; then + PRINT_HOST=yes + shift +fi +if test x"$1" = x"--print-build"; then + PRINT_BUILD=yes + shift +fi # Reject unsafe characters in $HOME, $tsdir and cwd. We consider spaces @@ -133,6 +154,15 @@ myhost="" myhostsub="" case "$1" in + --find-version) + myhost="find-version" + SILENT=" --silent" + shift + ;; + --git-build) + myhost="git-build" + shift + ;; --build-w32) myhost="w32" shift @@ -161,6 +191,25 @@ die_p +# **** GIT BUILD **** +# This is a helper to build from git. +if [ "$myhost" = "git-build" ]; then + tmp="$(pwd)" + cd "$tsdir" || fatal "error cd-ing to $tsdir" + ./autogen.sh || fatal "error running ./autogen.sh" + cd "$tmp" || fatal "error cd-ing back to $tmp" + die_p + "$tsdir"/configure || fatal "error running $tsdir/configure" + die_p + make || fatal "error running make" + die_p + make check || fatal "error running male check" + die_p + exit 0 +fi +# **** end GIT BUILD **** + + # Source our configuration if [ -f "${tsdir}/autogen.rc" ]; then . "${tsdir}/autogen.rc" @@ -172,16 +221,78 @@ . "$HOME/.gnupg-autogen.rc" fi + +# **** FIND VERSION **** +# This is a helper for the configure.ac M4 magic +# Called +# ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO] +# returns a complete version string with automatic beta numbering. +if [ "$myhost" = "find-version" ]; then + package="$1" + major="$2" + minor="$3" + micro="$4" + + if [ -z "$package" -o -z "$major" -o -z "$minor" ]; then + echo "usage: ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO]" >&2 + exit 1 + fi + + if [ -z "$micro" ]; then + matchstr1="$package-$major.[0-9]*" + matchstr2="$package-$major-base" + vers="$major.$minor" + else + matchstr1="$package-$major.$minor.[0-9]*" + matchstr2="$package-$major.$minor-base" + vers="$major.$minor.$micro" + fi + + beta=no + if [ -e .git ]; then + ingit=yes + tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null) + tmp=$(echo "$tmp" | sed s/^"$package"//) + if [ -n "$tmp" ]; then + tmp=$(echo "$tmp" | sed s/^"$package"// \ + | awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}') + else + tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null \ + | awk -F- '$4!=0{print"-beta"$4}') + fi + [ -n "$tmp" ] && beta=yes + rev=$(git rev-parse --short HEAD | tr -d '\n\r') + rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null))) + else + ingit=no + beta=yes + tmp="-unknown" + rev="0000000" + rvd="0" + fi + + echo "$package-$vers$tmp:$beta:$ingit:$vers$tmp:$vers:$tmp:$rev:$rvd:" + exit 0 +fi +# **** end FIND VERSION **** + + +if [ ! -f "$tsdir/build-aux/config.guess" ]; then + fatal "$tsdir/build-aux/config.guess not found" + exit 1 +fi +build=`$tsdir/build-aux/config.guess` +if [ $PRINT_BUILD = yes ]; then + echo "$build" + exit 0 +fi + + + # ****************** # W32 build script # ****************** if [ "$myhost" = "w32" ]; then - if [ ! -f "$tsdir/build-aux/config.guess" ]; then - fatal "$tsdir/build-aux/config.guess not found" - exit 1 - fi - build=`$tsdir/build-aux/config.guess` - case $myhostsub in ce) w32root="$w32ce_root" @@ -222,6 +333,10 @@ fi die_p fi + if [ $PRINT_HOST = yes ]; then + echo "$host" + exit 0 + fi if [ -f "$tsdir/config.log" ]; then if ! head $tsdir/config.log | grep "$host" >/dev/null; then @@ -232,7 +347,8 @@ $tsdir/configure --enable-maintainer-mode ${SILENT} \ --prefix=${w32root} \ - --host=${host} --build=${build} \ + --host=${host} --build=${build} SYSROOT=${w32root} \ + PKG_CONFIG_LIBDIR=${w32root}/lib/pkgconfig \ ${configure_opts} ${extraoptions} "$@" rc=$? exit $rc @@ -242,13 +358,6 @@ # ***** AMD64 cross build script ******* # Used to cross-compile for AMD64 (for testing) if [ "$myhost" = "amd64" ]; then - shift - if [ ! -f $tsdir/build-aux/config.guess ]; then - echo "$tsdir/build-aux/config.guess not found" >&2 - exit 1 - fi - build=`$tsdir/build-aux/config.guess` - [ -z "$amd64root" ] && amd64root="$HOME/amd64root" info "Using $amd64root as standard install directory" replace_sysroot @@ -269,6 +378,10 @@ echo "Stop." >&2 exit 1 fi + if [ $PRINT_HOST = yes ]; then + echo "$host" + exit 0 + fi if [ -f "$tsdir/config.log" ]; then if ! head $tsdir/config.log | grep "$host" >/dev/null; then @@ -341,13 +454,16 @@ # Check the git setup. if [ -d .git ]; then - CP="cp -a" - [ -z "${SILENT}" ] && CP="$CP -v" + CP="cp -p" + # If we have a GNU cp we can add -v + if cp --version >/dev/null 2>/dev/null; then + [ -z "${SILENT}" ] && CP="$CP -v" + fi if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then [ -z "${SILENT}" ] && cat <. @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -168,19 +168,29 @@ # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. + # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in + earm*) + os=netbsdelf + ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ @@ -197,6 +207,13 @@ os=netbsd ;; esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -207,13 +224,13 @@ release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -223,6 +240,10 @@ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -235,6 +256,9 @@ *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -251,42 +275,42 @@ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -359,16 +383,16 @@ exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build - SUN_ARCH="i386" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` @@ -393,7 +417,7 @@ exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} @@ -618,13 +642,13 @@ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi @@ -663,11 +687,11 @@ exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build @@ -680,12 +704,12 @@ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} @@ -790,14 +814,14 @@ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) @@ -879,7 +903,7 @@ exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix @@ -902,7 +926,7 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) @@ -933,6 +957,9 @@ crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -945,6 +972,9 @@ ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -1021,7 +1051,7 @@ echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} @@ -1100,7 +1130,7 @@ # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1249,6 +1279,9 @@ SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; @@ -1262,9 +1295,9 @@ UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in @@ -1286,7 +1319,7 @@ exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi @@ -1317,7 +1350,7 @@ # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" @@ -1359,7 +1392,7 @@ echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos @@ -1370,23 +1403,25 @@ x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; esac cat >&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp diff -Nru npth-1.2/build-aux/config.sub npth-1.6/build-aux/config.sub --- npth-1.2/build-aux/config.sub 2015-01-28 10:26:03.000000000 +0000 +++ npth-1.6/build-aux/config.sub 2016-07-13 17:03:42.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2015-01-01' +timestamp='2016-06-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,8 +53,7 @@ me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. @@ -68,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -117,7 +116,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -255,11 +254,12 @@ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ + | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ @@ -305,7 +305,7 @@ | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -376,12 +376,13 @@ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ @@ -428,12 +429,13 @@ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -518,6 +520,9 @@ basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -638,6 +643,14 @@ basic_machine=m68k-bull os=-sysv3 ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; ebmon29k) basic_machine=a29k-amd os=-ebmon @@ -1373,18 +1386,18 @@ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ @@ -1393,7 +1406,8 @@ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1525,6 +1539,8 @@ ;; -nacl*) ;; + -ios) + ;; -none) ;; *) diff -Nru npth-1.2/ChangeLog npth-1.6/ChangeLog --- npth-1.2/ChangeLog 2015-04-11 12:02:43.000000000 +0000 +++ npth-1.6/ChangeLog 2018-07-16 07:34:13.000000000 +0000 @@ -1,10 +1,181 @@ +2018-07-16 Werner Koch + + Release 1.6. + + commit 771287929ed226add3ef27de882c5359dcd3f66e + * configure.ac: Bump LT version to C1/A1/R2. + +2018-07-12 NIIBE Yutaka + + build: Let configure create the VERSION file. + + commit 90e3dda03585dd4c1bcbab3da194cb9aee9c80fe + * autogen.sh: Update from libgpg-error. + * configure.ac: Use mym4_* things to create VERSION file. + * Makefile.am (dist-hook): Do not create VERSION. + (EXTRA_DIST): Add VERSION. + +2018-05-28 NIIBE Yutaka + + build: Fix libraries for HP-UX. + + commit f8b8e5d1112a7b1aee0669ed14679ca27e8a95df + * configure.ac: HP-UX requires -lpthread and -lrt. + +2017-11-30 NIIBE Yutaka + + w32: Fix memory leak for npth_create. + + commit 167b0dde6f77a15af2e75da570e88720a335705e + * w32/npth.c (npth_create): Free ATTR when allocated. + (npth_attr_destroy): Clear. + +2017-06-02 Werner Koch + + Release 1.5. + + commit 77c094e606b3952c470ccfa21b546bb13e4de1db + * configure.ac: Set LT version to C1/A1/R1. + +2017-06-01 NIIBE Yutaka + + Fix busy_wait_for. + + commit 4fae99976c31bae53183aeec8df2032aaba2e689 + * src/npth.c (busy_wait_for): Remove comparison negation. + +2017-05-16 Werner Koch + + Release 1.4. + + commit 9fcc113fc267f3a8d2b8699b41f3c10fa3cb187c + * configure.ac: Set LT version to C1/A1/R0. + + Add function npth_is_protected. + + commit 8a675d6b1dd19018f2579f8c8ce6a58bc5a20a4e + * src/npth.c (got_sceptre): New. + (enter_npth, leave_npth): Set. + (npth_is_protected): New. + * w32/npth.c: (got_sceptre): New. + (enter_npth, leave_npth): Set. + (npth_is_protected): New. + * w32/npth.def, src/libnpth.vers: Add new function. + +2017-04-20 NIIBE Yutaka + + w32: Change the condition for struct timespec. + + commit 217bc1c6aabaaebbbb461e2435c2b8f539b271ad + * w32/npth.h: Fix the ifdef case. + +2017-04-05 NIIBE Yutaka + + configure: Add tweak for FreeBSD. + + commit b47443d95d5c363e91ef446140d8b60ffe28a58b + * configure: On FreeBSD, we use -lpthread. + + configure: Add tweak for DragonFlyBSD. + + commit 09b73da00e9dd988681ca957b30c461c67924563 + * configure.ac: On DragonFlyBSD, we use -lpthread. + + configure: Add tweak for NetBSD. + + commit e31917deefad2a8073817512f9e99bb269a04788 + * configure.ac: On NetBSD, we use -lpthread. + +2016-11-29 NIIBE Yutaka + + Use unnamed semaphore of Grand Central Dispatch for macOS. + + commit 8f486d084a0e4d9409fb93809ec5b3bf820f343b + * configure.ac [*-apple-darwin*]: Search dispatch_semaphore_create + and define HAVE_LIB_DISPATCH if found. + * src/npth.c [HAVE_LIB_DISPATCH] (sem_init, sem_post, sem_wait): New. + * src/npth.c (try_sem_open): Remove. + * tests/t-fork.c: Add comments. + +2016-11-22 Werner Koch + + Release 1.3. + + commit d1b8d54bc3d5e4975752d737c271bf8c346dc3a9 + * configure.ac: Bump LT version to C0/A0/R6. + +2016-11-21 Werner Koch + + Bypass npth_unprotect/protect when npth has not yet been initialized. + + commit 50d6d727c8da21cf78dcd5a2ee969f46864fa124 + * src/npth.c (initialized_or_any_threads): New variable. + (npth_init): Set var. + (npth_create): Set var. + (npth_unprotect, npth_protect): Shortcut if not initialized. + + * w32/npth.c (initialized_or_any_threads): New variable. + (npth_init): Set var. + (npth_unprotect, npth_protect): Shortcut if not initialized. + +2016-10-10 Justus Winter + + src: Fix setting thread names on macOS. + + commit 8cddd2ce70f85eea6c68ca6d03080181a2eea976 + * src/npth.c (npth_setname_np): Support Apple's one-argument form. + +2016-07-13 Werner Koch + + build: Update config.{guess,sub} to {2016-05-15,2016-06-20}. + + commit 17addb77ee95ccade2060d4469a8b56bc12bfb5e + * build-aux/config.guess: Update. + * build-aux/config.sub: Update. + +2016-07-05 NIIBE Yutaka + + Fix for semaphore access by child. + + commit 6e69a440d2be080cf13cc3c3a72428f7e48457bb + * configure.ac (HAVE_FORK_UNSAFE_SEMAPHORE): New. + * src/npth.c (sem_init): Use NPTH_SEMAPHORE_PSHARED. + * tests/t-fork.c: New. + +2016-06-25 Werner Koch + + w32: Include io.h for read(2) and write(2). + + commit e345e0133ba79ffc9d181591d349242297d44ab4 + * w32/npth.c: Include io.h. + + Fix problem with regression tests on recent glibc. + + commit 3a9d32eb59194b989656548755066ccd9feb36ac + * configure.ac: Change pthread test to test pthread_detach + +2015-11-26 Werner Koch + + Improve debug output. + + commit 3ccc6218833e17893eb94a6efdf05a13da94942c + * w32/npth.c (_npth_debug): Print to stderr. + (enter_npth, leave_npth): Include the tid in the debug output. + +2015-08-25 Werner Koch + + Add configure option --enable-build-timestamp. + + commit 4781ced10715e126d7b9c712de970c2606635c27 + * configure.ac (BUILD_TIMESTAMP): Set to "" by default. Also + with ac_define_unquoted. + +2015-06-06 Jim Meyering + + configure.ac: improve check for clock_gettime library. + + commit a49a061c65fb3a6d9c58add4dc55435f0c4353a2 + * configure.ac: When using AC_SEARCH_LIBS, handle the case in which + that function returns "none required". Also, save and restore LIBS + around the check, and properly m4-quote the first argument to AC_DEFINE. + Finally, also set and AC_SUBST LIB_CLOCK_GETTIME. + This added code is very similar to that provided in gnulib's + clock-time.m4. + * tests/Makefile.am (LDADD): Append $(LIB_CLOCK_GETTIME). + +2015-04-28 NIIBE Yutaka + + npth-config: supply a library dependency for clock_gettime. + + commit c2015a2bafa99fdab8f26af9b60e93f1d36ac166 + * configure.ac (clock_gettime): Update config_libs. + 2015-04-11 Werner Koch Release 1.2. + + commit bc97d5175065aa9682527f6760094c50ce199c3c + 2015-02-03 Werner Koch w32: Use -static-libgcc to avoid linking to libgcc_s_sjlj-1.dll. + + commit 3ffea74924704c0986fde3e5e8b19d4fc55cfcb9 * w32/Makefile.am: Remove non-Windows stuff. (extra_ltoptions): New. (libnpth_la_LDFLAGS): Use it. @@ -12,6 +183,7 @@ 2015-01-28 Werner Koch Switch to automake 1.14. + + commit a2614eafa085bdb5a618589aaabc9edaabb83d1f * Makefile.am (AUTOMAKE_OPTIONS): Move to ... * configure.ac (AM_INIT_AUTOMAKE): here. Add serial-tests. * build-aux/compile: Add. @@ -22,16 +194,19 @@ 2014-12-18 Werner Koch Don't get fooled by leave_npth changing ERRNO. + + commit c90a48fa62ce6215aba1f87b49dab848fb59a5b7 * src/npth.c: Save ERRNO. 2014-10-31 Werner Koch Release 1.1. + + commit 7a3175b90a6164342e1e771bfd206c56c60fcb2c * configure.ac: Set LT version to C0/A0/R4. 2014-10-29 Werner Koch Allow use on systems which return ENOSYS for sem_init. + + commit 510135a23bb92fa527541e7d81bf6f831db306a5 * src/npth.c: Include some more headers. (sceptre_buffer): New. (sceptre): Change to a pointer and init to sceptre_buffer. @@ -42,38 +217,46 @@ 2014-09-18 Werner Koch Release 1.0. + + commit 79fbdcedb5429537ba116c9fc118f148c7b33d4f * configure.ac: Set LT version to C0/A0/R2. 2014-06-27 Werner Koch w32: Fix segv in npth_eselect. + + commit 8a687d0c71f2b66dd6b6e9dd2fe17e32fb04f5e1 * w32/npth.c (npth_eselect): Obvious fix. w32: Change an npth_eselect arg to unsigned. + + commit 3716fd6d877d672ba0b77d01ba5abf6af55bfaf1 * w32/npth.c (npth_eselect): Change arg EVENTS_SET to unsigned int. 2014-06-26 Werner Koch w32: Let npth_eselect return 0 for timeout. Fix replacement error codes. + + commit 9534958a92146d705f4b2714dd11f038f0b1cb4b * w32/npth.c (npth_eselect): Remove debug output. Return 0 for timeout. * w32/npth.h (ETIMEDOUT, EOPNOTSUPP): Change to more correct values. 2014-02-19 Werner Koch w32: Make npth_eselect actually work. + + commit 75dba175e0ea15c395c7d74323e5bee43791317a * w32/npth.c (npth_eselect): Rewrite. w32: Avoid calling FD_ISSET with a NULL fdset. + + commit 4312f967099718eb64ba489d5d238d95d156a3f4 * w32/npth.c (npth_eselect): Check fdset before callig FD_foo. 2014-01-10 Werner Koch Use the generic autogen.sh script. + + commit 477ce6965e2be38880adae9479d1cc947f3aa853 * autogen.rc: New. * Makefile.am (EXTRA_DIST): Add it. * autogen.sh: Update from GnuPG. Move helper scripts to build-aux. + + commit e18f8674dc7b0a02d78560be9dbe04452e04133d * config.guess, config.sub, depcomp, install-sh * ltmain.sh, missing: Move to build-aux/. * configure.ac (AC_CONFIG_AUX_DIR): New. @@ -82,6 +265,7 @@ 2014-01-09 Werner Koch Fix creation of w32 npth-config tool. + + commit f976b55fc1987edd2c199c3a6ff35f2ee7495aa9 * src/npth-config.in: Move to ../. * src/npth.m4: Move to ../. * w32/npth-config.in: Remove. @@ -92,25 +276,34 @@ * configure.ac (AC_CONFIG_FILES): Adjust accordingly. Add configure option --enable-silent-rules. + + commit 8115fbf33e8886474a57e270a384a2b7fc91002c * configure.ac: Add AM_SILENT_RULES. Update libtool to support Android. + + commit e63e1d4ff0d569fc571e5891c529f66d79da38ca * m4/libtool.m4: Add "linux*android*" case. Taken from the libgpg-error. Update config.{guess.sub} to a decent version (2013-11-29) + + commit 6dce1db4fb9d2839def4b68d775a454add851bee + Add hack to have different names for 64 bit Windows DLLs. + + commit 0ec6f3afe0ac02ba56dd8f54fdfa92935a4accce * ltmain.sh: Prefix the SO number for W64 with a "6". Fix libtool 2.4.2 to correctly detect .def files. + + commit f69b1749ad81cb82f161cfa7aad5ecc782befd9b * ltmain.sh (sed_uncomment_deffile): New. (orig_export_symbols): Uncomment def file before testing for EXPORTS. * m4/libtool.m4: Do the same for the generated code. Update libtool to Debian's 2.4.2. + + commit 296a3865584c7cde4a1afc86f075bb76c6c07d16 + w32: Fix build problems with current compilers. + + commit b116a29432172f2f65e9755dae8d1b976cbc8a8a * configure.ac (NTELIBS): ac_subst for W32. * w32/npth.h (struct timespec): Do not define for current mingw-w64 versions. @@ -118,6 +311,7 @@ 2013-12-10 NIIBE Yutaka Conditionalize use of pthread_atfork. + + commit 34bafb36df418541982dfcdc0fd9773931cfc3c7 * configure.ac: Add checking pthread_atfork. * src/npth-sigev.c (npth_sigev_fini): Call pthread_atfork only when @@ -126,78 +320,94 @@ 2013-07-03 NIIBE Yutaka Restore sigmask at fork. + + commit 9a3377bb534654ec398300c1900350b02321f86c * src/npth-sigev.c (restore_sigmask_for_child_process): New. (npth_sigev_fini): Register restore_sigmask_for_child_process. 2012-11-21 Ben Kibbey Build fix for NetBSD. + + commit 95754492a41c8284264476f05e3fe3c50c3b4aa9 * src/npth.c (npth_setname_np): conditional check for __NetBSD__ and adapt correct parameters. 2012-11-16 Werner Koch Improve parsing of the GIT revision number. + + commit d8ec1a2e01549dcae0240e587a4b663bf5e45172 * configure.ac (git_revision): Use git rev-parse. Fix non-portable use of chmod in autogen.sh. + + commit cd01413fe060c4633a8056ae50e776424d8c7a75 * autogen.sh: Remove option -c from chmod. 2012-09-26 Werner Koch Make local variables configure hack more robust. + + commit 522743d2d621fc2c5230cc546ef17f4e896b464a * configure.ac (emacs_local_vars_begin): Use extra m4 quoting so that newer Emscasen won't take it up as Local Variables for this file. 2012-08-08 Werner Koch Release 0.91. + + commit e63a929ab90f4f17928f36f2d073f2a6f9f93bc6 * configure.ac: Bump LT version to C0/A0/R2. 2012-05-15 Werner Koch Really fix the version number parsing. + + commit 5bce7b5a742359da68f4c0aef35e98fe7335714e * src/npth.m4 (_AM_PATH_NPTH_CONFIG, _AM_PATH_NPTH_CONFIG]: Fix last fix. Print detected version number. Print warning for non-matching host. Fix version number parsing in npth.m4. + + commit 1b34fdadc449bf16c30b36e7a7ad272bd224b3fd * src/npth.m4: Adjust for n.m style version numbers. 2012-05-10 Werner Koch Provide gettimeofday fallback for clock_gettime. + + commit 4e25a69e9e869ea58fb4f6eeab64bcd74c86174d * configure.ac (AC_CHECK_FUNCS): Check for gettimeofday. * src/npth.c (npth_clock_gettime): Use gettimeofday if clock_gettime is not available. Return an error if npth_rwlock_timedwrlock is not supported. + + commit 363c370bd35dd0bb4e5636b2d4f06ea88c658794 * src/npth.c (npth_rwlock_timedwrlock): Return ENOSYS if there is no way to build it. Avoid compiler warning for debug variable. + + commit 4b84b65203a41229c1775d515963ed65af2c5eea * src/npth.c (main_thread): Flag as volatile. Include required headers into pth.h. + + commit 09f3fccf2cf7c03fd16ebce26ae5ff2ee58effc7 * src/npth.h.in: Include sys/time.h and signal.h. Include time.h only if available. * configure.ac (INSERT_SYS_TIME_H, INSERT_TIME_H, INSERT_SIGNAL_H): Detect header files and ac_subst snippets. Remove obsolete debug stuff. + + commit 957044558c489ce55835501e4c2dc30d6a28dc79 * src/npth.c (enter_npth, leave_npth): Remove argument and debug stuff. (ENTER, LEAVE): Adjust macros accordingly. Add a basic create and join thread test case. + + commit 246d9e5f0201286c380eef88f5cfa1dafd16b428 * tests/t-thread.c: New * tests/t-support.h (opt_verbose): New. (fail_msg, info_msg): New. Make npth_setname_np actually work. + + commit b4c396baaf824d1315708e81b4768cc7e13ab226 * src/npth.c (npth_setname_np): Fix typo in name and test macro. Check for -lsocket et al. + + commit 96964e02c18a7d79375da9481c8f9d8c35404b7b * m4/libsocket.m4: New. Stripped down from gnulib's socketlib.m4. * tests/Makefile.am (LDADD): Add LIBSOCKET. * configure.ac (NETLIBS): Remove because it is not used. @@ -206,54 +416,66 @@ 2012-05-09 Werner Koch Add a pselect emulation. + + commit 74bf5068ac96a2abb66d60b86acc1882f0d864d1 * src/npth.c [!HAVE_PSELECT]: Include signal.h (npth_pselect) [!HAVE_PSELECT]: Implement a crude pselect emulation * configure.ac (AC_CHECK_FUNCS): Test for pselect. Cleanup the debug code. + + commit f24cc48ef797f7338a4d95db412ba61e60ba3cf7 Debugging was only used for initial testing and there is no interface to enable it at runtime. This change make the code a little bit cleaner. Take care of possible surprising sem_init implementations. + + commit 05e423336a86f0530f50d567060a799d2824dff7 * src/npth.c (npth_init): Return an error only for POSIX.1-2008. Make the t-mutex test more robust. + + commit 2c86233acfeef843167694f45fd3f208d5ec96b6 * tests/t-support.h: Simplify. * tests/t-mutex.c: Include t-support.h. (main): Check each call and explicitly return 0. Let npth_init actually return an error. + + commit a03223379c937763df9873c4ba9aa8a64cbd94d7 * src/npth.c (npth_init): Return ERRNO. Provide a replacement for socklen_t. + + commit a5d8a7fb56caef0e03ad6ebc8287eacf8c5dd7ba * m4/socklen.m4, m4/sys_socket_h.m4: New. * configure.ac (INSERT_SOCKLEN_T): New. * src/npth.h.in (INSERT_SOCKLEN_T): New substitution. (npth_connect, npth_accept): Use _npth_socklen_t. Do not use ___FUNCTION__. + + commit 9596d679b14eeedbe0f06fecbaeeded84b05e719 * src/npth.c: Define replacement for __func__. (ENTER, LEAVE): Use __func__. Tweak for building with c99. + + commit 219fcc09f224d9c0ceb2c4b4b87831ba6349527b * tests/Makefile.am (AM_CPPFLAGS): Add -D_POSIX_C_SOURCE=200112L. Add unistd.h is available. + + commit 6d15e15d142b6843ea955a85badd370093585372 * configure.ac (AC_CHECK_HEADERS): Test for unistd.h. * src/npth.c [HAVE_UNISTD_H]: Include unistd.h. 2012-05-04 Werner Koch Implement git magic to create beta version numbers. + + commit e44910011d30d13a858ccd46455b2fc33527e06a * configure.ac (BUILD_FILEVERSION): Move after detection of W32. Release 0.90. + + commit 9670c423161c7561020e724fe739815b93665bcd * configure.ac: Bump LT version to C0/A0/R1. 2012-03-09 Marcus Brinkmann Support Android API level earlier than 9. + + commit cbb52bd5ada02bbd914869f4540221831358d077 * src/npth.h [__ANDROID__]: Include (_NPTH_NO_RWLOCK) [__ANDROID__ && __ANDROID_API__ < 9]: Define. (npth_rwlockattr_t, npth_rwlockattr_init, npth_rwlockattr_destroy, @@ -270,6 +492,7 @@ 2012-02-28 Marcus Brinkmann Remove npth_yield. + + commit c30634abebb287f56a6a2480b4bbd2ffc166dd4d * src/npth.h.in (npth_yield): Macro removed (should have been a function anyway). * w32/npth.c (npth_yield): Remove function. @@ -277,6 +500,7 @@ * w32/npth.def (npth_yield): Remove symbol export. Make rwlock try and timed functions optional. + + commit 798d166a64ed88e75e2827579f6be1526d73f54f * configure.ac: Check for pthread_rwlock_rdlock, pthread_rwlock_wrlock, pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock, pthread_rwlock_tryrdlock, pthread_rwlock_trywrlock. @@ -294,16 +518,20 @@ Use busy_wait_for. Add generated files src/npth.h and w32/npth-config. + + commit 4a98eac43e7ad36c32f2feacf261ddcec81b20e9 + 2012-02-08 Marcus Brinkmann Fix include path for non-w32 builds. + + commit 96caea9d6c0a38eecb07ca4009c00dbcd20ab63f * tests/Makefile.am (AM_CPPFLAGS) [!HAVE_W32_SYSTEM]: Locate header in build dir, not src. 2012-01-31 Marcus Brinkmann Implement npth_mutex_timedlock for inferior systems. + + commit 64b99056b8ef2cf13a5ef206193d7ef40ee2bdb3 * configure.ac: Check for pthread_mutex_timedlock. * src/npth.c (BUSY_WAIT_INTERVAL): New macro. (npth_mutex_timedlock): If pthread_mutex_timedlock is missing, @@ -312,6 +540,7 @@ 2012-01-27 Werner Koch Include sys/select.h if needed. + + commit 3a8ebdd6a418461ac57994676f27aac13a444d4c * src/npth.h: Rename to npth.h.in. Include sys/select.h if available. Add usual read-only comments. * configure.ac: Create npth.h. @@ -319,16 +548,19 @@ (emacs_local_vars_read_only): New vars to support read-only switching. Update config.guess and config.sub. + + commit 3cc80f63c0b0ebeb521e48debfd2a7fadcbb4116 * config.guess, config.sub: Update to version 2012-01-01. * autogen.sh: Fix typo. Encapsulate clock_gettime. + + commit 951bd3e3487f07df82855ec4068af4f0226a7a67 * src/Makefile.am (libnpth_la_LDFLAGS): Remove -pthread and -lrt. * src/npth.h (npth_clock_gettime): Turn macro into a function. * src/npth.c (npth_clock_gettime): New. * src/libnpth.vers: Add npth_clock_gettime. Improve pthread library detection. + + commit edbf7f1c802f82262ac595fc77bffefab2118573 * configure.ac: Reorder some code. Improve pthread test to take libc in account. Generate NPTH_CONFIG_LIBS from tests. * src/npth-config.in: Use NPTH_CONFIG_LIBS. @@ -338,9 +570,11 @@ 2012-01-26 Werner Koch Remove unused include files from npth.h. + + commit 8fac9f692d47147050333ec7f12a8a5ec497be54 * src/npth.h: Remove unused poll.h and errno.h includes. Make npth_{s,g}etname_np portable. + + commit dbfcb88f4281e8b69a41959c94ea658b7550160c These functions are usually used for debugging. On systems where they are not easy to support they will now simply return ENOSYS. * configure.ac: Check for pthread_setname_np and pthread_getname_np. @@ -350,6 +584,7 @@ functions. Check for the non-portable pthread_tryjoin_np. + + commit 6fde8b5a7463204f93cf537515921b1734c83364 * configure.ac: Check for pthread_tryjoin_np. Also rework the pthread test to update LIBS * src/npth.c (npth_join) [HAVE_PTHREAD_TRYJOIN_NP]: Use @@ -358,16 +593,19 @@ 2012-01-25 Marcus Brinkmann Fix thread startup. + + commit f142c818e60d338b2df197ca3351b2f567ff6dfe * src/npth.c (npth_create): Fix startup data use. 2012-01-25 Werner Koch Include stdlib.h for malloc prototypes. + + commit 9f488127ff9d59cdb9e89600e5aa1821f85379ae * src/npth.c: Include stdlib.h. 2012-01-24 Werner Koch Require gitlog-to-changelog to be installed. + + commit 0c481067f73d2c4e49fca85f2647cc550d23315d * Makefile.am (gen-ChangeLog): Do no use included gitlog-to-changelog. Use options --append-dot and --tear-off. * build-aux/gitlog-to-changelog: Remove from repo. @@ -375,6 +613,7 @@ 2012-01-23 Marcus Brinkmann Allow manually unprotect/protect calls. + + commit 1c690fa8dad058f6facb1473ad2dcc326ed2aea9 * src/libnpth.vers (npth_unprotect, npth_protect): New symbols. * src/npth.c (npth_unprotect, npth_protect): New functions. * src/npth.h (npth_unprotect, npth_protect): New declaration. @@ -385,27 +624,33 @@ 2012-01-19 Marcus Brinkmann Allow no extra events in npth_eselect. + + commit b64e43f18b198ad2ce0665168f1c84f058204b77 * w32/npth.c (npth_eselect): Allow events to be NULL. Implement ability to wait on sockets and events. + + commit ae0f5109f13a892b3e7b30c829cbe08832b9e971 * w32/npth.c (npth_eselect): New function. * w32/npth.h (npth_eselect): New declaration. * w32/npth.def (npth_eselect): New export. Remove libnpth.vers dependency. + + commit cf3f76455ef5cc1cb76e7e85e2bc4079fc293119 * w32/Makefile.am (libnpth_la_DEPENDENCIES): Remove libnpth.vers. Release mutex temporarily on instant timeout in npth_cond_timedwait. + + commit e6ced3f9f52878a78fa926938bf569c717f7fa49 * w32/npth.c (npth_cond_timedwait): Release mutex temporarily even on instant timeout. 2012-01-13 Marcus Brinkmann Remove obsolete file. + + commit d3e70c770f6031414449ad4cde7aaba7d6b1478e * src/Makefile.am (EXTRA_DIST): Remove npth.def * src/npth.def: Removed. Initial support for w32. + + commit d2769a96a07d11f3c9f7ff6e9d2ce4e0fbc750a3 * Makefile.am [HAVE_W32_SYSTEM]: Build from w32 directory. * configure.ac: Don't check for pthread on windows. Add winsock library on windows. Add w32 subdirectory to config files. @@ -414,14 +659,17 @@ * tests/Makefile.am: Allow building on w32. Add missing function npth_system. + + commit 8cf18d22725e301a4b2b052d8d73b35cdb157d38 * src/npth.c (npth_system): New function. 2012-01-11 Marcus Brinkmann Remove duplicated macro. + + commit dd7054ea0c3f11ea7fc25a39b7bb68ec78d178df * npth.h (PTHREAD_RWLOCK_INITIALIZER): Remove. Add some missing interfaces. + + commit 9785a216bc95d80b3222f8dc4ff0f70c5c183651 * npth.h (npth_key_delete, NPTH_ERRORCHECK_MUTEX_INITIALIZER_NP, npth_rwlockattr_t, npth_rwlockattr_init, npth_rwlockattr_destroy, npth_rwlockattr_gettype_np, npth_rwlockattr_settype_np, @@ -435,6 +683,7 @@ 2012-01-06 Marcus Brinkmann Fix exclusion logic at thread creation and allow main thread to exit. + + commit 316f3deca8450633ba6724eb55d54fd9249610fb * libnpth.vers (npth_create, npth_exit): New. * npth.def (npth_create, npth_exit): Likewise. * npth.h (npth_create): Change from macro to declaration. @@ -445,6 +694,7 @@ 2011-12-06 Werner Koch Create the ChangeLog from the git commit log. + + commit 46d0a03879612c6dcddc5bf93004881f9c768cd6 * autogen.sh: Install git commit log checker. * build-aux/git-hooks/commit-msg: New. Repo only. * build-aux/git-log-fix: New. Repo only. diff -Nru npth-1.2/config.h.in npth-1.6/config.h.in --- npth-1.2/config.h.in 2015-04-11 12:00:23.000000000 +0000 +++ npth-1.6/config.h.in 2018-07-16 07:33:36.000000000 +0000 @@ -1,17 +1,26 @@ /* config.h.in. Generated from configure.ac by autoheader. */ +/* The time this package was configured for a build */ +#undef BUILD_TIMESTAMP + /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Defined if we have fork-unsafe semaphore */ +#undef HAVE_FORK_UNSAFE_SEMAPHORE + /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Defined if we have libdispatch */ +#undef HAVE_LIB_DISPATCH + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -109,7 +118,7 @@ */ #undef LT_OBJDIR -/* Name of this package */ +/* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ @@ -155,7 +164,7 @@ #endif -/* Version of this package */ +/* Version number of package */ #undef VERSION /* Define to 1 if on MINIX. */ @@ -172,9 +181,6 @@ # define _REENTRANT 1 #endif -/* Activate POSIX interface on MacOS X */ -#undef _XOPEN_SOURCE - /* Define to `int' if does not define. */ #undef pid_t diff -Nru npth-1.2/configure npth-1.6/configure --- npth-1.2/configure 2015-04-11 12:02:28.000000000 +0000 +++ npth-1.6/configure 2018-07-16 07:33:37.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for npth 1.2. +# Generated by GNU Autoconf 2.69 for npth 1.6. # -# Report bugs to . +# Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -275,7 +275,7 @@ $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: gnupg-devel@gnupg.org about your system, including any +$0: https://bugs.gnupg.org about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." @@ -590,9 +590,9 @@ # Identity of this package. PACKAGE_NAME='npth' PACKAGE_TARNAME='npth' -PACKAGE_VERSION='1.2' -PACKAGE_STRING='npth 1.2' -PACKAGE_BUGREPORT='gnupg-devel@gnupg.org' +PACKAGE_VERSION='1.6' +PACKAGE_STRING='npth 1.6' +PACKAGE_BUGREPORT='https://bugs.gnupg.org' PACKAGE_URL='' ac_unique_file="src/npth.c" @@ -645,6 +645,7 @@ emacs_local_vars_read_only emacs_local_vars_begin NETLIBS +LIB_CLOCK_GETTIME LIBSOCKET INSERT_SOCKLEN_T SYS_SOCKET_H @@ -652,9 +653,9 @@ INSERT_TIME_H INSERT_SYS_TIME_H INSERT_SYS_SELECT_H +BUILD_TIMESTAMP BUILD_FILEVERSION BUILD_ISODATE -BUILD_TIMESTAMP HAVE_W64_SYSTEM_FALSE HAVE_W64_SYSTEM_TRUE HAVE_W32_SYSTEM_FALSE @@ -684,9 +685,6 @@ AS RUN_TESTS_FALSE RUN_TESTS_TRUE -LIBNPTH_LT_REVISION -LIBNPTH_LT_AGE -LIBNPTH_LT_CURRENT EGREP GREP CPP @@ -745,6 +743,10 @@ INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM +VERSION_NUMBER +LIBNPTH_LT_REVISION +LIBNPTH_LT_AGE +LIBNPTH_LT_CURRENT target_alias host_alias build_alias @@ -797,6 +799,7 @@ with_gnu_ld with_sysroot enable_libtool_lock +enable_build_timestamp ' ac_precious_vars='build_alias host_alias @@ -1347,7 +1350,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures npth 1.2 to adapt to many kinds of systems. +\`configure' configures npth 1.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1417,7 +1420,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of npth 1.2:";; + short | recursive ) echo "Configuration of npth 1.6:";; esac cat <<\_ACEOF @@ -1440,6 +1443,9 @@ --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --enable-build-timestamp + set an explicit build timestamp for reproducibility. + (default is the current time in ISO-8601 format) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1463,7 +1469,7 @@ Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -1526,7 +1532,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -npth configure 1.2 +npth configure 1.6 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1685,9 +1691,9 @@ $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ------------------------------------ ## -## Report this to gnupg-devel@gnupg.org ## -## ------------------------------------ ##" +( $as_echo "## ------------------------------------- ## +## Report this to https://bugs.gnupg.org ## +## ------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac @@ -1949,7 +1955,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by npth $as_me 1.2, which was +It was created by npth $as_me 1.6, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2298,24 +2304,28 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - # LT Version numbers, remember to change them just *before* a release. # (Code changed: REVISION++) # (Interfaces added/removed/changed: CURRENT++, REVISION=0) # (Interfaces added: AGE++) -# (Interfaces removed/changed: AGE=0) +# (Interfaces removed: AGE=0) # -LIBNPTH_LT_CURRENT=0 -LIBNPTH_LT_AGE=0 -LIBNPTH_LT_REVISION=5 +LIBNPTH_LT_CURRENT=1 +LIBNPTH_LT_AGE=1 +LIBNPTH_LT_REVISION=2 +################################################ + + + + + +VERSION_NUMBER=0x010600 + # If the API is changed in an incompatible way: increment the next counter. NPTH_CONFIG_API_VERSION=1 ############################################## -PACKAGE=$PACKAGE_NAME -VERSION=$PACKAGE_VERSION - ac_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do if test -f "$ac_dir/install-sh"; then @@ -2345,10 +2355,6 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - -ac_config_headers="$ac_config_headers config.h" - - am__api_version='1.14' # Find a good install program. We prefer a C program (faster), @@ -2835,7 +2841,7 @@ # Define the identity of the package. PACKAGE='npth' - VERSION='1.2' + VERSION='1.6' cat >>confdefs.h <<_ACEOF @@ -2951,6 +2957,10 @@ MAINT=$MAINTAINER_MODE_TRUE + +ac_config_headers="$ac_config_headers config.h" + + # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 @@ -5293,23 +5303,6 @@ - - - - - - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - - run_tests="yes" # Check whether --enable-tests was given. if test "${enable_tests+set}" = set; then : @@ -12937,14 +12930,131 @@ have_ld_version_script=no case "${host}" in *-*-linux*) - have_ld_version_script=yes + have_ld_version_script=yes ;; *-*-gnu*) - have_ld_version_script=yes + have_ld_version_script=yes ;; *-apple-darwin*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dispatch_semaphore_create" >&5 +$as_echo_n "checking for library containing dispatch_semaphore_create... " >&6; } +if ${ac_cv_search_dispatch_semaphore_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$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 dispatch_semaphore_create (); +int +main () +{ +return dispatch_semaphore_create (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dispatch; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_dispatch_semaphore_create=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_dispatch_semaphore_create+:} false; then : + break +fi +done +if ${ac_cv_search_dispatch_semaphore_create+:} false; then : + +else + ac_cv_search_dispatch_semaphore_create=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dispatch_semaphore_create" >&5 +$as_echo "$ac_cv_search_dispatch_semaphore_create" >&6; } +ac_res=$ac_cv_search_dispatch_semaphore_create +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +$as_echo "#define HAVE_LIB_DISPATCH 1" >>confdefs.h + +fi + + ;; + *-*-aix*) + have_fork_unsafe_semaphore=yes + ;; + *-*-dragonfly*|*-*-freebsd*|*-*-netbsd*|*-*-hpux*) + LIBS="-lpthread $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5 +$as_echo_n "checking for library containing sem_init... " >&6; } +if ${ac_cv_search_sem_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$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 sem_init (); +int +main () +{ +return sem_init (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_sem_init=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_sem_init+:} false; then : + break +fi +done +if ${ac_cv_search_sem_init+:} false; then : -$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h +else + ac_cv_search_sem_init=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_init" >&5 +$as_echo "$ac_cv_search_sem_init" >&6; } +ac_res=$ac_cv_search_sem_init +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi ;; esac @@ -12957,9 +13067,14 @@ HAVE_LD_VERSION_SCRIPT_FALSE= fi +if test "$have_fork_unsafe_semaphore" = yes; then + +$as_echo "#define HAVE_FORK_UNSAFE_SEMAPHORE 1" >>confdefs.h + +fi # Set some default values -config_libs="-lnpth" +config_libs="-lnpth $LIBS" have_w32_system=no have_w32ce_system=no have_w64_system=no @@ -12971,7 +13086,7 @@ ;; *-mingw32ce*) have_w32ce_system=yes - ;; + ;; esac case "${host}" in *-mingw32ce*|*-mingw32*) @@ -13013,14 +13128,29 @@ # Generate values for the DLL version info # if test "$have_w32_system" = yes; then - BUILD_TIMESTAMP=`date --iso-8601=minutes` BUILD_ISODATE=`date --iso-8601` BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'` - BUILD_FILEVERSION="${BUILD_FILEVERSION}48279" + BUILD_FILEVERSION="${BUILD_FILEVERSION}git_revision_dec" +fi + + +# Check whether --enable-build-timestamp was given. +if test "${enable_build_timestamp+set}" = set; then : + enableval=$enable_build_timestamp; if test "$enableval" = "yes"; then + BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date` + else + BUILD_TIMESTAMP="$enableval" + fi +else + BUILD_TIMESTAMP="" fi +cat >>confdefs.h <<_ACEOF +#define BUILD_TIMESTAMP "$BUILD_TIMESTAMP" +_ACEOF + # @@ -13220,10 +13350,12 @@ # # Checks for libraries and functions. # +# We test for pthread_detach because glibc 2.22 includes +# pthread_create but not pthread_detach. if test "$have_w32_system" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 -$as_echo_n "checking for library containing pthread_create... " >&6; } -if ${ac_cv_search_pthread_create+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_detach" >&5 +$as_echo_n "checking for library containing pthread_detach... " >&6; } +if ${ac_cv_search_pthread_detach+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -13236,11 +13368,11 @@ #ifdef __cplusplus extern "C" #endif -char pthread_create (); +char pthread_detach (); int main () { -return pthread_create (); +return pthread_detach (); ; return 0; } @@ -13253,31 +13385,31 @@ LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_pthread_create=$ac_res + ac_cv_search_pthread_detach=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if ${ac_cv_search_pthread_create+:} false; then : + if ${ac_cv_search_pthread_detach+:} false; then : break fi done -if ${ac_cv_search_pthread_create+:} false; then : +if ${ac_cv_search_pthread_detach+:} false; then : else - ac_cv_search_pthread_create=no + ac_cv_search_pthread_detach=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_create" >&5 -$as_echo "$ac_cv_search_pthread_create" >&6; } -ac_res=$ac_cv_search_pthread_create +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_detach" >&5 +$as_echo "$ac_cv_search_pthread_detach" >&6; } +ac_res=$ac_cv_search_pthread_detach if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi - case "x$ac_cv_search_pthread_create" in + case "x$ac_cv_search_pthread_detach" in xno) have_pthread=no ;; @@ -13286,7 +13418,7 @@ ;; *) have_pthread=yes - config_libs="$config_libs $ac_cv_search_pthread_create" + config_libs="$config_libs $ac_cv_search_pthread_detach" ;; esac if test "$have_pthread" != no; then @@ -13493,6 +13625,12 @@ config_libs="$config_libs $LIBSOCKET" +# Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* +# programs in the package would end up linked with that potentially-shared +# library, inducing unnecessary run-time overhead. +LIB_CLOCK_GETTIME= + +gl_saved_libs=$LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 $as_echo_n "checking for library containing clock_gettime... " >&6; } if ${ac_cv_search_clock_gettime+:} false; then : @@ -13546,15 +13684,18 @@ ac_res=$ac_cv_search_clock_gettime if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -if test "x$ac_cv_search_clock_gettime" != no; then + if test "$ac_cv_search_clock_gettime" != "none required"; then + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime + config_libs="$config_libs $LIB_CLOCK_GETTIME" + fi $as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + fi +LIBS=$gl_saved_libs + # # Set NETLIBS @@ -14180,7 +14321,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by npth $as_me 1.2, which was +This file was extended by npth $as_me 1.6, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14240,13 +14381,13 @@ Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -npth config.status 1.2 +npth config.status 1.6 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -16238,8 +16379,8 @@ echo " - $PACKAGE_NAME-$PACKAGE_VERSION prepared for make + $PACKAGE_NAME v$PACKAGE_VERSION prepared for make - Revision: bc97d51 (48279) + Revision: 7712879 (30482) Platform: $host " diff -Nru npth-1.2/configure.ac npth-1.6/configure.ac --- npth-1.2/configure.ac 2015-04-11 11:57:20.000000000 +0000 +++ npth-1.6/configure.ac 2018-07-16 07:19:28.000000000 +0000 @@ -1,23 +1,14 @@ # configure.ac -*- Autoconf -*- # Copyright (C) 2011, 2012 g10 Code GmbH -# This file is part of NPTH. # -# NPTH is free software; you can redistribute it and/or modify it -# under the terms of either +# This file is part of nPth. # -# - the GNU Lesser General Public License as published by the Free -# Software Foundation; either version 3 of the License, or (at -# your option) any later version. +# nPth is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. # -# or -# -# - the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# or both in parallel, as here. -# -# NPTH is distributed in the hope that it will be useful, but WITHOUT +# nPth is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General # Public License for more details. @@ -35,47 +26,56 @@ # the version number immediately after the release and do another # commit and push so that the git magic is able to work. # See below for the LT versions. -m4_define(my_version, [1.2]) +m4_define([mym4_package],[npth]) +m4_define([mym4_major], [1]) +m4_define([mym4_minor], [6]) + +# To start a new development series, i.e a new major or minor number +# you need to mark an arbitrary commit before the first beta release +# with an annotated tag. For example a 2.1 branch starts off with +# the tag "foo-2.1-base". This is used as the base for counting +# beta numbers before the first release of a series. # Below is m4 magic to extract and compute the git revision number, # the decimalized short revision number, a beta version string and a -# flag indicating a development version (my_isgit). The latter works -# by requiring the final tag in the repository. -m4_define([git_revision], - m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r'])) -m4_define([git_revision_dec], - m4_esyscmd_s([echo $((0x$(echo ]git_revision[|head -c 4)))])) -m4_define([git_betastring], - m4_esyscmd_s([git describe --match 'npth-[0-9].*[0-9]' --long|\ - awk -F- '$3!=0{print"-beta"$3}'])) -m4_define([my_isgit],m4_if(git_betastring,[],[no],[yes])) -m4_define([my_full_version],[my_version[]git_betastring]) - -AC_INIT([npth],[my_full_version],[gnupg-devel@gnupg.org]) - +# flag indicating a development version (mym4_isbeta). Note that the +# m4 processing is done by autoconf and not during the configure run. +m4_define([mym4_verslist], m4_split(m4_esyscmd([./autogen.sh --find-version] \ + mym4_package mym4_major mym4_minor),[:])) +m4_define([mym4_isbeta], m4_argn(2, mym4_verslist)) +m4_define([mym4_version], m4_argn(4, mym4_verslist)) +m4_define([mym4_revision], m4_argn(7, mym4_verslist)) +m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist)) +m4_esyscmd([echo ]mym4_version[>VERSION]) +AC_INIT([mym4_package],[mym4_version], [https://bugs.gnupg.org]) # LT Version numbers, remember to change them just *before* a release. # (Code changed: REVISION++) # (Interfaces added/removed/changed: CURRENT++, REVISION=0) # (Interfaces added: AGE++) -# (Interfaces removed/changed: AGE=0) +# (Interfaces removed: AGE=0) # -LIBNPTH_LT_CURRENT=0 -LIBNPTH_LT_AGE=0 -LIBNPTH_LT_REVISION=5 +LIBNPTH_LT_CURRENT=1 +LIBNPTH_LT_AGE=1 +LIBNPTH_LT_REVISION=2 +################################################ + +AC_SUBST(LIBNPTH_LT_CURRENT) +AC_SUBST(LIBNPTH_LT_AGE) +AC_SUBST(LIBNPTH_LT_REVISION) + +VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x00" mym4_major mym4_minor) +AC_SUBST(VERSION_NUMBER) # If the API is changed in an incompatible way: increment the next counter. NPTH_CONFIG_API_VERSION=1 ############################################## -PACKAGE=$PACKAGE_NAME -VERSION=$PACKAGE_VERSION - AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip]) +AM_MAINTAINER_MODE AC_CONFIG_SRCDIR([src/npth.c]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip]) -AM_MAINTAINER_MODE AC_CANONICAL_HOST AM_SILENT_RULES @@ -90,15 +90,6 @@ # Checks for programs. AC_PROG_CC -AC_SUBST(LIBNPTH_LT_CURRENT) -AC_SUBST(LIBNPTH_LT_AGE) -AC_SUBST(LIBNPTH_LT_REVISION) - -AC_SUBST(PACKAGE) -AC_SUBST(VERSION) -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package]) - run_tests="yes" AC_ARG_ENABLE(tests, AC_HELP_STRING([--disable-tests], [disable tests]), @@ -117,20 +108,31 @@ have_ld_version_script=no case "${host}" in *-*-linux*) - have_ld_version_script=yes + have_ld_version_script=yes ;; *-*-gnu*) - have_ld_version_script=yes + have_ld_version_script=yes ;; *-apple-darwin*) - AC_DEFINE(_XOPEN_SOURCE, 500, Activate POSIX interface on MacOS X) + AC_SEARCH_LIBS([dispatch_semaphore_create],[dispatch], + [AC_DEFINE([HAVE_LIB_DISPATCH],1,[Defined if we have libdispatch])]) + ;; + *-*-aix*) + have_fork_unsafe_semaphore=yes + ;; + *-*-dragonfly*|*-*-freebsd*|*-*-netbsd*|*-*-hpux*) + LIBS="-lpthread $LIBS" + AC_SEARCH_LIBS([sem_init],[rt]) ;; esac AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") +if test "$have_fork_unsafe_semaphore" = yes; then + AC_DEFINE(HAVE_FORK_UNSAFE_SEMAPHORE, 1, [Defined if we have fork-unsafe semaphore]) +fi # Set some default values -config_libs="-lnpth" +config_libs="-lnpth $LIBS" have_w32_system=no have_w32ce_system=no have_w64_system=no @@ -142,7 +144,7 @@ ;; *-mingw32ce*) have_w32ce_system=yes - ;; + ;; esac case "${host}" in *-mingw32ce*|*-mingw32*) @@ -168,16 +170,27 @@ # Generate values for the DLL version info # if test "$have_w32_system" = yes; then - BUILD_TIMESTAMP=`date --iso-8601=minutes` BUILD_ISODATE=`date --iso-8601` changequote(,)dnl BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'` changequote([,])dnl BUILD_FILEVERSION="${BUILD_FILEVERSION}git_revision_dec" fi -AC_SUBST(BUILD_TIMESTAMP) AC_SUBST(BUILD_ISODATE) AC_SUBST(BUILD_FILEVERSION) +AC_ARG_ENABLE([build-timestamp], + AC_HELP_STRING([--enable-build-timestamp], + [set an explicit build timestamp for reproducibility. + (default is the current time in ISO-8601 format)]), + [if test "$enableval" = "yes"; then + BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date` + else + BUILD_TIMESTAMP="$enableval" + fi], + [BUILD_TIMESTAMP=""]) +AC_SUBST(BUILD_TIMESTAMP) +AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP", + [The time this package was configured for a build]) # @@ -237,9 +250,11 @@ # # Checks for libraries and functions. # +# We test for pthread_detach because glibc 2.22 includes +# pthread_create but not pthread_detach. if test "$have_w32_system" = no; then - AC_SEARCH_LIBS([pthread_create],[pthread]) - case "x$ac_cv_search_pthread_create" in + AC_SEARCH_LIBS([pthread_detach],[pthread]) + case "x$ac_cv_search_pthread_detach" in xno) have_pthread=no ;; @@ -248,7 +263,7 @@ ;; *) have_pthread=yes - config_libs="$config_libs $ac_cv_search_pthread_create" + config_libs="$config_libs $ac_cv_search_pthread_detach" ;; esac if test "$have_pthread" != no; then @@ -267,11 +282,21 @@ npth_LIBSOCKET config_libs="$config_libs $LIBSOCKET" -AC_SEARCH_LIBS([clock_gettime],[rt posix4]) -if test "x$ac_cv_search_clock_gettime" != no; then - AC_DEFINE(HAVE_CLOCK_GETTIME,1, - [Define to 1 if you have the `clock_gettime' function.]) -fi +# Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* +# programs in the package would end up linked with that potentially-shared +# library, inducing unnecessary run-time overhead. +LIB_CLOCK_GETTIME= +AC_SUBST([LIB_CLOCK_GETTIME]) +gl_saved_libs=$LIBS +AC_SEARCH_LIBS([clock_gettime], [rt posix4], + [if test "$ac_cv_search_clock_gettime" != "none required"; then + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime + config_libs="$config_libs $LIB_CLOCK_GETTIME" + fi + AC_DEFINE([HAVE_CLOCK_GETTIME],1, + [Define to 1 if you have the `clock_gettime' function.]) + ]) +LIBS=$gl_saved_libs # @@ -340,8 +365,8 @@ AC_OUTPUT echo " - $PACKAGE_NAME-$PACKAGE_VERSION prepared for make + $PACKAGE_NAME v$PACKAGE_VERSION prepared for make - Revision: git_revision (git_revision_dec) + Revision: mym4_revision (mym4_revision_dec) Platform: $host " diff -Nru npth-1.2/COPYING npth-1.6/COPYING --- npth-1.2/COPYING 2013-03-15 19:25:51.000000000 +0000 +++ npth-1.6/COPYING 1970-01-01 00:00:00.000000000 +0000 @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff -Nru npth-1.2/COPYING.LESSER npth-1.6/COPYING.LESSER --- npth-1.2/COPYING.LESSER 2013-03-15 19:25:51.000000000 +0000 +++ npth-1.6/COPYING.LESSER 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff -Nru npth-1.2/COPYING.LIB npth-1.6/COPYING.LIB --- npth-1.2/COPYING.LIB 1970-01-01 00:00:00.000000000 +0000 +++ npth-1.6/COPYING.LIB 2017-05-16 07:33:40.000000000 +0000 @@ -0,0 +1,508 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff -Nru npth-1.2/debian/changelog npth-1.6/debian/changelog --- npth-1.2/debian/changelog 2016-02-20 17:34:00.000000000 +0000 +++ npth-1.6/debian/changelog 2022-10-18 00:48:01.000000000 +0000 @@ -1,3 +1,91 @@ +npth (1.6-3~16.04.sav0) xenial; urgency=medium + + * Backport to Xenial + * debian/control: Set debhelper-compat (= 10) BD (LP highest for Xenial) + + -- Rob Savoury Mon, 17 Oct 2022 17:48:01 -0700 + +npth (1.6-3) unstable; urgency=medium + + [ Debian Janitor ] + * Apply multi-arch hints. + + libnpth-mingw-w64-dev: Add Multi-Arch: foreign. + + [ Eric Dorland ] + * Add dch section + * debhelper compat level to 12 + * Standards-Version to 4.5.0.3 + * Add Rules-Requires-Root: no + * Drop --ddeb-migration + + -- Eric Dorland Sat, 17 Oct 2020 23:16:57 -0400 + +npth (1.6-2) unstable; urgency=medium + + [ Debian Janitor ] + * Trim trailing whitespace. + * Use secure copyright file specification URI. + * Set debhelper-compat version in Build-Depends. + * Remove Section on libnpth-mingw-w64-dev that duplicates source. + + -- Eric Dorland Mon, 15 Jun 2020 00:40:15 -0400 + +npth (1.6-1) unstable; urgency=medium + + * New upstream release. + + -- Eric Dorland Tue, 17 Jul 2018 14:11:00 -0400 + +npth (1.5-4) unstable; urgency=medium + + * Update VCS fields to point at salsa.debian.org + * Update debhelper to version 11 + * Standards-Version to 4.1.4.1 + + -- Eric Dorland Sun, 03 Jun 2018 01:12:03 -0400 + +npth (1.5-3) unstable; urgency=medium + + * debian/rules: Fix buildpath embedding for windows build. Thanks Daniel + Kahn Gillmor. (Closes: #881152) + * debian/control: Remove priority extra. + * debian/control: Standards-Version to 4.1.1.1. + + -- Eric Dorland Sun, 12 Nov 2017 00:14:50 -0500 + +npth (1.5-2) unstable; urgency=medium + + * Retarget to unstable. + * debian/control: Standards-Version to 4.0.0. + + -- Eric Dorland Sat, 24 Jun 2017 16:51:41 -0400 + +npth (1.5-1) experimental; urgency=medium + + * New upstream release. + + -- Eric Dorland Wed, 07 Jun 2017 01:18:27 -0400 + +npth (1.4-1) experimental; urgency=medium + + * New upstream release. + * debian/watch: Use https instead of ftp. + * debian/copyright: Relicensed to LGPL-2.1+. + * debian/libnpth0.symbols: Add npth_is_protected symbol. + + -- Eric Dorland Sat, 20 May 2017 18:10:02 -0400 + +npth (1.3-1) unstable; urgency=medium + + * New upstream release. + * debian/control: Standard-Version to 3.9.8. + * debian/compact, debian/control, debian/rules: Upgrade to debhelper + level 10. + * libnpth-mingw-w64-dev.lintian-overrides: Add lintian overrides for + mingw .la files. + + -- Eric Dorland Sat, 26 Nov 2016 18:45:00 -0500 + npth (1.2-3) unstable; urgency=medium * debian/control: Convert Homepage and Vcs-* to https. @@ -100,5 +188,3 @@ * Initial release. (Closes: #672202) -- Eric Dorland Wed, 09 May 2012 00:21:14 -0400 - - diff -Nru npth-1.2/debian/compat npth-1.6/debian/compat --- npth-1.2/debian/compat 2016-02-20 17:34:00.000000000 +0000 +++ npth-1.6/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru npth-1.2/debian/control npth-1.6/debian/control --- npth-1.2/debian/control 2016-02-20 17:34:00.000000000 +0000 +++ npth-1.6/debian/control 2022-10-18 00:47:52.000000000 +0000 @@ -2,12 +2,13 @@ Section: libdevel Priority: optional Maintainer: Eric Dorland -Build-Depends: debhelper (>= 9.20151219), dh-autoreconf +Build-Depends: debhelper-compat (= 10) Build-Depends-Indep: mingw-w64 -Standards-Version: 3.9.6.1 +Standards-Version: 4.5.0.3 +Rules-Requires-Root: no Homepage: https://www.gnupg.org/ -Vcs-Git: https://anonscm.debian.org/git/users/eric/npth.git -Vcs-Browser: https://anonscm.debian.org/cgit/users/eric/npth.git +Vcs-Git: https://salsa.debian.org/eric/npth.git +Vcs-Browser: https://salsa.debian.org/eric/npth Package: libnpth0-dev Architecture: any @@ -40,10 +41,9 @@ Package: libnpth-mingw-w64-dev Architecture: all -Priority: extra -Section: libdevel Suggests: mingw-w64 Depends: ${misc:Depends}, ${shlibs:Depends} +Multi-Arch: foreign Description: replacement for GNU Pth using system threads (Windows dev) nPth is a non-preemptive threads implementation using an API very similar to the one known from GNU Pth. It has been designed as a diff -Nru npth-1.2/debian/copyright npth-1.6/debian/copyright --- npth-1.2/debian/copyright 2016-02-20 17:34:00.000000000 +0000 +++ npth-1.6/debian/copyright 2020-10-18 03:16:57.000000000 +0000 @@ -1,48 +1,30 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: nPth Upstream-Contact: Werner Koch Source: ftp://ftp.gnupg.org/gcrypt/npth/ Files: * -Copyright: Copyright (C) 2011, 2012 g10 Code GmbH -License: GPL-2+ or LGPL-3+ +Copyright: Copyright (C) 2011, 2012, 2015, 2017 g10 Code GmbH +License: LGPL-2.1+ Files: debian/* -Copyright: 2012 Eric Dorland -License: GPL-2+ or LGPL-3+ +Copyright: 2017 Eric Dorland +License: LGPL-2.1+ -License: GPL-2+ - nPth is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 of +License: LGPL-2.1+ + nPth is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. . - nPth is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. + nPth is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU Lesser General Public License for more details. . - You should have received a copy of the GNU General Public License - along with this program; if not, see . - . - On Debian systems, the full text of the GNU General Public - License version 2 can be found in the file - `/usr/share/common-licenses/GPL-2'. - -License: LGPL-3+ - nPth is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the - License, or (at your option) any later version. - . - nPth is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - . - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, see . + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, see . . On Debian systems, the full text of the GNU Lesser General Public - License version 3 can be found in the file - `/usr/share/common-licenses/LGPL-3'. + License version 2.1 can be found in the file + `/usr/share/common-licenses/LGPL-2.1'. diff -Nru npth-1.2/debian/gbp.conf npth-1.6/debian/gbp.conf --- npth-1.2/debian/gbp.conf 2016-02-20 17:34:00.000000000 +0000 +++ npth-1.6/debian/gbp.conf 2020-10-18 03:16:57.000000000 +0000 @@ -1,3 +1,6 @@ [DEFAULT] pristine-tar = True upstream-vcs-tag = npth-%(version)s + +[dch] +commit-msg = debian/changelog: %(version)s diff -Nru npth-1.2/debian/libnpth0.symbols npth-1.6/debian/libnpth0.symbols --- npth-1.2/debian/libnpth0.symbols 2016-02-20 17:34:00.000000000 +0000 +++ npth-1.6/debian/libnpth0.symbols 2020-10-18 03:16:57.000000000 +0000 @@ -9,6 +9,7 @@ npth_exit@NPTH_1.0 0.90 npth_getname_np@NPTH_1.0 0.90 npth_init@NPTH_1.0 0.90 + npth_is_protected@NPTH_1.0 1.4 npth_join@NPTH_1.0 0.90 npth_mutex_lock@NPTH_1.0 0.90 npth_mutex_timedlock@NPTH_1.0 0.90 diff -Nru npth-1.2/debian/libnpth-mingw-w64-dev.lintian-overrides npth-1.6/debian/libnpth-mingw-w64-dev.lintian-overrides --- npth-1.2/debian/libnpth-mingw-w64-dev.lintian-overrides 2016-02-20 17:34:00.000000000 +0000 +++ npth-1.6/debian/libnpth-mingw-w64-dev.lintian-overrides 2020-10-18 03:16:57.000000000 +0000 @@ -11,3 +11,8 @@ # DLLs exported via Samba need to be executable (see #796224) libnpth-mingw-w64-dev: executable-not-elf-or-script + +# cross-building for windows produces more weirdness than expected: +libnpth-mingw-w64-dev: non-empty-dependency_libs-in-la-file usr/i686-w64-mingw32/lib/libnpth.la +libnpth-mingw-w64-dev: non-empty-dependency_libs-in-la-file usr/x86_64-w64-mingw32/lib/libnpth.la + diff -Nru npth-1.2/debian/rules npth-1.6/debian/rules --- npth-1.2/debian/rules 2016-02-20 17:34:00.000000000 +0000 +++ npth-1.6/debian/rules 2020-10-18 03:16:57.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/make -f %: - dh $@ --parallel --with autoreconf + dh $@ override_dh_auto_configure: dh_auto_configure --builddirectory=build -- --enable-static @@ -15,12 +15,10 @@ override_dh_makeshlibs: dh_makeshlibs -V -override_dh_strip: - dh_strip --ddeb-migration='libnpth0-dbg (<< 1.2-2~)' - ### "arch-independent" Windows builds: ### -WIN_FLAGS=LDFLAGS="-Xlinker --no-insert-timestamp" CFLAGS="-g -Os" CPPFLAGS= +WIN_FLAGS=LDFLAGS="-Xlinker --no-insert-timestamp" \ + CFLAGS="-g -Os -fdebug-prefix-map=$(shell pwd)=." CPPFLAGS= override_dh_auto_build-indep: for cpu in i686 x86_64; do \ diff -Nru npth-1.2/debian/watch npth-1.6/debian/watch --- npth-1.2/debian/watch 2016-02-20 17:34:00.000000000 +0000 +++ npth-1.6/debian/watch 2020-10-18 03:16:57.000000000 +0000 @@ -1,4 +1,4 @@ version=3 opts="pgpsigurlmangle=s/$/.sig/" \ - ftp://ftp.gnupg.org/gcrypt/npth/npth-(.*)\.tar\.bz2 + https://gnupg.org/ftp/gcrypt/npth/npth-(.*)\.tar\.bz2 diff -Nru npth-1.2/HACKING npth-1.6/HACKING --- npth-1.2/HACKING 2013-03-15 19:25:51.000000000 +0000 +++ npth-1.6/HACKING 2017-05-16 07:15:31.000000000 +0000 @@ -1,5 +1,5 @@ # HACKING -*- org -*- -#+TITLE: Hacking notes for NPTH +#+TITLE: Hacking notes for nPth #+STARTUP: showall * No ChangeLog files diff -Nru npth-1.2/Makefile.am npth-1.6/Makefile.am --- npth-1.2/Makefile.am 2015-01-28 10:27:00.000000000 +0000 +++ npth-1.6/Makefile.am 2018-07-16 07:16:03.000000000 +0000 @@ -1,14 +1,14 @@ # Makefile.am - Top level Makefile for npth. # Copyright (C) 2011 g10 Code GmbH # -# This file is part of NPTH. +# This file is part of nPth. # -# NPTH is free software; you can redistribute it and/or modify it +# nPth is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # -# NPTH is distributed in the hope that it will be useful, but WITHOUT +# nPth is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General # Public License for more details. @@ -20,7 +20,8 @@ ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = npth-config.in npth.m4 npth.spec.in autogen.sh autogen.rc HACKING +EXTRA_DIST = npth-config.in npth.m4 npth.spec.in autogen.sh autogen.rc \ + HACKING VERSION bin_SCRIPTS = npth-config m4datadir = $(datadir)/aclocal m4data_DATA = npth.m4 @@ -45,7 +46,6 @@ @set -e; \ sed -e 's/@pkg_version@/$(VERSION)/g' \ $(top_srcdir)/npth.spec.in > $(distdir)/npth.spec - echo "$(VERSION)" > $(distdir)/VERSION gen_start_date = 2011-12-01T00:00:00 diff -Nru npth-1.2/Makefile.in npth-1.6/Makefile.in --- npth-1.2/Makefile.in 2015-04-11 12:02:27.000000000 +0000 +++ npth-1.6/Makefile.in 2018-07-16 07:33:36.000000000 +0000 @@ -17,14 +17,14 @@ # Makefile.am - Top level Makefile for npth. # Copyright (C) 2011 g10 Code GmbH # -# This file is part of NPTH. +# This file is part of nPth. # -# NPTH is free software; you can redistribute it and/or modify it +# nPth is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # -# NPTH is distributed in the hope that it will be useful, but WITHOUT +# nPth is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General # Public License for more details. @@ -101,11 +101,10 @@ DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in $(srcdir)/npth-config.in COPYING \ - COPYING.LESSER build-aux/compile build-aux/config.guess \ - build-aux/config.sub build-aux/depcomp build-aux/install-sh \ - build-aux/missing build-aux/ltmain.sh \ - $(top_srcdir)/build-aux/compile \ + $(srcdir)/config.h.in $(srcdir)/npth-config.in COPYING.LIB \ + build-aux/compile build-aux/config.guess build-aux/config.sub \ + build-aux/depcomp build-aux/install-sh build-aux/missing \ + build-aux/ltmain.sh $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/install-sh \ @@ -303,6 +302,7 @@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTOOL = @LIBTOOL@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ @@ -337,6 +337,7 @@ STRIP = @STRIP@ SYS_SOCKET_H = @SYS_SOCKET_H@ VERSION = @VERSION@ +VERSION_NUMBER = @VERSION_NUMBER@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -393,7 +394,9 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = npth-config.in npth.m4 npth.spec.in autogen.sh autogen.rc HACKING +EXTRA_DIST = npth-config.in npth.m4 npth.spec.in autogen.sh autogen.rc \ + HACKING VERSION + bin_SCRIPTS = npth-config m4datadir = $(datadir)/aclocal m4data_DATA = npth.m4 @@ -955,7 +958,6 @@ @set -e; \ sed -e 's/@pkg_version@/$(VERSION)/g' \ $(top_srcdir)/npth.spec.in > $(distdir)/npth.spec - echo "$(VERSION)" > $(distdir)/VERSION .PHONY: gen-ChangeLog gen-ChangeLog: if test -d $(top_srcdir)/.git; then \ diff -Nru npth-1.2/NEWS npth-1.6/NEWS --- npth-1.2/NEWS 2015-04-11 11:56:56.000000000 +0000 +++ npth-1.6/NEWS 2018-07-16 07:19:47.000000000 +0000 @@ -1,3 +1,41 @@ +Noteworthy changes in version 1.6 (2018-07-16) [C1/A1/R2] +---------------------------------------------- + + * Fix library requirements for HPUX. [#3980] + + * Fix a minor memory leak on Windows. + + +Noteworthy changes in version 1.5 (2017-06-02) [C1/A1/R1] +---------------------------------------------- + + * Fix the busy waiting emulation of pthread_mutex_timedlock for + Unices lacking that function; e.g. macOS Sierra. + + +Noteworthy changes in version 1.4 (2017-05-16) [C1/A1/R0] +---------------------------------------------- + + * On macOS make use of an unnamed semaphore. + + * Build fixes for FreeBSD, NetBSD, and DragonFlyBSD. + + * New function npth_is_protected to help debugging. + + * Change license from LGPLv3+/GPLv2+ to LGPLv2+. + + +Noteworthy changes in version 1.3 (2016-11-22) +---------------------------------------------- + + * Bypass npth_protect/npth_unprotect iff the library has not yet been + initialized. + + * Fix problems on macOS and AIX + + * Improve detection of clock_gettime + + Noteworthy changes in version 1.2 (2015-04-11) ---------------------------------------------- diff -Nru npth-1.2/npth.spec npth-1.6/npth.spec --- npth-1.2/npth.spec 2015-04-11 12:02:43.000000000 +0000 +++ npth-1.6/npth.spec 2018-07-16 07:34:13.000000000 +0000 @@ -1,12 +1,12 @@ # This is a template. The dist target uses it to create the real file. Summary: NPTH - the new GNU Portable Threads Library Name: npth -Version: 1.2 +Version: 1.6 Release: 1 URL: http://www.gnupg.org/ Source: ftp://ftp.gnupg.org/gcrypt/alpha Group: Development/Libraries -Copyright: LGPLv3+/GPLv2+ +Copyright: LGPLv2+ BuildRoot: %{_tmppath}/%{name}-%{version} BuildRequires: make Prereq: /sbin/ldconfig /sbin/install-info diff -Nru npth-1.2/npth.spec.in npth-1.6/npth.spec.in --- npth-1.2/npth.spec.in 2013-03-15 19:25:51.000000000 +0000 +++ npth-1.6/npth.spec.in 2017-05-16 07:26:06.000000000 +0000 @@ -6,7 +6,7 @@ URL: http://www.gnupg.org/ Source: ftp://ftp.gnupg.org/gcrypt/alpha Group: Development/Libraries -Copyright: LGPLv3+/GPLv2+ +Copyright: LGPLv2+ BuildRoot: %{_tmppath}/%{name}-%{version} BuildRequires: make Prereq: /sbin/ldconfig /sbin/install-info diff -Nru npth-1.2/README npth-1.6/README --- npth-1.2/README 2013-03-15 19:25:51.000000000 +0000 +++ npth-1.6/README 2017-05-16 07:16:36.000000000 +0000 @@ -15,9 +15,7 @@ * License - nPth is currently released under a mixed LGPLv3+/GPLv2+ license. - This is to allow its use with GPLv2(only) software. If there is a - need for other licensing terms, please contact us. + nPth is released under the LGPLv2+ license. * Porting hints diff -Nru npth-1.2/src/libnpth.vers npth-1.6/src/libnpth.vers --- npth-1.2/src/libnpth.vers 2013-03-15 19:25:51.000000000 +0000 +++ npth-1.6/src/libnpth.vers 2017-05-16 07:21:21.000000000 +0000 @@ -1,17 +1,17 @@ # libnpth.vers - List of symbols to export. # Copyright (C) 2002, 2004, 2005, 2009 g10 Code GmbH # -# This file is part of NPTH. +# This file is part of nPth. # -# NPTH is free software; you can redistribute it and/or modify -# it under the terms of the GNU Lesser general Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. +# nPth is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. # -# NPTH is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# nPth is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +# Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, see . @@ -50,6 +50,7 @@ npth_sendmsg; npth_unprotect; npth_protect; + npth_is_protected; npth_clock_gettime; npth_sigev_init; diff -Nru npth-1.2/src/Makefile.am npth-1.6/src/Makefile.am --- npth-1.2/src/Makefile.am 2014-01-09 16:30:02.000000000 +0000 +++ npth-1.6/src/Makefile.am 2017-05-16 07:21:06.000000000 +0000 @@ -1,24 +1,14 @@ # Makefile.am - src/ Makefile for npth. # Copyright (C) 2011 g10 Code GmbH # -# This file is part of NPTH. +# This file is part of nPth. # -# NPTH is free software; you can redistribute it and/or modify it -# under the terms of either +# nPth is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. # -# - the GNU Lesser General Public License as published by the Free -# Software Foundation; either version 3 of the License, or (at -# your option) any later version. -# -# or -# -# - the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# or both in parallel, as here. -# -# NPTH is distributed in the hope that it will be useful, but WITHOUT +# nPth is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General # Public License for more details. diff -Nru npth-1.2/src/Makefile.in npth-1.6/src/Makefile.in --- npth-1.2/src/Makefile.in 2015-04-11 12:02:27.000000000 +0000 +++ npth-1.6/src/Makefile.in 2018-07-16 07:33:36.000000000 +0000 @@ -17,24 +17,14 @@ # Makefile.am - src/ Makefile for npth. # Copyright (C) 2011 g10 Code GmbH # -# This file is part of NPTH. +# This file is part of nPth. # -# NPTH is free software; you can redistribute it and/or modify it -# under the terms of either +# nPth is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. # -# - the GNU Lesser General Public License as published by the Free -# Software Foundation; either version 3 of the License, or (at -# your option) any later version. -# -# or -# -# - the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# or both in parallel, as here. -# -# NPTH is distributed in the hope that it will be useful, but WITHOUT +# nPth is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General # Public License for more details. @@ -272,6 +262,7 @@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTOOL = @LIBTOOL@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ @@ -306,6 +297,7 @@ STRIP = @STRIP@ SYS_SOCKET_H = @SYS_SOCKET_H@ VERSION = @VERSION@ +VERSION_NUMBER = @VERSION_NUMBER@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru npth-1.2/src/npth.c npth-1.6/src/npth.c --- npth-1.2/src/npth.c 2014-12-18 15:52:12.000000000 +0000 +++ npth-1.6/src/npth.c 2018-07-16 07:15:59.000000000 +0000 @@ -1,31 +1,21 @@ /* npth.c - a lightweight implementation of pth over pthread. - Copyright (C) 2011 g10 Code GmbH - - This file is part of NPTH. - - NPTH is free software; you can redistribute it and/or modify it - under the terms of either - - - the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at - your option) any later version. - - or - - - the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at - your option) any later version. - - or both in parallel, as here. - - NPTH is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copies of the GNU General Public License - and the GNU Lesser General Public License along with this program; - if not, see . */ + * Copyright (C) 2011 g10 Code GmbH + * + * This file is part of nPth. + * + * nPth is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * nPth is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see . + */ #ifdef HAVE_CONFIG_H #include @@ -39,7 +29,42 @@ #include #include #include -#include +#ifdef HAVE_LIB_DISPATCH +# include +typedef dispatch_semaphore_t sem_t; + +/* This glue code is for macOS which does not have full implementation + of POSIX semaphore. On macOS, using semaphore in Grand Central + Dispatch library is better than using the partial implementation of + POSIX semaphore where sem_init doesn't work well. + */ + +static int +sem_init (sem_t *sem, int is_shared, unsigned int value) +{ + (void)is_shared; + if ((*sem = dispatch_semaphore_create (value)) == NULL) + return -1; + else + return 0; +} + +static int +sem_post (sem_t *sem) +{ + dispatch_semaphore_signal (*sem); + return 0; +} + +static int +sem_wait (sem_t *sem) +{ + dispatch_semaphore_wait (*sem, DISPATCH_TIME_FOREVER); + return 0; +} +#else +# include +#endif #ifdef HAVE_UNISTD_H # include #endif @@ -57,9 +82,38 @@ semaphore is safe and a mutex is not safe is that a mutex has an owner, while a semaphore does not.) We init sceptre to a static buffer for use by sem_init; in case sem_open is used instead - SCEPTRE will changed to the value returned by sem_open. */ + SCEPTRE will changed to the value returned by sem_open. + GOT_SCEPTRE is a flag used for debugging to tell wether we hold + SCEPTRE. */ static sem_t sceptre_buffer; static sem_t *sceptre = &sceptre_buffer; +static int got_sceptre; + +/* Configure defines HAVE_FORK_UNSAFE_SEMAPHORE if child process can't + access non-shared unnamed semaphore which is created by its parent. + + We use unnamed semaphore (if available) for the global lock. The + specific semaphore is only valid for those threads in a process, + and it is no use by other processes. Thus, PSHARED argument for + sem_init is naturally 0. + + However, there are daemon-like applications which use fork after + npth's initialization by npth_init. In this case, a child process + uses the semaphore which was created by its parent process, while + parent does nothing with the semaphore. In some system (e.g. AIX), + access by child process to non-shared unnamed semaphore is + prohibited. For such a system, HAVE_FORK_UNSAFE_SEMAPHORE should + be defined, so that unnamed semaphore will be created with the + option PSHARED=1. The purpose of the setting of PSHARED=1 is only + for allowing the access of the lock by child process. For NPTH, it + does not mean any other interactions between processes. + + */ +#ifdef HAVE_FORK_UNSAFE_SEMAPHORE +#define NPTH_SEMAPHORE_PSHARED 1 +#else +#define NPTH_SEMAPHORE_PSHARED 0 +#endif /* The main thread is the active thread at the time pth_init was called. As of now it is only useful for debugging. The volatile @@ -67,6 +121,14 @@ variable. */ static volatile pthread_t main_thread; +/* This flag is set as soon as npth_init has been called or if any + * thread has been created. It will never be cleared again. The only + * purpose is to make npth_protect and npth_unprotect more robust in + * that they can be shortcut when npth_init has not yet been called. + * This is important for libraries which want to support nPth by using + * those two functions but may have be initialized before pPth. */ +static int initialized_or_any_threads; + /* Systems that don't have pthread_mutex_timedlock get a busy wait implementation that probes the lock every BUSY_WAIT_INTERVAL milliseconds. */ @@ -94,7 +156,7 @@ break; } - if (! npth_timercmp (abstime, &ts, <)) + if (npth_timercmp (abstime, &ts, <)) { err = ETIMEDOUT; break; @@ -119,6 +181,7 @@ { int res; + got_sceptre = 0; res = sem_post (sceptre); assert (res == 0); } @@ -135,6 +198,7 @@ } while (res < 0 && errno == EINTR); assert (!res); + got_sceptre = 1; errno = save_errno; } @@ -142,34 +206,6 @@ #define LEAVE() leave_npth () -static int -try_sem_open (sem_t **r_sem) -{ - sem_t *sem; - char name [256]; - int counter = 0; - - do - { - snprintf (name, sizeof name - 1, "/npth-sceptre-%lu-%u", - (unsigned long)getpid (), counter); - name[sizeof name -1] = 0; - counter++; - - sem = sem_open (name, (O_CREAT | O_EXCL), (S_IRUSR | S_IWUSR), 1); - if (sem != SEM_FAILED) - { - *r_sem = sem; - return 0; - } - fprintf (stderr, " semOpen(%s): %s\n", name, strerror (errno)); - } - while (errno == EEXIST); - - return -1; -} - - int npth_init (void) { @@ -177,32 +213,30 @@ main_thread = pthread_self(); + /* Track that we have been initialized. */ + initialized_or_any_threads |= 1; + /* Better reset ERRNO so that we know that it has been set by sem_init. */ errno = 0; - /* The semaphore is not shared and binary. */ - res = sem_init (sceptre, 0, 1); + /* The semaphore is binary. */ + res = sem_init (sceptre, NPTH_SEMAPHORE_PSHARED, 1); + /* There are some versions of operating systems which have sem_init + symbol defined but the call actually returns ENOSYS at runtime. + We know this problem for older versions of AIX (<= 4.3.3) and + macOS. For macOS, we use semaphore in Grand Central Dispatch + library, so ENOSYS doesn't happen. We only support AIX >= 5.2, + where sem_init is supported. + */ if (res < 0) { - /* Mac OSX and some AIX versions have sem_init but return - ENOSYS. This is allowed according to some POSIX versions but - the informative section is quite fuzzy about it. We resort - to sem_open in this case. */ - if (errno == ENOSYS) - { - if (try_sem_open (&sceptre)) - return errno; - } - else - { - /* POSIX.1-2001 defines the semaphore interface but does not - specify the return value for success. Thus we better - bail out on error only on a POSIX.1-2008 system. */ + /* POSIX.1-2001 defines the semaphore interface but does not + specify the return value for success. Thus we better + bail out on error only on a POSIX.1-2008 system. */ #if _POSIX_C_SOURCE >= 200809L - return errno; + return errno; #endif - } } LEAVE(); @@ -231,8 +265,15 @@ #ifdef __NetBSD__ return pthread_setname_np (target_thread, "%s", (void*) name); #else +#ifdef __APPLE__ + if (target_thread == npth_self ()) + return pthread_setname_np (name); + else + return ENOTSUP; +#else return pthread_setname_np (target_thread, name); #endif +#endif #else (void)target_thread; (void)name; @@ -282,6 +323,8 @@ if (!startup) return errno; + initialized_or_any_threads |= 2; + startup->start_routine = start_routine; startup->arg = arg; err = pthread_create (thread, attr, thread_start, startup); @@ -683,14 +726,30 @@ void npth_unprotect (void) { - ENTER(); + /* If we are not initialized we may not access the semaphore and + * thus we shortcut it. Note that in this case the unprotect/protect + * is not needed. For failsafe reasons if an nPth thread has ever + * been created but nPth has accidentally not initialized we do not + * shortcut so that a stack backtrace (due to the access of the + * uninitialized semaphore) is more expressive. */ + if (initialized_or_any_threads) + ENTER(); } void npth_protect (void) { - LEAVE(); + /* See npth_unprotect for commentary. */ + if (initialized_or_any_threads) + LEAVE(); +} + + +int +npth_is_protected (void) +{ + return got_sceptre; } diff -Nru npth-1.2/src/npth.h npth-1.6/src/npth.h --- npth-1.2/src/npth.h 2015-04-11 12:02:41.000000000 +0000 +++ npth-1.6/src/npth.h 2018-07-16 07:34:05.000000000 +0000 @@ -1,50 +1,41 @@ /* npth.h - a lightweight implementation of pth over pthread. - Configured for: x86_64-unknown-linux-gnu. - Copyright (C) 2011, 2012, 2015 g10 Code GmbH - - This file is part of NPTH. - - NPTH is free software; you can redistribute it and/or modify it - under the terms of either - - - the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at - your option) any later version. - - or - - - the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at - your option) any later version. - - or both in parallel, as here. - - NPTH is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copies of the GNU General Public License - and the GNU Lesser General Public License along with this program; - if not, see . */ - -/* Changes to Pth: - - Return value and arguments follow strictly the pthread format: - - * Return the error number instead of setting errno, - - * have timedlock function instead of extra event argument, - - * have trylock function instead of extra event argument. Can't mix - timed and try. - - * No _new functions. Use _init functions instead. - - * Attributes are set by specific instead of generic getter/setter - functions. - - Offers replacement functions for sendmsg and recvmsg. */ + * Configured for: x86_64-pc-linux-gnu. + * Copyright (C) 2011, 2012, 2015, 2017 g10 Code GmbH + * + * This file is part of nPth. + * + * nPth is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * nPth is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see . + */ + +/* Changes to GNU Pth: + * + * Return value and arguments follow strictly the pthread format: + * + * - Return the error number instead of setting errno, + * + * - have timedlock function instead of extra event argument, + * + * - have trylock function instead of extra event argument. Can't mix + * timed and try. + * + * - No _new functions. Use _init functions instead. + * + * - Attributes are set by specific instead of generic getter/setter + * functions. + * + * - Offers replacement functions for sendmsg and recvmsg. + */ #ifndef _NPTH_H #define _NPTH_H @@ -359,6 +350,10 @@ void npth_unprotect (void); void npth_protect (void); +/* If you run into problems with the above calls, this function can be + * used to examine in which state nPth is. */ +int npth_is_protected (void); + /* Because the timed functions work on timespec, we provide a clock interface for convenience and portability. */ @@ -389,39 +384,41 @@ } \ } while (0) + /* This is a support interface to make it easier to handle signals. - - The interfaces here support one (and only one) thread (here called - "main thread") in the application to monitor several signals while - selecting on filedescriptors. - - First, the main thread should call npth_sigev_init. This - initializes some global data structures used to record interesting - and pending signals. - - Then, the main thread should call npth_sigev_add for every signal - it is interested in observing, and finally npth_sigev_fini. This - will block the signal in the main threads sigmask. Note that these - signals should also be blocked in all other threads. Since they - are blocked in the main thread after calling npth_sigev_add, it is - recommended to call npth_sigev_add in the main thread before - creating any threads. - - The function npth_sigev_sigmask is a convenient function that - returns the sigmask of the thread at time of npth_sigev_init, but - with all registered signals unblocked. It is recommended to do all - other changes to the main thread's sigmask before calling - npth_sigev_init, so that the return value of npth_sigev_sigmask can - be used in the npth_pselect invocation. - - In any case, the main thread should invoke npth_pselect with a - sigmask that has all signals that should be monitored unblocked. - - After npth_pselect returns, npth_sigev_get_pending can be called in - a loop until it returns 0 to iterate over the list of pending - signals. Each time a signal is returned by that function, its - status is reset to non-pending. */ + * + * The interfaces here support one (and only one) thread (here called + * "main thread") in the application to monitor several signals while + * selecting on filedescriptors. + * + * First, the main thread should call npth_sigev_init. This + * initializes some global data structures used to record interesting + * and pending signals. + * + * Then, the main thread should call npth_sigev_add for every signal + * it is interested in observing, and finally npth_sigev_fini. This + * will block the signal in the main threads sigmask. Note that these + * signals should also be blocked in all other threads. Since they + * are blocked in the main thread after calling npth_sigev_add, it is + * recommended to call npth_sigev_add in the main thread before + * creating any threads. + * + * The function npth_sigev_sigmask is a convenient function that + * returns the sigmask of the thread at time of npth_sigev_init, but + * with all registered signals unblocked. It is recommended to do all + * other changes to the main thread's sigmask before calling + * npth_sigev_init, so that the return value of npth_sigev_sigmask can + * be used in the npth_pselect invocation. + * + * In any case, the main thread should invoke npth_pselect with a + * sigmask that has all signals that should be monitored unblocked. + * + * After npth_pselect returns, npth_sigev_get_pending can be called in + * a loop until it returns 0 to iterate over the list of pending + * signals. Each time a signal is returned by that function, its + * status is reset to non-pending. + */ /* Start setting up signal event handling. */ void npth_sigev_init (void); diff -Nru npth-1.2/src/npth.h.in npth-1.6/src/npth.h.in --- npth-1.2/src/npth.h.in 2015-04-11 11:58:01.000000000 +0000 +++ npth-1.6/src/npth.h.in 2017-05-16 07:22:00.000000000 +0000 @@ -1,50 +1,41 @@ /* npth.h - a lightweight implementation of pth over pthread. - Configured for: @NPTH_CONFIG_HOST@. - Copyright (C) 2011, 2012, 2015 g10 Code GmbH - - This file is part of NPTH. - - NPTH is free software; you can redistribute it and/or modify it - under the terms of either - - - the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at - your option) any later version. - - or - - - the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at - your option) any later version. - - or both in parallel, as here. - - NPTH is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copies of the GNU General Public License - and the GNU Lesser General Public License along with this program; - if not, see . */ - -/* Changes to Pth: - - Return value and arguments follow strictly the pthread format: - - * Return the error number instead of setting errno, - - * have timedlock function instead of extra event argument, - - * have trylock function instead of extra event argument. Can't mix - timed and try. - - * No _new functions. Use _init functions instead. - - * Attributes are set by specific instead of generic getter/setter - functions. - - Offers replacement functions for sendmsg and recvmsg. */ + * Configured for: @NPTH_CONFIG_HOST@. + * Copyright (C) 2011, 2012, 2015, 2017 g10 Code GmbH + * + * This file is part of nPth. + * + * nPth is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * nPth is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see . + */ + +/* Changes to GNU Pth: + * + * Return value and arguments follow strictly the pthread format: + * + * - Return the error number instead of setting errno, + * + * - have timedlock function instead of extra event argument, + * + * - have trylock function instead of extra event argument. Can't mix + * timed and try. + * + * - No _new functions. Use _init functions instead. + * + * - Attributes are set by specific instead of generic getter/setter + * functions. + * + * - Offers replacement functions for sendmsg and recvmsg. + */ #ifndef _NPTH_H #define _NPTH_H @@ -359,6 +350,10 @@ void npth_unprotect (void); void npth_protect (void); +/* If you run into problems with the above calls, this function can be + * used to examine in which state nPth is. */ +int npth_is_protected (void); + /* Because the timed functions work on timespec, we provide a clock interface for convenience and portability. */ @@ -389,39 +384,41 @@ } \ } while (0) + /* This is a support interface to make it easier to handle signals. - - The interfaces here support one (and only one) thread (here called - "main thread") in the application to monitor several signals while - selecting on filedescriptors. - - First, the main thread should call npth_sigev_init. This - initializes some global data structures used to record interesting - and pending signals. - - Then, the main thread should call npth_sigev_add for every signal - it is interested in observing, and finally npth_sigev_fini. This - will block the signal in the main threads sigmask. Note that these - signals should also be blocked in all other threads. Since they - are blocked in the main thread after calling npth_sigev_add, it is - recommended to call npth_sigev_add in the main thread before - creating any threads. - - The function npth_sigev_sigmask is a convenient function that - returns the sigmask of the thread at time of npth_sigev_init, but - with all registered signals unblocked. It is recommended to do all - other changes to the main thread's sigmask before calling - npth_sigev_init, so that the return value of npth_sigev_sigmask can - be used in the npth_pselect invocation. - - In any case, the main thread should invoke npth_pselect with a - sigmask that has all signals that should be monitored unblocked. - - After npth_pselect returns, npth_sigev_get_pending can be called in - a loop until it returns 0 to iterate over the list of pending - signals. Each time a signal is returned by that function, its - status is reset to non-pending. */ + * + * The interfaces here support one (and only one) thread (here called + * "main thread") in the application to monitor several signals while + * selecting on filedescriptors. + * + * First, the main thread should call npth_sigev_init. This + * initializes some global data structures used to record interesting + * and pending signals. + * + * Then, the main thread should call npth_sigev_add for every signal + * it is interested in observing, and finally npth_sigev_fini. This + * will block the signal in the main threads sigmask. Note that these + * signals should also be blocked in all other threads. Since they + * are blocked in the main thread after calling npth_sigev_add, it is + * recommended to call npth_sigev_add in the main thread before + * creating any threads. + * + * The function npth_sigev_sigmask is a convenient function that + * returns the sigmask of the thread at time of npth_sigev_init, but + * with all registered signals unblocked. It is recommended to do all + * other changes to the main thread's sigmask before calling + * npth_sigev_init, so that the return value of npth_sigev_sigmask can + * be used in the npth_pselect invocation. + * + * In any case, the main thread should invoke npth_pselect with a + * sigmask that has all signals that should be monitored unblocked. + * + * After npth_pselect returns, npth_sigev_get_pending can be called in + * a loop until it returns 0 to iterate over the list of pending + * signals. Each time a signal is returned by that function, its + * status is reset to non-pending. + */ /* Start setting up signal event handling. */ void npth_sigev_init (void); diff -Nru npth-1.2/src/npth-sigev.c npth-1.6/src/npth-sigev.c --- npth-1.2/src/npth-sigev.c 2014-01-09 14:16:00.000000000 +0000 +++ npth-1.6/src/npth-sigev.c 2017-05-16 07:21:37.000000000 +0000 @@ -1,64 +1,55 @@ /* npth-sigev.c - signal handling interface - Copyright (C) 2011 g10 Code GmbH - - This file is part of NPTH. - - NPTH is free software; you can redistribute it and/or modify it - under the terms of either - - - the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at - your option) any later version. - - or - - - the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at - your option) any later version. - - or both in parallel, as here. - - NPTH is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copies of the GNU General Public License - and the GNU Lesser General Public License along with this program; - if not, see . */ + * Copyright (C) 2011 g10 Code GmbH + * + * This file is part of nPth. + * + * nPth is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * nPth is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see . + */ /* This is a support interface to make it easier to handle signals. - - The interfaces here support one (and only one) thread (here called - "main thread") in the application to monitor several signals while - selecting on filedescriptors. - - First, the main thread should call npth_sigev_init. This - initializes some global data structures used to record interesting - and pending signals. - - Then, the main thread should call npth_sigev_add for every signal - it is interested in observing, and finally npth_sigev_fini. This - will block the signal in the main threads sigmask. Note that these - signals should also be blocked in all other threads. Since they - are blocked in the main thread after calling npth_sigev_add, it is - recommended to call npth_sigev_add in the main thread before - creating any threads. - - The function npth_sigev_sigmask is a convenient function that - returns the sigmask of the thread at time of npth_sigev_init, but - with all registered signals unblocked. It is recommended to do all - other changes to the main thread's sigmask before calling - npth_sigev_init, so that the return value of npth_sigev_sigmask can - be used in the npth_pselect invocation. - - In any case, the main thread should invoke npth_pselect with a - sigmask that has all signals that should be monitored unblocked. - - After npth_pselect returns, npth_sigev_get_pending can be called in - a loop until it returns 0 to iterate over the list of pending - signals. Each time a signal is returned by that function, its - status is reset to non-pending. */ + * + * The interfaces here support one (and only one) thread (here called + * "main thread") in the application to monitor several signals while + * selecting on filedescriptors. + * + * First, the main thread should call npth_sigev_init. This + * initializes some global data structures used to record interesting + * and pending signals. + * + * Then, the main thread should call npth_sigev_add for every signal + * it is interested in observing, and finally npth_sigev_fini. This + * will block the signal in the main threads sigmask. Note that these + * signals should also be blocked in all other threads. Since they + * are blocked in the main thread after calling npth_sigev_add, it is + * recommended to call npth_sigev_add in the main thread before + * creating any threads. + * + * The function npth_sigev_sigmask is a convenient function that + * returns the sigmask of the thread at time of npth_sigev_init, but + * with all registered signals unblocked. It is recommended to do all + * other changes to the main thread's sigmask before calling + * npth_sigev_init, so that the return value of npth_sigev_sigmask can + * be used in the npth_pselect invocation. + * + * In any case, the main thread should invoke npth_pselect with a + * sigmask that has all signals that should be monitored unblocked. + * + * After npth_pselect returns, npth_sigev_get_pending can be called in + * a loop until it returns 0 to iterate over the list of pending + * signals. Each time a signal is returned by that function, its + * status is reset to non-pending. + */ #ifdef HAVE_CONFIG_H #include diff -Nru npth-1.2/tests/Makefile.am npth-1.6/tests/Makefile.am --- npth-1.2/tests/Makefile.am 2013-03-15 19:25:51.000000000 +0000 +++ npth-1.6/tests/Makefile.am 2018-04-29 18:38:02.000000000 +0000 @@ -1,24 +1,14 @@ # Makefile.am - Makefile for NPTH tests. # Copyright (C) 2011 g10 Code GmbH # -# This file is part of NPTH. +# This file is part of nPth. # -# NPTH is free software; you can redistribute it and/or modify it -# under the terms of either +# nPth is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. # -# - the GNU Lesser General Public License as published by the Free -# Software Foundation; either version 3 of the License, or (at -# your option) any later version. -# -# or -# -# - the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# or both in parallel, as here. -# -# NPTH is distributed in the hope that it will be useful, but WITHOUT +# nPth is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General # Public License for more details. @@ -35,11 +25,12 @@ if HAVE_W32_SYSTEM AM_CPPFLAGS = -I$(top_srcdir)/w32 AM_LDFLAGS = -LDADD = ../w32/libnpth.la +LDADD = ../w32/libnpth.la $(LIB_CLOCK_GETTIME) else AM_CPPFLAGS = -I../src -D_POSIX_C_SOURCE=200112L AM_LDFLAGS = -LDADD = ../src/libnpth.la $(LIBSOCKET) +LDADD = ../src/libnpth.la $(LIBSOCKET) $(LIB_CLOCK_GETTIME) +TESTS += t-fork endif noinst_HEADERS = t-support.h diff -Nru npth-1.2/tests/Makefile.in npth-1.6/tests/Makefile.in --- npth-1.2/tests/Makefile.in 2015-04-11 12:02:27.000000000 +0000 +++ npth-1.6/tests/Makefile.in 2018-07-16 07:33:36.000000000 +0000 @@ -17,24 +17,14 @@ # Makefile.am - Makefile for NPTH tests. # Copyright (C) 2011 g10 Code GmbH # -# This file is part of NPTH. +# This file is part of nPth. # -# NPTH is free software; you can redistribute it and/or modify it -# under the terms of either +# nPth is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. # -# - the GNU Lesser General Public License as published by the Free -# Software Foundation; either version 3 of the License, or (at -# your option) any later version. -# -# or -# -# - the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# or both in parallel, as here. -# -# NPTH is distributed in the hope that it will be useful, but WITHOUT +# nPth is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General # Public License for more details. @@ -107,8 +97,9 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -TESTS = t-mutex$(EXEEXT) t-thread$(EXEEXT) -noinst_PROGRAMS = $(am__EXEEXT_1) +TESTS = t-mutex$(EXEEXT) t-thread$(EXEEXT) $(am__EXEEXT_1) +@HAVE_W32_SYSTEM_FALSE@am__append_1 = t-fork +noinst_PROGRAMS = $(am__EXEEXT_2) subdir = tests DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/depcomp $(noinst_HEADERS) @@ -124,25 +115,38 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__EXEEXT_1 = t-mutex$(EXEEXT) t-thread$(EXEEXT) +@HAVE_W32_SYSTEM_FALSE@am__EXEEXT_1 = t-fork$(EXEEXT) +am__EXEEXT_2 = t-mutex$(EXEEXT) t-thread$(EXEEXT) $(am__EXEEXT_1) PROGRAMS = $(noinst_PROGRAMS) -t_mutex_SOURCES = t-mutex.c -t_mutex_OBJECTS = t-mutex.$(OBJEXT) -t_mutex_LDADD = $(LDADD) +t_fork_SOURCES = t-fork.c +t_fork_OBJECTS = t-fork.$(OBJEXT) +t_fork_LDADD = $(LDADD) am__DEPENDENCIES_1 = -@HAVE_W32_SYSTEM_FALSE@t_mutex_DEPENDENCIES = ../src/libnpth.la \ +@HAVE_W32_SYSTEM_FALSE@t_fork_DEPENDENCIES = ../src/libnpth.la \ +@HAVE_W32_SYSTEM_FALSE@ $(am__DEPENDENCIES_1) \ @HAVE_W32_SYSTEM_FALSE@ $(am__DEPENDENCIES_1) -@HAVE_W32_SYSTEM_TRUE@t_mutex_DEPENDENCIES = ../w32/libnpth.la +@HAVE_W32_SYSTEM_TRUE@t_fork_DEPENDENCIES = ../w32/libnpth.la \ +@HAVE_W32_SYSTEM_TRUE@ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +t_mutex_SOURCES = t-mutex.c +t_mutex_OBJECTS = t-mutex.$(OBJEXT) +t_mutex_LDADD = $(LDADD) +@HAVE_W32_SYSTEM_FALSE@t_mutex_DEPENDENCIES = ../src/libnpth.la \ +@HAVE_W32_SYSTEM_FALSE@ $(am__DEPENDENCIES_1) \ +@HAVE_W32_SYSTEM_FALSE@ $(am__DEPENDENCIES_1) +@HAVE_W32_SYSTEM_TRUE@t_mutex_DEPENDENCIES = ../w32/libnpth.la \ +@HAVE_W32_SYSTEM_TRUE@ $(am__DEPENDENCIES_1) t_thread_SOURCES = t-thread.c t_thread_OBJECTS = t-thread.$(OBJEXT) t_thread_LDADD = $(LDADD) @HAVE_W32_SYSTEM_FALSE@t_thread_DEPENDENCIES = ../src/libnpth.la \ +@HAVE_W32_SYSTEM_FALSE@ $(am__DEPENDENCIES_1) \ @HAVE_W32_SYSTEM_FALSE@ $(am__DEPENDENCIES_1) -@HAVE_W32_SYSTEM_TRUE@t_thread_DEPENDENCIES = ../w32/libnpth.la +@HAVE_W32_SYSTEM_TRUE@t_thread_DEPENDENCIES = ../w32/libnpth.la \ +@HAVE_W32_SYSTEM_TRUE@ $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -177,8 +181,8 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = t-mutex.c t-thread.c -DIST_SOURCES = t-mutex.c t-thread.c +SOURCES = t-fork.c t-mutex.c t-thread.c +DIST_SOURCES = t-fork.c t-mutex.c t-thread.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -276,6 +280,7 @@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTOOL = @LIBTOOL@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ @@ -310,6 +315,7 @@ STRIP = @STRIP@ SYS_SOCKET_H = @SYS_SOCKET_H@ VERSION = @VERSION@ +VERSION_NUMBER = @VERSION_NUMBER@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -372,8 +378,8 @@ @HAVE_W32_SYSTEM_TRUE@AM_CPPFLAGS = -I$(top_srcdir)/w32 @HAVE_W32_SYSTEM_FALSE@AM_LDFLAGS = @HAVE_W32_SYSTEM_TRUE@AM_LDFLAGS = -@HAVE_W32_SYSTEM_FALSE@LDADD = ../src/libnpth.la $(LIBSOCKET) -@HAVE_W32_SYSTEM_TRUE@LDADD = ../w32/libnpth.la +@HAVE_W32_SYSTEM_FALSE@LDADD = ../src/libnpth.la $(LIBSOCKET) $(LIB_CLOCK_GETTIME) +@HAVE_W32_SYSTEM_TRUE@LDADD = ../w32/libnpth.la $(LIB_CLOCK_GETTIME) noinst_HEADERS = t-support.h all: all-am @@ -419,6 +425,10 @@ echo " rm -f" $$list; \ rm -f $$list +t-fork$(EXEEXT): $(t_fork_OBJECTS) $(t_fork_DEPENDENCIES) $(EXTRA_t_fork_DEPENDENCIES) + @rm -f t-fork$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(t_fork_OBJECTS) $(t_fork_LDADD) $(LIBS) + t-mutex$(EXEEXT): $(t_mutex_OBJECTS) $(t_mutex_DEPENDENCIES) $(EXTRA_t_mutex_DEPENDENCIES) @rm -f t-mutex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t_mutex_OBJECTS) $(t_mutex_LDADD) $(LIBS) @@ -433,6 +443,7 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-fork.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-mutex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-thread.Po@am__quote@ diff -Nru npth-1.2/tests/t-fork.c npth-1.6/tests/t-fork.c --- npth-1.2/tests/t-fork.c 1970-01-01 00:00:00.000000000 +0000 +++ npth-1.6/tests/t-fork.c 2017-05-16 06:41:12.000000000 +0000 @@ -0,0 +1,59 @@ +/* t-fork.c + * Copyright 2016 g10 Code GmbH + * + * This file is free software; as a special exception the author gives + * unlimited permission to copy and/or distribute it, with or without + * modifications, as long as this notice is preserved. + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include +#include +#include "t-support.h" + +/* This is a test if nPth can allow daemon-like applications + initializing earlier. + + For daemon-like applications, ideally, it is expected to call + npth_init after fork. This condition is not satisfied sometimes. + + Failure of this test means nPth implementation doesn't allow + npth_init after fork. In such a case, application should be + modified. + */ + +int +main (int argc, const char *argv[]) +{ + int rc; + pid_t pid; + + if (argc >= 2 && !strcmp (argv[1], "--verbose")) + opt_verbose = 1; + + rc = npth_init (); + fail_if_err (rc); + + pid = fork (); + if (pid == (pid_t)-1) + fail_msg ("fork failed"); + else if (pid) + { + int status; + + info_msg ("forked"); + wait (&status); + fail_if_err (status); + } + else + { + info_msg ("child exit"); + npth_usleep (1000); /* Let NPTH enter, sleep, and leave. */ + } + + return 0; +} diff -Nru npth-1.2/VERSION npth-1.6/VERSION --- npth-1.2/VERSION 2015-04-11 12:02:43.000000000 +0000 +++ npth-1.6/VERSION 2018-07-16 07:33:37.000000000 +0000 @@ -1 +1 @@ -1.2 +1.6 diff -Nru npth-1.2/w32/Makefile.am npth-1.6/w32/Makefile.am --- npth-1.2/w32/Makefile.am 2015-02-03 14:16:23.000000000 +0000 +++ npth-1.6/w32/Makefile.am 2017-05-16 07:19:47.000000000 +0000 @@ -1,24 +1,14 @@ -# Makefile.am - src/ Makefile for npth. +# Makefile.am - w32 Makefile for nPth. # Copyright (C) 2011 g10 Code GmbH # -# This file is part of NPTH. +# This file is part of nPth. # -# NPTH is free software; you can redistribute it and/or modify it -# under the terms of either +# nPth is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. # -# - the GNU Lesser General Public License as published by the Free -# Software Foundation; either version 3 of the License, or (at -# your option) any later version. -# -# or -# -# - the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# or both in parallel, as here. -# -# NPTH is distributed in the hope that it will be useful, but WITHOUT +# nPth is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General # Public License for more details. diff -Nru npth-1.2/w32/Makefile.in npth-1.6/w32/Makefile.in --- npth-1.2/w32/Makefile.in 2015-04-11 12:02:28.000000000 +0000 +++ npth-1.6/w32/Makefile.in 2018-07-16 07:33:36.000000000 +0000 @@ -14,27 +14,17 @@ @SET_MAKE@ -# Makefile.am - src/ Makefile for npth. +# Makefile.am - w32 Makefile for nPth. # Copyright (C) 2011 g10 Code GmbH # -# This file is part of NPTH. +# This file is part of nPth. # -# NPTH is free software; you can redistribute it and/or modify it -# under the terms of either +# nPth is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. # -# - the GNU Lesser General Public License as published by the Free -# Software Foundation; either version 3 of the License, or (at -# your option) any later version. -# -# or -# -# - the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# or both in parallel, as here. -# -# NPTH is distributed in the hope that it will be useful, but WITHOUT +# nPth is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General # Public License for more details. @@ -273,6 +263,7 @@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTOOL = @LIBTOOL@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ @@ -307,6 +298,7 @@ STRIP = @STRIP@ SYS_SOCKET_H = @SYS_SOCKET_H@ VERSION = @VERSION@ +VERSION_NUMBER = @VERSION_NUMBER@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff -Nru npth-1.2/w32/npth.c npth-1.6/w32/npth.c --- npth-1.2/w32/npth.c 2014-06-27 17:00:38.000000000 +0000 +++ npth-1.6/w32/npth.c 2018-07-16 07:15:59.000000000 +0000 @@ -1,31 +1,21 @@ -/* npth.c - a lightweight implementation of pth over pthread. - Copyright (C) 2011, 2014 g10 Code GmbH - - This file is part of NPTH. - - NPTH is free software; you can redistribute it and/or modify it - under the terms of either - - - the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at - your option) any later version. - - or - - - the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at - your option) any later version. - - or both in parallel, as here. - - NPTH is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copies of the GNU General Public License - and the GNU Lesser General Public License along with this program; - if not, see . */ +/* npth.c - a lightweight implementation of pth over native threads + * Copyright (C) 2011, 2014 g10 Code GmbH + * + * This file is part of nPth. + * + * nPth is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * nPth is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see . + */ /* We implement the join mechanism ourself. */ @@ -35,12 +25,13 @@ #include #include +#include #include "npth.h" #include #define DEBUG_CALLS 1 -#define _npth_debug(x, ...) printf(__VA_ARGS__) +#define _npth_debug(x, ...) fprintf(stderr, __VA_ARGS__) #ifndef TEST #undef DEBUG_CALLS @@ -54,8 +45,20 @@ /* The global lock that excludes all threads but one. Note that this implements the single-user-thread policy, but also protects all our - global data such as the thread_table. */ + global data such as the thread_table. GOT_SCEPTRE is a flag used + for debugging to tell wether we hold SCEPTRE. */ static CRITICAL_SECTION sceptre; +static int got_sceptre; + + +/* This flag is set as soon as npth_init has been called or if any + * thread has been created. It will never be cleared again. The only + * purpose is to make npth_protect and npth_unprotect more robust in + * that they can be shortcut when npth_init has not yet been called. + * This is important for libraries which want to support nPth by using + * those two functions but may have been initialized before nPth. */ +static int initialized_or_any_threads; + typedef struct npth_impl_s *npth_impl_t; #define MAX_THREADS 1024 @@ -150,8 +153,9 @@ int res; if (DEBUG_CALLS) - _npth_debug (DEBUG_CALLS, "enter_npth (%s)\n", - function ? function : "unknown"); + _npth_debug (DEBUG_CALLS, "tid %lu: enter_npth (%s)\n", + npth_self (), function ? function : "unknown"); + got_sceptre = 0; LeaveCriticalSection (&sceptre); } @@ -160,10 +164,11 @@ leave_npth (const char *function) { EnterCriticalSection (&sceptre); + got_sceptre = 1; if (DEBUG_CALLS) - _npth_debug (DEBUG_CALLS, "leave_npth (%s)\n", - function ? function : ""); + _npth_debug (DEBUG_CALLS, "tid %lu: leave_npth (%s)\n", + npth_self (), function ? function : ""); } #define ENTER() enter_npth(__FUNCTION__) @@ -320,6 +325,9 @@ InitializeCriticalSection (&sceptre); + /* Track that we have been initialized. */ + initialized_or_any_threads = 1; + /* Fake a thread table item for the main thread. */ tls_index = TlsAlloc(); if (tls_index == TLS_OUT_OF_INDEXES) @@ -376,6 +384,7 @@ npth_attr_destroy (npth_attr_t *attr) { free (*attr); + *attr = NULL; return 0; } @@ -523,6 +532,9 @@ ResumeThread (thread->handle); + if (attr_allocated) + npth_attr_destroy (&attr); + return 0; err_out: @@ -1745,16 +1757,33 @@ void npth_unprotect (void) { - ENTER(); + /* If we are not initialized we may not access the semaphore and + * thus we shortcut it. Note that in this case the unprotect/protect + * is not needed. For failsafe reasons if an nPth thread has ever + * been created but nPth has accidentally not initialized we do not + * shortcut so that a stack backtrace (due to the access of the + * uninitialized semaphore) is more expressive. */ + if (initialized_or_any_threads) + ENTER(); } void npth_protect (void) { - LEAVE(); + /* See npth_unprotect for commentary. */ + if (initialized_or_any_threads) + LEAVE(); } + +int +npth_is_protected (void) +{ + return got_sceptre; +} + + /* Maximum number of extra handles. We can only support 31 as that is the number of bits we can return. This is smaller than the maximum diff -Nru npth-1.2/w32/npth.def npth-1.6/w32/npth.def --- npth-1.2/w32/npth.def 2013-03-15 19:25:51.000000000 +0000 +++ npth-1.6/w32/npth.def 2018-07-16 07:15:59.000000000 +0000 @@ -4,18 +4,17 @@ ; This file is part of NPTH. ; ; NPTH is free software; you can redistribute it and/or modify -; it under the terms of the GNU Lesser general Public License as +; it under the terms of the GNU Lesser General Public License as ; published by the Free Software Foundation; either version 2.1 of ; the License, or (at your option) any later version. ; -; NPTH is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU Lesser General Public License for more details. +; NPTH is distributed in the hope that it will be useful, but +; WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +; the GNU Lesser General Public License for more details. ; ; You should have received a copy of the GNU Lesser General Public -; License along with this program; if not, write to the Free Software -; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +; License along with this program; if not, see . EXPORTS @@ -79,5 +78,6 @@ npth_eselect @58 npth_unprotect @59 npth_protect @60 + npth_is_protected @61 ; END diff -Nru npth-1.2/w32/npth.h npth-1.6/w32/npth.h --- npth-1.2/w32/npth.h 2015-04-11 11:58:24.000000000 +0000 +++ npth-1.6/w32/npth.h 2018-07-16 07:15:59.000000000 +0000 @@ -1,31 +1,21 @@ -/* npth.h - a lightweight implementation of pth over pthread. - Copyright (C) 2011, 2015 g10 Code GmbH - - This file is part of NPTH. - - NPTH is free software; you can redistribute it and/or modify it - under the terms of either - - - the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at - your option) any later version. - - or - - - the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at - your option) any later version. - - or both in parallel, as here. - - NPTH is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copies of the GNU General Public License - and the GNU Lesser General Public License along with this program; - if not, see . */ +/* npth.h - a lightweight implementation of pth over native threads + * Copyright (C) 2011, 2015 g10 Code GmbH + * + * This file is part of nPth. + * + * nPth is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * nPth is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see . + */ #ifndef _NPTH_H #define _NPTH_H @@ -47,14 +37,14 @@ struct msghdr; -/* At least with version 2 the mingw-w64 headers define timespec. For - older compilers we keep our replacement. */ -#if __MINGW64_VERSION_MAJOR < 2 +/* The mingw-w64 headers define timespec. For older compilers we keep + our replacement. */ +#ifndef __MINGW64_VERSION_MAJOR struct timespec { long tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; -#endif /*__MINGW64_VERSION_MAJOR < 2*/ +#endif /*__MINGW64_VERSION_MAJOR */ #ifndef ETIMEDOUT @@ -198,6 +188,9 @@ void npth_unprotect (void); void npth_protect (void); +/* Return true when we hold the sceptre. This is used to debug + * problems with npth_unprotect and npth_protect. */ +int npth_is_protected (void); int npth_clock_gettime(struct timespec *tp);