diff options
Diffstat (limited to 'gnulib-tests')
325 files changed, 7714 insertions, 2312 deletions
diff --git a/gnulib-tests/Makefile.in b/gnulib-tests/Makefile.in index 68e355e..33b40cb 100644 --- a/gnulib-tests/Makefile.in +++ b/gnulib-tests/Makefile.in @@ -1,7 +1,7 @@ # Makefile.in generated by automake 1.16a from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2020 Free Software Foundation, Inc. # # 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 @@ -138,29 +138,37 @@ TESTS = test-accept$(EXEEXT) test-set-mode-acl.sh \ test-getdelim$(EXEEXT) test-getdtablesize$(EXEEXT) \ test-getopt-gnu$(EXEEXT) test-getopt-posix$(EXEEXT) \ test-getprogname$(EXEEXT) test-gettimeofday$(EXEEXT) \ - test-ignore-value$(EXEEXT) test-inet_pton$(EXEEXT) \ - test-intprops$(EXEEXT) test-inttypes$(EXEEXT) \ - test-ioctl$(EXEEXT) test-isblank$(EXEEXT) \ - test-langinfo$(EXEEXT) test-limits-h$(EXEEXT) \ - test-link$(EXEEXT) test-listen$(EXEEXT) test-locale$(EXEEXT) \ - test-localeconv$(EXEEXT) test-localename$(EXEEXT) \ - test-lseek.sh test-lstat$(EXEEXT) test-malloca$(EXEEXT) \ - test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh \ - test-mbrtowc4.sh test-mbrtowc5.sh test-mbrtowc-w32-1.sh \ - test-mbrtowc-w32-2.sh test-mbrtowc-w32-3.sh \ - test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh test-mbsinit.sh \ - test-memchr$(EXEEXT) test-memrchr$(EXEEXT) test-mkdir$(EXEEXT) \ + test-hard-locale$(EXEEXT) test-ignore-value$(EXEEXT) \ + test-inet_pton$(EXEEXT) test-intprops$(EXEEXT) \ + test-inttypes$(EXEEXT) test-ioctl$(EXEEXT) \ + test-isblank$(EXEEXT) test-langinfo$(EXEEXT) \ + test-limits-h$(EXEEXT) test-link$(EXEEXT) test-listen$(EXEEXT) \ + test-locale$(EXEEXT) test-localeconv$(EXEEXT) \ + test-localename$(EXEEXT) test-lseek.sh test-lstat$(EXEEXT) \ + test-malloca$(EXEEXT) test-mbrtowc1.sh test-mbrtowc2.sh \ + test-mbrtowc3.sh test-mbrtowc4.sh test-mbrtowc5.sh \ + test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh \ + test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh \ + test-mbrtowc-w32-5.sh test-mbrtowc-w32-6.sh \ + test-mbrtowc-w32-7.sh test-mbsinit.sh test-memchr$(EXEEXT) \ + test-memrchr$(EXEEXT) test-mkdir$(EXEEXT) \ test-nanosleep$(EXEEXT) test-netinet_in$(EXEEXT) \ - test-nl_langinfo.sh test-open$(EXEEXT) test-pathmax$(EXEEXT) \ - test-perror.sh test-perror2$(EXEEXT) test-pipe$(EXEEXT) \ - test-quotearg-simple$(EXEEXT) test-raise$(EXEEXT) \ - test-read-file$(EXEEXT) test-readlink$(EXEEXT) \ - test-regex$(EXEEXT) test-rename$(EXEEXT) test-rmdir$(EXEEXT) \ + test-nl_langinfo.sh test-nl_langinfo-mt$(EXEEXT) \ + test-open$(EXEEXT) test-pathmax$(EXEEXT) test-perror.sh \ + test-perror2$(EXEEXT) test-pipe$(EXEEXT) test-pthread$(EXEEXT) \ + test-pthread-thread$(EXEEXT) test-pthread_sigmask1$(EXEEXT) \ + test-pthread_sigmask2$(EXEEXT) test-quotearg-simple$(EXEEXT) \ + test-raise$(EXEEXT) test-read-file$(EXEEXT) \ + test-readlink$(EXEEXT) test-regex$(EXEEXT) \ + test-rename$(EXEEXT) test-rmdir$(EXEEXT) test-sched$(EXEEXT) \ test-select$(EXEEXT) test-select-in.sh test-select-out.sh \ - test-setenv$(EXEEXT) test-setlocale1.sh test-setlocale2.sh \ - test-setsockopt$(EXEEXT) test-sigaction$(EXEEXT) \ - test-signal-h$(EXEEXT) test-sigprocmask$(EXEEXT) \ - test-sleep$(EXEEXT) test-sockets$(EXEEXT) test-stat$(EXEEXT) \ + test-setenv$(EXEEXT) test-setlocale_null$(EXEEXT) \ + test-setlocale_null-mt-one$(EXEEXT) \ + test-setlocale_null-mt-all$(EXEEXT) test-setlocale1.sh \ + test-setlocale2.sh test-setsockopt$(EXEEXT) \ + test-sigaction$(EXEEXT) test-signal-h$(EXEEXT) \ + test-sigprocmask$(EXEEXT) test-sleep$(EXEEXT) \ + test-sockets$(EXEEXT) test-stat$(EXEEXT) \ test-stat-time$(EXEEXT) test-stdalign$(EXEEXT) \ test-stdbool$(EXEEXT) test-stddef$(EXEEXT) \ test-stdint$(EXEEXT) test-stdio$(EXEEXT) test-stdlib$(EXEEXT) \ @@ -170,15 +178,17 @@ TESTS = test-accept$(EXEEXT) test-set-mode-acl.sh \ test-sys_select$(EXEEXT) test-sys_socket$(EXEEXT) \ test-sys_stat$(EXEEXT) test-sys_time$(EXEEXT) \ test-sys_types$(EXEEXT) test-sys_uio$(EXEEXT) test-init.sh \ + test-thread_self$(EXEEXT) test-thread_create$(EXEEXT) \ test-time$(EXEEXT) test-unistd$(EXEEXT) test-unsetenv$(EXEEXT) \ test-update-copyright.sh test-vc-list-files-git.sh \ test-vc-list-files-cvs.sh test-verify$(EXEEXT) test-verify.sh \ test-version-etc.sh test-wchar$(EXEEXT) test-wcrtomb.sh \ test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh \ test-wcrtomb-w32-3.sh test-wcrtomb-w32-4.sh \ - test-wcrtomb-w32-5.sh test-wctype-h$(EXEEXT) \ + test-wcrtomb-w32-5.sh test-wcrtomb-w32-6.sh \ + test-wcrtomb-w32-7.sh test-wctype-h$(EXEEXT) \ test-xalloc-die.sh -noinst_PROGRAMS = test-localcharset$(EXEEXT) +noinst_PROGRAMS = current-locale$(EXEEXT) test-localcharset$(EXEEXT) check_PROGRAMS = test-accept$(EXEEXT) test-set-mode-acl$(EXEEXT) \ test-copy-acl$(EXEEXT) test-sameacls$(EXEEXT) \ test-alignof$(EXEEXT) test-alloca-opt$(EXEEXT) \ @@ -204,29 +214,35 @@ check_PROGRAMS = test-accept$(EXEEXT) test-set-mode-acl$(EXEEXT) \ test-getdelim$(EXEEXT) test-getdtablesize$(EXEEXT) \ test-getopt-gnu$(EXEEXT) test-getopt-posix$(EXEEXT) \ test-getprogname$(EXEEXT) test-gettimeofday$(EXEEXT) \ - test-ignore-value$(EXEEXT) test-inet_pton$(EXEEXT) \ - test-intprops$(EXEEXT) test-inttypes$(EXEEXT) \ - test-ioctl$(EXEEXT) test-isblank$(EXEEXT) \ - test-langinfo$(EXEEXT) test-limits-h$(EXEEXT) \ - test-link$(EXEEXT) test-listen$(EXEEXT) test-locale$(EXEEXT) \ - test-localeconv$(EXEEXT) test-localename$(EXEEXT) \ - test-lseek$(EXEEXT) test-lstat$(EXEEXT) test-malloca$(EXEEXT) \ + test-hard-locale$(EXEEXT) test-ignore-value$(EXEEXT) \ + test-inet_pton$(EXEEXT) test-intprops$(EXEEXT) \ + test-inttypes$(EXEEXT) test-ioctl$(EXEEXT) \ + test-isblank$(EXEEXT) test-langinfo$(EXEEXT) \ + test-limits-h$(EXEEXT) test-link$(EXEEXT) test-listen$(EXEEXT) \ + test-locale$(EXEEXT) test-localeconv$(EXEEXT) \ + test-localename$(EXEEXT) test-lseek$(EXEEXT) \ + test-lstat$(EXEEXT) test-malloca$(EXEEXT) \ test-mbrtowc$(EXEEXT) test-mbrtowc-w32$(EXEEXT) \ test-mbsinit$(EXEEXT) test-memchr$(EXEEXT) \ test-memrchr$(EXEEXT) test-mkdir$(EXEEXT) \ test-nanosleep$(EXEEXT) test-netinet_in$(EXEEXT) \ - test-nl_langinfo$(EXEEXT) test-open$(EXEEXT) \ - test-pathmax$(EXEEXT) test-perror$(EXEEXT) \ - test-perror2$(EXEEXT) test-pipe$(EXEEXT) \ - test-quotearg-simple$(EXEEXT) test-raise$(EXEEXT) \ - test-read-file$(EXEEXT) test-readlink$(EXEEXT) \ - test-regex$(EXEEXT) test-rename$(EXEEXT) test-rmdir$(EXEEXT) \ + test-nl_langinfo$(EXEEXT) test-nl_langinfo-mt$(EXEEXT) \ + test-open$(EXEEXT) test-pathmax$(EXEEXT) test-perror$(EXEEXT) \ + test-perror2$(EXEEXT) test-pipe$(EXEEXT) test-pthread$(EXEEXT) \ + test-pthread-thread$(EXEEXT) test-pthread_sigmask1$(EXEEXT) \ + test-pthread_sigmask2$(EXEEXT) test-quotearg-simple$(EXEEXT) \ + test-raise$(EXEEXT) test-read-file$(EXEEXT) \ + test-readlink$(EXEEXT) test-regex$(EXEEXT) \ + test-rename$(EXEEXT) test-rmdir$(EXEEXT) test-sched$(EXEEXT) \ test-select$(EXEEXT) test-select-fd$(EXEEXT) \ test-select-stdin$(EXEEXT) test-setenv$(EXEEXT) \ - test-setlocale1$(EXEEXT) test-setlocale2$(EXEEXT) \ - test-setsockopt$(EXEEXT) test-sigaction$(EXEEXT) \ - test-signal-h$(EXEEXT) test-sigprocmask$(EXEEXT) \ - test-sleep$(EXEEXT) test-sockets$(EXEEXT) test-stat$(EXEEXT) \ + test-setlocale_null$(EXEEXT) \ + test-setlocale_null-mt-one$(EXEEXT) \ + test-setlocale_null-mt-all$(EXEEXT) test-setlocale1$(EXEEXT) \ + test-setlocale2$(EXEEXT) test-setsockopt$(EXEEXT) \ + test-sigaction$(EXEEXT) test-signal-h$(EXEEXT) \ + test-sigprocmask$(EXEEXT) test-sleep$(EXEEXT) \ + test-sockets$(EXEEXT) test-stat$(EXEEXT) \ test-stat-time$(EXEEXT) test-stdalign$(EXEEXT) \ test-stdbool$(EXEEXT) test-stddef$(EXEEXT) \ test-stdint$(EXEEXT) test-stdio$(EXEEXT) test-stdlib$(EXEEXT) \ @@ -236,6 +252,7 @@ check_PROGRAMS = test-accept$(EXEEXT) test-set-mode-acl$(EXEEXT) \ test-sys_select$(EXEEXT) test-sys_socket$(EXEEXT) \ test-sys_stat$(EXEEXT) test-sys_time$(EXEEXT) \ test-sys_types$(EXEEXT) test-sys_uio$(EXEEXT) \ + test-thread_self$(EXEEXT) test-thread_create$(EXEEXT) \ test-time$(EXEEXT) test-unistd$(EXEEXT) test-unsetenv$(EXEEXT) \ test-verify$(EXEEXT) test-version-etc$(EXEEXT) \ test-wchar$(EXEEXT) test-wcrtomb$(EXEEXT) \ @@ -250,12 +267,10 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/arpa_inet_h.m4 \ $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/btowc.m4 \ $(top_srcdir)/m4/builtin-expect.m4 \ - $(top_srcdir)/m4/canonicalize.m4 \ - $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \ - $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closeout.m4 \ - $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/ctype.m4 \ - $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \ - $(top_srcdir)/m4/dirname.m4 \ + $(top_srcdir)/m4/canonicalize.m4 $(top_srcdir)/m4/close.m4 \ + $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirent_h.m4 \ + $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \ $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ @@ -274,8 +289,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gettimeofday.m4 $(top_srcdir)/m4/glibc21.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ - $(top_srcdir)/m4/gnulib-comp.m4 \ - $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \ $(top_srcdir)/m4/intl-thread-locale.m4 \ $(top_srcdir)/m4/intlmacosx.m4 \ @@ -290,36 +304,41 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/locale_h.m4 \ $(top_srcdir)/m4/localeconv.m4 $(top_srcdir)/m4/localename.m4 \ $(top_srcdir)/m4/localtime-buffer.m4 $(top_srcdir)/m4/lock.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lseek.m4 \ - $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/malloc.m4 \ - $(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/manywarnings.m4 \ - $(top_srcdir)/m4/mbrlen.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \ - $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \ - $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/minmax.m4 \ - $(top_srcdir)/m4/mkdir.m4 $(top_srcdir)/m4/mkostemp.m4 \ - $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \ - $(top_srcdir)/m4/msvc-inval.m4 \ + $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/mbrlen.m4 \ + $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \ + $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \ + $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memrchr.m4 \ + $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkdir.m4 \ + $(top_srcdir)/m4/mkostemp.m4 $(top_srcdir)/m4/mmap-anon.m4 \ + $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \ $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/nocrash.m4 \ $(top_srcdir)/m4/non-recursive-gnulib-prefix-hack.m4 \ $(top_srcdir)/m4/obstack.m4 $(top_srcdir)/m4/off_t.m4 \ - $(top_srcdir)/m4/open-cloexec.m4 $(top_srcdir)/m4/open.m4 \ + $(top_srcdir)/m4/open-cloexec.m4 \ + $(top_srcdir)/m4/open-slash.m4 $(top_srcdir)/m4/open.m4 \ $(top_srcdir)/m4/opendir.m4 $(top_srcdir)/m4/pathmax.m4 \ - $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/perror.m4 \ + $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/pthread-thread.m4 \ + $(top_srcdir)/m4/pthread_h.m4 \ $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \ - $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quote.m4 \ - $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/raise.m4 \ - $(top_srcdir)/m4/read-file.m4 $(top_srcdir)/m4/readdir.m4 \ - $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/realloc.m4 \ - $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/rename.m4 \ - $(top_srcdir)/m4/rmdir.m4 $(top_srcdir)/m4/select.m4 \ + $(top_srcdir)/m4/pthread_sigmask.m4 $(top_srcdir)/m4/putenv.m4 \ + $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ + $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/read-file.m4 \ + $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/readlink.m4 \ + $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/regex.m4 \ + $(top_srcdir)/m4/rename.m4 $(top_srcdir)/m4/rmdir.m4 \ + $(top_srcdir)/m4/sched_h.m4 $(top_srcdir)/m4/select.m4 \ $(top_srcdir)/m4/selinux-context-h.m4 \ $(top_srcdir)/m4/selinux-selinux-h.m4 \ $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \ + $(top_srcdir)/m4/setlocale_null.m4 \ $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/sleep.m4 \ $(top_srcdir)/m4/socketlib.m4 $(top_srcdir)/m4/sockets.m4 \ @@ -337,10 +356,11 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/sys_socket_h.m4 \ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \ - $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \ - $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/ungetc.m4 \ - $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \ - $(top_srcdir)/m4/version-etc.m4 \ + $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/thread.m4 \ + $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/time_h.m4 \ + $(top_srcdir)/m4/ungetc.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 \ + $(top_srcdir)/m4/version-etc.m4 $(top_srcdir)/m4/visibility.m4 \ $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ @@ -363,16 +383,24 @@ am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libtests_a_AR = $(AR) $(ARFLAGS) am__DEPENDENCIES_1 = +am__dirstamp = $(am__leading_dot)dirstamp am_libtests_a_OBJECTS = cloexec.$(OBJEXT) fd-hook.$(OBJEXT) \ file-has-acl.$(OBJEXT) freading.$(OBJEXT) localename.$(OBJEXT) \ localename-table.$(OBJEXT) read-file.$(OBJEXT) \ - sig-handler.$(OBJEXT) sockets.$(OBJEXT) sys_socket.$(OBJEXT) + sig-handler.$(OBJEXT) sockets.$(OBJEXT) sys_socket.$(OBJEXT) \ + glthread/thread.$(OBJEXT) libtests_a_OBJECTS = $(am_libtests_a_OBJECTS) +am_current_locale_OBJECTS = locale.$(OBJEXT) +current_locale_OBJECTS = $(am_current_locale_OBJECTS) +current_locale_LDADD = $(LDADD) +current_locale_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ + $(am__DEPENDENCIES_1) dfa_match_aux_SOURCES = dfa-match-aux.c dfa_match_aux_OBJECTS = dfa-match-aux.$(OBJEXT) am__DEPENDENCIES_2 = libtests.a ../lib/libsed.a libtests.a \ $(am__DEPENDENCIES_1) -dfa_match_aux_DEPENDENCIES = $(am__DEPENDENCIES_2) +dfa_match_aux_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_accept_SOURCES = test-accept.c test_accept_OBJECTS = test-accept.$(OBJEXT) test_accept_DEPENDENCIES = $(am__DEPENDENCIES_2) @@ -401,24 +429,19 @@ test_bind_OBJECTS = test-bind.$(OBJEXT) test_bind_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) test_btowc_SOURCES = test-btowc.c test_btowc_OBJECTS = test-btowc.$(OBJEXT) -test_btowc_LDADD = $(LDADD) -test_btowc_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ - $(am__DEPENDENCIES_1) +test_btowc_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) test_c_ctype_SOURCES = test-c-ctype.c test_c_ctype_OBJECTS = test-c-ctype.$(OBJEXT) -test_c_ctype_LDADD = $(LDADD) -test_c_ctype_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ +test_c_ctype_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_1) test_c_strcasecmp_SOURCES = test-c-strcasecmp.c test_c_strcasecmp_OBJECTS = test-c-strcasecmp.$(OBJEXT) -test_c_strcasecmp_LDADD = $(LDADD) -test_c_strcasecmp_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ +test_c_strcasecmp_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_1) test_c_strncasecmp_SOURCES = test-c-strncasecmp.c test_c_strncasecmp_OBJECTS = test-c-strncasecmp.$(OBJEXT) -test_c_strncasecmp_LDADD = $(LDADD) -test_c_strncasecmp_DEPENDENCIES = libtests.a ../lib/libsed.a \ - libtests.a $(am__DEPENDENCIES_1) +test_c_strncasecmp_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) test_canonicalize_lgpl_SOURCES = test-canonicalize-lgpl.c test_canonicalize_lgpl_OBJECTS = test-canonicalize-lgpl.$(OBJEXT) test_canonicalize_lgpl_LDADD = $(LDADD) @@ -446,7 +469,7 @@ test_connect_DEPENDENCIES = $(am__DEPENDENCIES_2) \ test_copy_acl_SOURCES = test-copy-acl.c test_copy_acl_OBJECTS = test-copy-acl.$(OBJEXT) test_copy_acl_DEPENDENCIES = $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_ctype_SOURCES = test-ctype.c test_ctype_OBJECTS = test-ctype.$(OBJEXT) test_ctype_LDADD = $(LDADD) @@ -626,6 +649,10 @@ test_gettimeofday_OBJECTS = test-gettimeofday.$(OBJEXT) test_gettimeofday_LDADD = $(LDADD) test_gettimeofday_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ $(am__DEPENDENCIES_1) +test_hard_locale_SOURCES = test-hard-locale.c +test_hard_locale_OBJECTS = test-hard-locale.$(OBJEXT) +test_hard_locale_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) test_ignore_value_SOURCES = test-ignore-value.c test_ignore_value_OBJECTS = test-ignore-value.$(OBJEXT) test_ignore_value_LDADD = $(LDADD) @@ -674,8 +701,7 @@ test_listen_OBJECTS = test-listen.$(OBJEXT) test_listen_DEPENDENCIES = $(am__DEPENDENCIES_2) test_localcharset_SOURCES = test-localcharset.c test_localcharset_OBJECTS = test-localcharset.$(OBJEXT) -test_localcharset_LDADD = $(LDADD) -test_localcharset_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ +test_localcharset_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_1) test_locale_SOURCES = test-locale.c test_locale_OBJECTS = test-locale.$(OBJEXT) @@ -690,7 +716,7 @@ test_localeconv_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ test_localename_SOURCES = test-localename.c test_localename_OBJECTS = test-localename.$(OBJEXT) test_localename_DEPENDENCIES = $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_lseek_SOURCES = test-lseek.c test_lseek_OBJECTS = test-lseek.$(OBJEXT) test_lseek_LDADD = $(LDADD) @@ -708,9 +734,8 @@ test_malloca_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ $(am__DEPENDENCIES_1) test_mbrtowc_SOURCES = test-mbrtowc.c test_mbrtowc_OBJECTS = test-mbrtowc.$(OBJEXT) -test_mbrtowc_LDADD = $(LDADD) -test_mbrtowc_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ - $(am__DEPENDENCIES_1) +test_mbrtowc_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_mbrtowc_w32_SOURCES = test-mbrtowc-w32.c test_mbrtowc_w32_OBJECTS = test-mbrtowc-w32.$(OBJEXT) test_mbrtowc_w32_LDADD = $(LDADD) @@ -718,9 +743,8 @@ test_mbrtowc_w32_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ $(am__DEPENDENCIES_1) test_mbsinit_SOURCES = test-mbsinit.c test_mbsinit_OBJECTS = test-mbsinit.$(OBJEXT) -test_mbsinit_LDADD = $(LDADD) -test_mbsinit_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ - $(am__DEPENDENCIES_1) +test_mbsinit_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_memchr_SOURCES = test-memchr.c test_memchr_OBJECTS = test-memchr.$(OBJEXT) test_memchr_LDADD = $(LDADD) @@ -747,8 +771,12 @@ test_netinet_in_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ $(am__DEPENDENCIES_1) test_nl_langinfo_SOURCES = test-nl_langinfo.c test_nl_langinfo_OBJECTS = test-nl_langinfo.$(OBJEXT) -test_nl_langinfo_LDADD = $(LDADD) -test_nl_langinfo_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ +test_nl_langinfo_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) +test_nl_langinfo_mt_SOURCES = test-nl_langinfo-mt.c +test_nl_langinfo_mt_OBJECTS = test-nl_langinfo-mt.$(OBJEXT) +test_nl_langinfo_mt_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) test_open_SOURCES = test-open.c test_open_OBJECTS = test-open.$(OBJEXT) @@ -775,9 +803,24 @@ test_pipe_OBJECTS = test-pipe.$(OBJEXT) test_pipe_LDADD = $(LDADD) test_pipe_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ $(am__DEPENDENCIES_1) +test_pthread_SOURCES = test-pthread.c +test_pthread_OBJECTS = test-pthread.$(OBJEXT) +test_pthread_LDADD = $(LDADD) +test_pthread_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ + $(am__DEPENDENCIES_1) +test_pthread_thread_SOURCES = test-pthread-thread.c +test_pthread_thread_OBJECTS = test-pthread-thread.$(OBJEXT) +test_pthread_thread_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_pthread_sigmask1_SOURCES = test-pthread_sigmask1.c +test_pthread_sigmask1_OBJECTS = test-pthread_sigmask1.$(OBJEXT) +test_pthread_sigmask1_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_pthread_sigmask2_SOURCES = test-pthread_sigmask2.c +test_pthread_sigmask2_OBJECTS = test-pthread_sigmask2.$(OBJEXT) +test_pthread_sigmask2_DEPENDENCIES = $(am__DEPENDENCIES_2) test_quotearg_simple_SOURCES = test-quotearg-simple.c test_quotearg_simple_OBJECTS = test-quotearg-simple.$(OBJEXT) -test_quotearg_simple_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_quotearg_simple_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) test_raise_SOURCES = test-raise.c test_raise_OBJECTS = test-raise.$(OBJEXT) test_raise_LDADD = $(LDADD) @@ -795,7 +838,8 @@ test_readlink_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ $(am__DEPENDENCIES_1) test_regex_SOURCES = test-regex.c test_regex_OBJECTS = test-regex.$(OBJEXT) -test_regex_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +test_regex_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_rename_SOURCES = test-rename.c test_rename_OBJECTS = test-rename.$(OBJEXT) test_rename_LDADD = $(LDADD) @@ -809,6 +853,11 @@ test_rmdir_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ test_sameacls_SOURCES = test-sameacls.c test_sameacls_OBJECTS = test-sameacls.$(OBJEXT) test_sameacls_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +test_sched_SOURCES = test-sched.c +test_sched_OBJECTS = test-sched.$(OBJEXT) +test_sched_LDADD = $(LDADD) +test_sched_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ $(am__DEPENDENCIES_1) test_select_SOURCES = test-select.c test_select_OBJECTS = test-select.$(OBJEXT) @@ -822,7 +871,7 @@ test_select_stdin_DEPENDENCIES = $(am__DEPENDENCIES_2) test_set_mode_acl_SOURCES = test-set-mode-acl.c test_set_mode_acl_OBJECTS = test-set-mode-acl.$(OBJEXT) test_set_mode_acl_DEPENDENCIES = $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_setenv_SOURCES = test-setenv.c test_setenv_OBJECTS = test-setenv.$(OBJEXT) test_setenv_LDADD = $(LDADD) @@ -830,14 +879,23 @@ test_setenv_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ $(am__DEPENDENCIES_1) test_setlocale1_SOURCES = test-setlocale1.c test_setlocale1_OBJECTS = test-setlocale1.$(OBJEXT) -test_setlocale1_LDADD = $(LDADD) -test_setlocale1_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ - $(am__DEPENDENCIES_1) +test_setlocale1_DEPENDENCIES = $(am__DEPENDENCIES_2) test_setlocale2_SOURCES = test-setlocale2.c test_setlocale2_OBJECTS = test-setlocale2.$(OBJEXT) -test_setlocale2_LDADD = $(LDADD) -test_setlocale2_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ - $(am__DEPENDENCIES_1) +test_setlocale2_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_setlocale_null_SOURCES = test-setlocale_null.c +test_setlocale_null_OBJECTS = test-setlocale_null.$(OBJEXT) +test_setlocale_null_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_setlocale_null_mt_all_SOURCES = test-setlocale_null-mt-all.c +test_setlocale_null_mt_all_OBJECTS = \ + test-setlocale_null-mt-all.$(OBJEXT) +test_setlocale_null_mt_all_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +test_setlocale_null_mt_one_SOURCES = test-setlocale_null-mt-one.c +test_setlocale_null_mt_one_OBJECTS = \ + test-setlocale_null-mt-one.$(OBJEXT) +test_setlocale_null_mt_one_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_setsockopt_SOURCES = test-setsockopt.c test_setsockopt_OBJECTS = test-setsockopt.$(OBJEXT) test_setsockopt_DEPENDENCIES = $(am__DEPENDENCIES_2) @@ -961,6 +1019,12 @@ test_sys_uio_OBJECTS = test-sys_uio.$(OBJEXT) test_sys_uio_LDADD = $(LDADD) test_sys_uio_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ $(am__DEPENDENCIES_1) +test_thread_create_SOURCES = test-thread_create.c +test_thread_create_OBJECTS = test-thread_create.$(OBJEXT) +test_thread_create_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_thread_self_SOURCES = test-thread_self.c +test_thread_self_OBJECTS = test-thread_self.$(OBJEXT) +test_thread_self_DEPENDENCIES = $(am__DEPENDENCIES_2) test_time_SOURCES = test-time.c test_time_OBJECTS = test-time.$(OBJEXT) test_time_LDADD = $(LDADD) @@ -996,8 +1060,7 @@ test_wchar_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ $(am__DEPENDENCIES_1) test_wcrtomb_SOURCES = test-wcrtomb.c test_wcrtomb_OBJECTS = test-wcrtomb.$(OBJEXT) -test_wcrtomb_LDADD = $(LDADD) -test_wcrtomb_DEPENDENCIES = libtests.a ../lib/libsed.a libtests.a \ +test_wcrtomb_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_1) test_wcrtomb_w32_SOURCES = test-wcrtomb-w32.c test_wcrtomb_w32_OBJECTS = test-wcrtomb-w32.$(OBJEXT) @@ -1041,24 +1104,26 @@ am__depfiles_remade = ./$(DEPDIR)/accept.Po ./$(DEPDIR)/bind.Po \ ./$(DEPDIR)/getdtablesize.Po ./$(DEPDIR)/getpagesize.Po \ ./$(DEPDIR)/inet_pton.Po ./$(DEPDIR)/ioctl.Po \ ./$(DEPDIR)/link.Po ./$(DEPDIR)/listen.Po \ - ./$(DEPDIR)/localename-table.Po ./$(DEPDIR)/localename.Po \ - ./$(DEPDIR)/lseek.Po ./$(DEPDIR)/nanosleep.Po \ - ./$(DEPDIR)/open.Po ./$(DEPDIR)/opendir.Po \ - ./$(DEPDIR)/perror.Po ./$(DEPDIR)/pipe.Po \ - ./$(DEPDIR)/putenv.Po ./$(DEPDIR)/raise.Po \ - ./$(DEPDIR)/read-file.Po ./$(DEPDIR)/readdir.Po \ - ./$(DEPDIR)/realloc.Po ./$(DEPDIR)/select.Po \ - ./$(DEPDIR)/setenv.Po ./$(DEPDIR)/setlocale.Po \ - ./$(DEPDIR)/setsockopt.Po ./$(DEPDIR)/sig-handler.Po \ - ./$(DEPDIR)/sigaction.Po ./$(DEPDIR)/sigprocmask.Po \ - ./$(DEPDIR)/sleep.Po ./$(DEPDIR)/socket.Po \ - ./$(DEPDIR)/sockets.Po ./$(DEPDIR)/strdup.Po \ - ./$(DEPDIR)/strerror_r.Po ./$(DEPDIR)/symlink.Po \ - ./$(DEPDIR)/sys_socket.Po ./$(DEPDIR)/test-accept.Po \ - ./$(DEPDIR)/test-alignof.Po ./$(DEPDIR)/test-alloca-opt.Po \ - ./$(DEPDIR)/test-arpa_inet.Po ./$(DEPDIR)/test-binary-io.Po \ - ./$(DEPDIR)/test-bind.Po ./$(DEPDIR)/test-btowc.Po \ - ./$(DEPDIR)/test-c-ctype.Po ./$(DEPDIR)/test-c-strcasecmp.Po \ + ./$(DEPDIR)/locale.Po ./$(DEPDIR)/localename-table.Po \ + ./$(DEPDIR)/localename.Po ./$(DEPDIR)/lseek.Po \ + ./$(DEPDIR)/nanosleep.Po ./$(DEPDIR)/open.Po \ + ./$(DEPDIR)/opendir.Po ./$(DEPDIR)/perror.Po \ + ./$(DEPDIR)/pipe.Po ./$(DEPDIR)/pthread-thread.Po \ + ./$(DEPDIR)/pthread_sigmask.Po ./$(DEPDIR)/putenv.Po \ + ./$(DEPDIR)/raise.Po ./$(DEPDIR)/read-file.Po \ + ./$(DEPDIR)/readdir.Po ./$(DEPDIR)/realloc.Po \ + ./$(DEPDIR)/select.Po ./$(DEPDIR)/setenv.Po \ + ./$(DEPDIR)/setlocale.Po ./$(DEPDIR)/setsockopt.Po \ + ./$(DEPDIR)/sig-handler.Po ./$(DEPDIR)/sigaction.Po \ + ./$(DEPDIR)/sigprocmask.Po ./$(DEPDIR)/sleep.Po \ + ./$(DEPDIR)/socket.Po ./$(DEPDIR)/sockets.Po \ + ./$(DEPDIR)/strdup.Po ./$(DEPDIR)/strerror_r.Po \ + ./$(DEPDIR)/symlink.Po ./$(DEPDIR)/sys_socket.Po \ + ./$(DEPDIR)/test-accept.Po ./$(DEPDIR)/test-alignof.Po \ + ./$(DEPDIR)/test-alloca-opt.Po ./$(DEPDIR)/test-arpa_inet.Po \ + ./$(DEPDIR)/test-binary-io.Po ./$(DEPDIR)/test-bind.Po \ + ./$(DEPDIR)/test-btowc.Po ./$(DEPDIR)/test-c-ctype.Po \ + ./$(DEPDIR)/test-c-strcasecmp.Po \ ./$(DEPDIR)/test-c-strncasecmp.Po \ ./$(DEPDIR)/test-canonicalize-lgpl.Po \ ./$(DEPDIR)/test-chdir.Po ./$(DEPDIR)/test-cloexec.Po \ @@ -1084,6 +1149,7 @@ am__depfiles_remade = ./$(DEPDIR)/accept.Po ./$(DEPDIR)/bind.Po \ ./$(DEPDIR)/test-getopt-posix.Po \ ./$(DEPDIR)/test-getprogname.Po \ ./$(DEPDIR)/test-gettimeofday.Po \ + ./$(DEPDIR)/test-hard-locale.Po \ ./$(DEPDIR)/test-ignore-value.Po ./$(DEPDIR)/test-inet_pton.Po \ ./$(DEPDIR)/test-intprops.Po ./$(DEPDIR)/test-inttypes.Po \ ./$(DEPDIR)/test-ioctl.Po ./$(DEPDIR)/test-isblank.Po \ @@ -1096,17 +1162,25 @@ am__depfiles_remade = ./$(DEPDIR)/accept.Po ./$(DEPDIR)/bind.Po \ ./$(DEPDIR)/test-mbrtowc.Po ./$(DEPDIR)/test-mbsinit.Po \ ./$(DEPDIR)/test-memchr.Po ./$(DEPDIR)/test-memrchr.Po \ ./$(DEPDIR)/test-mkdir.Po ./$(DEPDIR)/test-nanosleep.Po \ - ./$(DEPDIR)/test-netinet_in.Po ./$(DEPDIR)/test-nl_langinfo.Po \ - ./$(DEPDIR)/test-open.Po ./$(DEPDIR)/test-pathmax.Po \ - ./$(DEPDIR)/test-perror.Po ./$(DEPDIR)/test-perror2.Po \ - ./$(DEPDIR)/test-pipe.Po ./$(DEPDIR)/test-quotearg-simple.Po \ - ./$(DEPDIR)/test-raise.Po ./$(DEPDIR)/test-read-file.Po \ - ./$(DEPDIR)/test-readlink.Po ./$(DEPDIR)/test-regex.Po \ - ./$(DEPDIR)/test-rename.Po ./$(DEPDIR)/test-rmdir.Po \ - ./$(DEPDIR)/test-sameacls.Po ./$(DEPDIR)/test-select-fd.Po \ + ./$(DEPDIR)/test-netinet_in.Po \ + ./$(DEPDIR)/test-nl_langinfo-mt.Po \ + ./$(DEPDIR)/test-nl_langinfo.Po ./$(DEPDIR)/test-open.Po \ + ./$(DEPDIR)/test-pathmax.Po ./$(DEPDIR)/test-perror.Po \ + ./$(DEPDIR)/test-perror2.Po ./$(DEPDIR)/test-pipe.Po \ + ./$(DEPDIR)/test-pthread-thread.Po ./$(DEPDIR)/test-pthread.Po \ + ./$(DEPDIR)/test-pthread_sigmask1.Po \ + ./$(DEPDIR)/test-pthread_sigmask2.Po \ + ./$(DEPDIR)/test-quotearg-simple.Po ./$(DEPDIR)/test-raise.Po \ + ./$(DEPDIR)/test-read-file.Po ./$(DEPDIR)/test-readlink.Po \ + ./$(DEPDIR)/test-regex.Po ./$(DEPDIR)/test-rename.Po \ + ./$(DEPDIR)/test-rmdir.Po ./$(DEPDIR)/test-sameacls.Po \ + ./$(DEPDIR)/test-sched.Po ./$(DEPDIR)/test-select-fd.Po \ ./$(DEPDIR)/test-select-stdin.Po ./$(DEPDIR)/test-select.Po \ ./$(DEPDIR)/test-set-mode-acl.Po ./$(DEPDIR)/test-setenv.Po \ ./$(DEPDIR)/test-setlocale1.Po ./$(DEPDIR)/test-setlocale2.Po \ + ./$(DEPDIR)/test-setlocale_null-mt-all.Po \ + ./$(DEPDIR)/test-setlocale_null-mt-one.Po \ + ./$(DEPDIR)/test-setlocale_null.Po \ ./$(DEPDIR)/test-setsockopt.Po ./$(DEPDIR)/test-sigaction.Po \ ./$(DEPDIR)/test-signal-h.Po ./$(DEPDIR)/test-sigprocmask.Po \ ./$(DEPDIR)/test-sleep.Po ./$(DEPDIR)/test-sockets.Po \ @@ -1120,12 +1194,15 @@ am__depfiles_remade = ./$(DEPDIR)/accept.Po ./$(DEPDIR)/bind.Po \ ./$(DEPDIR)/test-sys_select.Po ./$(DEPDIR)/test-sys_socket.Po \ ./$(DEPDIR)/test-sys_stat.Po ./$(DEPDIR)/test-sys_time.Po \ ./$(DEPDIR)/test-sys_types.Po ./$(DEPDIR)/test-sys_uio.Po \ - ./$(DEPDIR)/test-time.Po ./$(DEPDIR)/test-unistd.Po \ - ./$(DEPDIR)/test-unsetenv.Po ./$(DEPDIR)/test-verify-try.Po \ - ./$(DEPDIR)/test-verify.Po ./$(DEPDIR)/test-version-etc.Po \ - ./$(DEPDIR)/test-wchar.Po ./$(DEPDIR)/test-wcrtomb-w32.Po \ - ./$(DEPDIR)/test-wcrtomb.Po ./$(DEPDIR)/test-wctype-h.Po \ - ./$(DEPDIR)/test-xalloc-die.Po ./$(DEPDIR)/unsetenv.Po + ./$(DEPDIR)/test-thread_create.Po \ + ./$(DEPDIR)/test-thread_self.Po ./$(DEPDIR)/test-time.Po \ + ./$(DEPDIR)/test-unistd.Po ./$(DEPDIR)/test-unsetenv.Po \ + ./$(DEPDIR)/test-verify-try.Po ./$(DEPDIR)/test-verify.Po \ + ./$(DEPDIR)/test-version-etc.Po ./$(DEPDIR)/test-wchar.Po \ + ./$(DEPDIR)/test-wcrtomb-w32.Po ./$(DEPDIR)/test-wcrtomb.Po \ + ./$(DEPDIR)/test-wctype-h.Po ./$(DEPDIR)/test-xalloc-die.Po \ + ./$(DEPDIR)/unsetenv.Po ./$(DEPDIR)/windows-thread.Po \ + ./$(DEPDIR)/windows-tls.Po glthread/$(DEPDIR)/thread.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -1140,9 +1217,10 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \ - dfa-match-aux.c test-accept.c test-alignof.c test-alloca-opt.c \ - test-arpa_inet.c test-binary-io.c test-bind.c test-btowc.c \ - test-c-ctype.c test-c-strcasecmp.c test-c-strncasecmp.c \ + $(current_locale_SOURCES) dfa-match-aux.c test-accept.c \ + test-alignof.c test-alloca-opt.c test-arpa_inet.c \ + test-binary-io.c test-bind.c test-btowc.c test-c-ctype.c \ + test-c-strcasecmp.c test-c-strncasecmp.c \ test-canonicalize-lgpl.c test-chdir.c test-cloexec.c \ test-close.c test-connect.c test-copy-acl.c test-ctype.c \ test-dirent.c test-dup2.c test-environ.c test-errno.c \ @@ -1155,19 +1233,23 @@ SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \ test-fwrite.c test-fwriting.c test-getcwd-lgpl.c \ test-getdelim.c test-getdtablesize.c test-getopt-gnu.c \ test-getopt-posix.c test-getprogname.c test-gettimeofday.c \ - test-ignore-value.c test-inet_pton.c test-intprops.c \ - test-inttypes.c test-ioctl.c test-isblank.c test-langinfo.c \ - test-limits-h.c test-link.c test-listen.c test-localcharset.c \ - test-locale.c test-localeconv.c test-localename.c test-lseek.c \ - test-lstat.c test-malloca.c test-mbrtowc.c test-mbrtowc-w32.c \ - test-mbsinit.c test-memchr.c test-memrchr.c test-mkdir.c \ - test-nanosleep.c test-netinet_in.c test-nl_langinfo.c \ - test-open.c test-pathmax.c test-perror.c test-perror2.c \ - test-pipe.c test-quotearg-simple.c test-raise.c \ + test-hard-locale.c test-ignore-value.c test-inet_pton.c \ + test-intprops.c test-inttypes.c test-ioctl.c test-isblank.c \ + test-langinfo.c test-limits-h.c test-link.c test-listen.c \ + test-localcharset.c test-locale.c test-localeconv.c \ + test-localename.c test-lseek.c test-lstat.c test-malloca.c \ + test-mbrtowc.c test-mbrtowc-w32.c test-mbsinit.c test-memchr.c \ + test-memrchr.c test-mkdir.c test-nanosleep.c test-netinet_in.c \ + test-nl_langinfo.c test-nl_langinfo-mt.c test-open.c \ + test-pathmax.c test-perror.c test-perror2.c test-pipe.c \ + test-pthread.c test-pthread-thread.c test-pthread_sigmask1.c \ + test-pthread_sigmask2.c test-quotearg-simple.c test-raise.c \ test-read-file.c test-readlink.c test-regex.c test-rename.c \ - test-rmdir.c test-sameacls.c test-select.c test-select-fd.c \ - test-select-stdin.c test-set-mode-acl.c test-setenv.c \ - test-setlocale1.c test-setlocale2.c test-setsockopt.c \ + test-rmdir.c test-sameacls.c test-sched.c test-select.c \ + test-select-fd.c test-select-stdin.c test-set-mode-acl.c \ + test-setenv.c test-setlocale1.c test-setlocale2.c \ + test-setlocale_null.c test-setlocale_null-mt-all.c \ + test-setlocale_null-mt-one.c test-setsockopt.c \ test-sigaction.c test-signal-h.c test-sigprocmask.c \ test-sleep.c test-sockets.c test-stat.c test-stat-time.c \ test-stdalign.c test-stdbool.c test-stddef.c test-stdint.c \ @@ -1175,14 +1257,16 @@ SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \ test-string.c test-strverscmp.c test-symlink.c \ test-sys_ioctl.c test-sys_select.c test-sys_socket.c \ test-sys_stat.c test-sys_time.c test-sys_types.c \ - test-sys_uio.c test-time.c test-unistd.c test-unsetenv.c \ - test-verify.c test-verify-try.c test-version-etc.c \ - test-wchar.c test-wcrtomb.c test-wcrtomb-w32.c test-wctype-h.c \ + test-sys_uio.c test-thread_create.c test-thread_self.c \ + test-time.c test-unistd.c test-unsetenv.c test-verify.c \ + test-verify-try.c test-version-etc.c test-wchar.c \ + test-wcrtomb.c test-wcrtomb-w32.c test-wctype-h.c \ test-xalloc-die.c DIST_SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \ - dfa-match-aux.c test-accept.c test-alignof.c test-alloca-opt.c \ - test-arpa_inet.c test-binary-io.c test-bind.c test-btowc.c \ - test-c-ctype.c test-c-strcasecmp.c test-c-strncasecmp.c \ + $(current_locale_SOURCES) dfa-match-aux.c test-accept.c \ + test-alignof.c test-alloca-opt.c test-arpa_inet.c \ + test-binary-io.c test-bind.c test-btowc.c test-c-ctype.c \ + test-c-strcasecmp.c test-c-strncasecmp.c \ test-canonicalize-lgpl.c test-chdir.c test-cloexec.c \ test-close.c test-connect.c test-copy-acl.c test-ctype.c \ test-dirent.c test-dup2.c test-environ.c test-errno.c \ @@ -1195,19 +1279,23 @@ DIST_SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \ test-fwrite.c test-fwriting.c test-getcwd-lgpl.c \ test-getdelim.c test-getdtablesize.c test-getopt-gnu.c \ test-getopt-posix.c test-getprogname.c test-gettimeofday.c \ - test-ignore-value.c test-inet_pton.c test-intprops.c \ - test-inttypes.c test-ioctl.c test-isblank.c test-langinfo.c \ - test-limits-h.c test-link.c test-listen.c test-localcharset.c \ - test-locale.c test-localeconv.c test-localename.c test-lseek.c \ - test-lstat.c test-malloca.c test-mbrtowc.c test-mbrtowc-w32.c \ - test-mbsinit.c test-memchr.c test-memrchr.c test-mkdir.c \ - test-nanosleep.c test-netinet_in.c test-nl_langinfo.c \ - test-open.c test-pathmax.c test-perror.c test-perror2.c \ - test-pipe.c test-quotearg-simple.c test-raise.c \ + test-hard-locale.c test-ignore-value.c test-inet_pton.c \ + test-intprops.c test-inttypes.c test-ioctl.c test-isblank.c \ + test-langinfo.c test-limits-h.c test-link.c test-listen.c \ + test-localcharset.c test-locale.c test-localeconv.c \ + test-localename.c test-lseek.c test-lstat.c test-malloca.c \ + test-mbrtowc.c test-mbrtowc-w32.c test-mbsinit.c test-memchr.c \ + test-memrchr.c test-mkdir.c test-nanosleep.c test-netinet_in.c \ + test-nl_langinfo.c test-nl_langinfo-mt.c test-open.c \ + test-pathmax.c test-perror.c test-perror2.c test-pipe.c \ + test-pthread.c test-pthread-thread.c test-pthread_sigmask1.c \ + test-pthread_sigmask2.c test-quotearg-simple.c test-raise.c \ test-read-file.c test-readlink.c test-regex.c test-rename.c \ - test-rmdir.c test-sameacls.c test-select.c test-select-fd.c \ - test-select-stdin.c test-set-mode-acl.c test-setenv.c \ - test-setlocale1.c test-setlocale2.c test-setsockopt.c \ + test-rmdir.c test-sameacls.c test-sched.c test-select.c \ + test-select-fd.c test-select-stdin.c test-set-mode-acl.c \ + test-setenv.c test-setlocale1.c test-setlocale2.c \ + test-setlocale_null.c test-setlocale_null-mt-all.c \ + test-setlocale_null-mt-one.c test-setsockopt.c \ test-sigaction.c test-signal-h.c test-sigprocmask.c \ test-sleep.c test-sockets.c test-stat.c test-stat-time.c \ test-stdalign.c test-stdbool.c test-stddef.c test-stdint.c \ @@ -1215,9 +1303,10 @@ DIST_SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \ test-string.c test-strverscmp.c test-symlink.c \ test-sys_ioctl.c test-sys_select.c test-sys_socket.c \ test-sys_stat.c test-sys_time.c test-sys_types.c \ - test-sys_uio.c test-time.c test-unistd.c test-unsetenv.c \ - test-verify.c test-verify-try.c test-version-etc.c \ - test-wchar.c test-wcrtomb.c test-wcrtomb-w32.c test-wctype-h.c \ + test-sys_uio.c test-thread_create.c test-thread_self.c \ + test-time.c test-unistd.c test-unsetenv.c test-verify.c \ + test-verify-try.c test-version-etc.c test-wchar.c \ + test-wcrtomb.c test-wcrtomb-w32.c test-wctype-h.c \ test-xalloc-die.c RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ @@ -1513,6 +1602,7 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ CONFIG_INCLUDE = @CONFIG_INCLUDE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -1539,6 +1629,7 @@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_ACCEPT = @GNULIB_ACCEPT@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ +GNULIB_ACCESS = @GNULIB_ACCESS@ GNULIB_ALPHASORT = @GNULIB_ALPHASORT@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_BIND = @GNULIB_BIND@ @@ -1550,6 +1641,8 @@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@ GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_COPY_FILE_RANGE = @GNULIB_COPY_FILE_RANGE@ +GNULIB_CREAT = @GNULIB_CREAT@ GNULIB_CTIME = @GNULIB_CTIME@ GNULIB_DIRFD = @GNULIB_DIRFD@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ @@ -1605,6 +1698,7 @@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETOPT_POSIX = @GNULIB_GETOPT_POSIX@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETPASS = @GNULIB_GETPASS@ GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ @@ -1691,7 +1785,15 @@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PSELECT = @GNULIB_PSELECT@ +GNULIB_PTHREAD_COND = @GNULIB_PTHREAD_COND@ +GNULIB_PTHREAD_MUTEX = @GNULIB_PTHREAD_MUTEX@ +GNULIB_PTHREAD_MUTEX_TIMEDLOCK = @GNULIB_PTHREAD_MUTEX_TIMEDLOCK@ +GNULIB_PTHREAD_ONCE = @GNULIB_PTHREAD_ONCE@ +GNULIB_PTHREAD_RWLOCK = @GNULIB_PTHREAD_RWLOCK@ GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ +GNULIB_PTHREAD_SPIN = @GNULIB_PTHREAD_SPIN@ +GNULIB_PTHREAD_THREAD = @GNULIB_PTHREAD_THREAD@ +GNULIB_PTHREAD_TSS = @GNULIB_PTHREAD_TSS@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTC = @GNULIB_PUTC@ @@ -1721,6 +1823,7 @@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SCANDIR = @GNULIB_SCANDIR@ GNULIB_SCANF = @GNULIB_SCANF@ +GNULIB_SCHED_YIELD = @GNULIB_SCHED_YIELD@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SELECT = @GNULIB_SELECT@ GNULIB_SEND = @GNULIB_SEND@ @@ -1728,6 +1831,7 @@ GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ +GNULIB_SETLOCALE_NULL = @GNULIB_SETLOCALE_NULL@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ @@ -1759,6 +1863,7 @@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLD = @GNULIB_STRTOLD@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ @@ -1834,6 +1939,7 @@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GREP = @GREP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ +HAVE_ALLOCA_H = @HAVE_ALLOCA_H@ HAVE_ALPHASORT = @HAVE_ALPHASORT@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ @@ -1842,6 +1948,7 @@ HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_CLOSEDIR = @HAVE_CLOSEDIR@ +HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@ HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ @@ -1922,6 +2029,7 @@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@ +HAVE_INITSTATE = @HAVE_INITSTATE@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISBLANK = @HAVE_ISBLANK@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ @@ -1936,7 +2044,6 @@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ -HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ HAVE_MBRLEN = @HAVE_MBRLEN@ @@ -1945,6 +2052,7 @@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ +HAVE_MBTOWC = @HAVE_MBTOWC@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ @@ -1973,7 +2081,65 @@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PSELECT = @HAVE_PSELECT@ +HAVE_PTHREAD_ATTR_DESTROY = @HAVE_PTHREAD_ATTR_DESTROY@ +HAVE_PTHREAD_ATTR_GETDETACHSTATE = @HAVE_PTHREAD_ATTR_GETDETACHSTATE@ +HAVE_PTHREAD_ATTR_INIT = @HAVE_PTHREAD_ATTR_INIT@ +HAVE_PTHREAD_ATTR_SETDETACHSTATE = @HAVE_PTHREAD_ATTR_SETDETACHSTATE@ +HAVE_PTHREAD_CONDATTR_DESTROY = @HAVE_PTHREAD_CONDATTR_DESTROY@ +HAVE_PTHREAD_CONDATTR_INIT = @HAVE_PTHREAD_CONDATTR_INIT@ +HAVE_PTHREAD_COND_BROADCAST = @HAVE_PTHREAD_COND_BROADCAST@ +HAVE_PTHREAD_COND_DESTROY = @HAVE_PTHREAD_COND_DESTROY@ +HAVE_PTHREAD_COND_INIT = @HAVE_PTHREAD_COND_INIT@ +HAVE_PTHREAD_COND_SIGNAL = @HAVE_PTHREAD_COND_SIGNAL@ +HAVE_PTHREAD_COND_TIMEDWAIT = @HAVE_PTHREAD_COND_TIMEDWAIT@ +HAVE_PTHREAD_COND_WAIT = @HAVE_PTHREAD_COND_WAIT@ +HAVE_PTHREAD_CREATE = @HAVE_PTHREAD_CREATE@ +HAVE_PTHREAD_CREATE_DETACHED = @HAVE_PTHREAD_CREATE_DETACHED@ +HAVE_PTHREAD_DETACH = @HAVE_PTHREAD_DETACH@ +HAVE_PTHREAD_EQUAL = @HAVE_PTHREAD_EQUAL@ +HAVE_PTHREAD_EXIT = @HAVE_PTHREAD_EXIT@ +HAVE_PTHREAD_GETSPECIFIC = @HAVE_PTHREAD_GETSPECIFIC@ +HAVE_PTHREAD_H = @HAVE_PTHREAD_H@ +HAVE_PTHREAD_JOIN = @HAVE_PTHREAD_JOIN@ +HAVE_PTHREAD_KEY_CREATE = @HAVE_PTHREAD_KEY_CREATE@ +HAVE_PTHREAD_KEY_DELETE = @HAVE_PTHREAD_KEY_DELETE@ +HAVE_PTHREAD_MUTEXATTR_DESTROY = @HAVE_PTHREAD_MUTEXATTR_DESTROY@ +HAVE_PTHREAD_MUTEXATTR_GETROBUST = @HAVE_PTHREAD_MUTEXATTR_GETROBUST@ +HAVE_PTHREAD_MUTEXATTR_GETTYPE = @HAVE_PTHREAD_MUTEXATTR_GETTYPE@ +HAVE_PTHREAD_MUTEXATTR_INIT = @HAVE_PTHREAD_MUTEXATTR_INIT@ +HAVE_PTHREAD_MUTEXATTR_SETROBUST = @HAVE_PTHREAD_MUTEXATTR_SETROBUST@ +HAVE_PTHREAD_MUTEXATTR_SETTYPE = @HAVE_PTHREAD_MUTEXATTR_SETTYPE@ +HAVE_PTHREAD_MUTEX_DESTROY = @HAVE_PTHREAD_MUTEX_DESTROY@ +HAVE_PTHREAD_MUTEX_INIT = @HAVE_PTHREAD_MUTEX_INIT@ +HAVE_PTHREAD_MUTEX_LOCK = @HAVE_PTHREAD_MUTEX_LOCK@ +HAVE_PTHREAD_MUTEX_RECURSIVE = @HAVE_PTHREAD_MUTEX_RECURSIVE@ +HAVE_PTHREAD_MUTEX_ROBUST = @HAVE_PTHREAD_MUTEX_ROBUST@ +HAVE_PTHREAD_MUTEX_TIMEDLOCK = @HAVE_PTHREAD_MUTEX_TIMEDLOCK@ +HAVE_PTHREAD_MUTEX_TRYLOCK = @HAVE_PTHREAD_MUTEX_TRYLOCK@ +HAVE_PTHREAD_MUTEX_UNLOCK = @HAVE_PTHREAD_MUTEX_UNLOCK@ +HAVE_PTHREAD_ONCE = @HAVE_PTHREAD_ONCE@ +HAVE_PTHREAD_PROCESS_SHARED = @HAVE_PTHREAD_PROCESS_SHARED@ +HAVE_PTHREAD_RWLOCKATTR_DESTROY = @HAVE_PTHREAD_RWLOCKATTR_DESTROY@ +HAVE_PTHREAD_RWLOCKATTR_INIT = @HAVE_PTHREAD_RWLOCKATTR_INIT@ +HAVE_PTHREAD_RWLOCK_DESTROY = @HAVE_PTHREAD_RWLOCK_DESTROY@ +HAVE_PTHREAD_RWLOCK_INIT = @HAVE_PTHREAD_RWLOCK_INIT@ +HAVE_PTHREAD_RWLOCK_RDLOCK = @HAVE_PTHREAD_RWLOCK_RDLOCK@ +HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK@ +HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK@ +HAVE_PTHREAD_RWLOCK_TRYRDLOCK = @HAVE_PTHREAD_RWLOCK_TRYRDLOCK@ +HAVE_PTHREAD_RWLOCK_TRYWRLOCK = @HAVE_PTHREAD_RWLOCK_TRYWRLOCK@ +HAVE_PTHREAD_RWLOCK_UNLOCK = @HAVE_PTHREAD_RWLOCK_UNLOCK@ +HAVE_PTHREAD_RWLOCK_WRLOCK = @HAVE_PTHREAD_RWLOCK_WRLOCK@ +HAVE_PTHREAD_SELF = @HAVE_PTHREAD_SELF@ +HAVE_PTHREAD_SETSPECIFIC = @HAVE_PTHREAD_SETSPECIFIC@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ +HAVE_PTHREAD_SPINLOCK_T = @HAVE_PTHREAD_SPINLOCK_T@ +HAVE_PTHREAD_SPIN_DESTROY = @HAVE_PTHREAD_SPIN_DESTROY@ +HAVE_PTHREAD_SPIN_INIT = @HAVE_PTHREAD_SPIN_INIT@ +HAVE_PTHREAD_SPIN_LOCK = @HAVE_PTHREAD_SPIN_LOCK@ +HAVE_PTHREAD_SPIN_TRYLOCK = @HAVE_PTHREAD_SPIN_TRYLOCK@ +HAVE_PTHREAD_SPIN_UNLOCK = @HAVE_PTHREAD_SPIN_UNLOCK@ +HAVE_PTHREAD_T = @HAVE_PTHREAD_T@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ @@ -1993,9 +2159,12 @@ HAVE_REWINDDIR = @HAVE_REWINDDIR@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ HAVE_SCANDIR = @HAVE_SCANDIR@ +HAVE_SCHED_H = @HAVE_SCHED_H@ +HAVE_SCHED_YIELD = @HAVE_SCHED_YIELD@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SETSTATE = @HAVE_SETSTATE@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ @@ -2013,9 +2182,11 @@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLD = @HAVE_STRTOLD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ @@ -2041,11 +2212,11 @@ HAVE_TZSET = @HAVE_TZSET@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ -HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WCPCPY = @HAVE_WCPCPY@ @@ -2106,19 +2277,28 @@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ -LIBPTH = @LIBPTH@ -LIBPTH_PREFIX = @LIBPTH_PREFIX@ +LIBPMULTITHREAD = @LIBPMULTITHREAD@ +LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LIBSED_LIBDEPS = @LIBSED_LIBDEPS@ LIBSED_LTLIBDEPS = @LIBSED_LTLIBDEPS@ LIBSOCKET = @LIBSOCKET@ +LIBSTDTHREAD = @LIBSTDTHREAD@ LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIBTHREAD = @LIBTHREAD@ LIB_ACL = @LIB_ACL@ +LIB_HARD_LOCALE = @LIB_HARD_LOCALE@ LIB_HAS_ACL = @LIB_HAS_ACL@ +LIB_MBRTOWC = @LIB_MBRTOWC@ LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LIB_NL_LANGINFO = @LIB_NL_LANGINFO@ +LIB_PTHREAD = @LIB_PTHREAD@ +LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@ +LIB_SCHED_YIELD = @LIB_SCHED_YIELD@ LIB_SELECT = @LIB_SELECT@ LIB_SELINUX = @LIB_SELINUX@ +LIB_SETLOCALE = @LIB_SETLOCALE@ +LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@ LIMITS_H = @LIMITS_H@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ @@ -2130,7 +2310,6 @@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ -LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ @@ -2150,6 +2329,8 @@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ +NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H = @NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H@ +NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@ NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H = @NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ @@ -2179,6 +2360,8 @@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_PTHREAD_H = @NEXT_PTHREAD_H@ +NEXT_SCHED_H = @NEXT_SCHED_H@ NEXT_SELINUX_SELINUX_H = @NEXT_SELINUX_SELINUX_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ @@ -2216,12 +2399,14 @@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_ACCESS = @REPLACE_ACCESS@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@ +REPLACE_CREAT = @REPLACE_CREAT@ REPLACE_CTIME = @REPLACE_CTIME@ REPLACE_DIRFD = @REPLACE_DIRFD@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ @@ -2261,6 +2446,7 @@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_GMTIME = @REPLACE_GMTIME@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ +REPLACE_INITSTATE = @REPLACE_INITSTATE@ REPLACE_IOCTL = @REPLACE_IOCTL@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ @@ -2301,13 +2487,65 @@ REPLACE_POPEN = @REPLACE_POPEN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PSELECT = @REPLACE_PSELECT@ +REPLACE_PTHREAD_ATTR_DESTROY = @REPLACE_PTHREAD_ATTR_DESTROY@ +REPLACE_PTHREAD_ATTR_GETDETACHSTATE = @REPLACE_PTHREAD_ATTR_GETDETACHSTATE@ +REPLACE_PTHREAD_ATTR_INIT = @REPLACE_PTHREAD_ATTR_INIT@ +REPLACE_PTHREAD_ATTR_SETDETACHSTATE = @REPLACE_PTHREAD_ATTR_SETDETACHSTATE@ +REPLACE_PTHREAD_CONDATTR_DESTROY = @REPLACE_PTHREAD_CONDATTR_DESTROY@ +REPLACE_PTHREAD_CONDATTR_INIT = @REPLACE_PTHREAD_CONDATTR_INIT@ +REPLACE_PTHREAD_COND_BROADCAST = @REPLACE_PTHREAD_COND_BROADCAST@ +REPLACE_PTHREAD_COND_DESTROY = @REPLACE_PTHREAD_COND_DESTROY@ +REPLACE_PTHREAD_COND_INIT = @REPLACE_PTHREAD_COND_INIT@ +REPLACE_PTHREAD_COND_SIGNAL = @REPLACE_PTHREAD_COND_SIGNAL@ +REPLACE_PTHREAD_COND_TIMEDWAIT = @REPLACE_PTHREAD_COND_TIMEDWAIT@ +REPLACE_PTHREAD_COND_WAIT = @REPLACE_PTHREAD_COND_WAIT@ +REPLACE_PTHREAD_CREATE = @REPLACE_PTHREAD_CREATE@ +REPLACE_PTHREAD_DETACH = @REPLACE_PTHREAD_DETACH@ +REPLACE_PTHREAD_EQUAL = @REPLACE_PTHREAD_EQUAL@ +REPLACE_PTHREAD_EXIT = @REPLACE_PTHREAD_EXIT@ +REPLACE_PTHREAD_GETSPECIFIC = @REPLACE_PTHREAD_GETSPECIFIC@ +REPLACE_PTHREAD_JOIN = @REPLACE_PTHREAD_JOIN@ +REPLACE_PTHREAD_KEY_CREATE = @REPLACE_PTHREAD_KEY_CREATE@ +REPLACE_PTHREAD_KEY_DELETE = @REPLACE_PTHREAD_KEY_DELETE@ +REPLACE_PTHREAD_MUTEXATTR_DESTROY = @REPLACE_PTHREAD_MUTEXATTR_DESTROY@ +REPLACE_PTHREAD_MUTEXATTR_GETROBUST = @REPLACE_PTHREAD_MUTEXATTR_GETROBUST@ +REPLACE_PTHREAD_MUTEXATTR_GETTYPE = @REPLACE_PTHREAD_MUTEXATTR_GETTYPE@ +REPLACE_PTHREAD_MUTEXATTR_INIT = @REPLACE_PTHREAD_MUTEXATTR_INIT@ +REPLACE_PTHREAD_MUTEXATTR_SETROBUST = @REPLACE_PTHREAD_MUTEXATTR_SETROBUST@ +REPLACE_PTHREAD_MUTEXATTR_SETTYPE = @REPLACE_PTHREAD_MUTEXATTR_SETTYPE@ +REPLACE_PTHREAD_MUTEX_DESTROY = @REPLACE_PTHREAD_MUTEX_DESTROY@ +REPLACE_PTHREAD_MUTEX_INIT = @REPLACE_PTHREAD_MUTEX_INIT@ +REPLACE_PTHREAD_MUTEX_LOCK = @REPLACE_PTHREAD_MUTEX_LOCK@ +REPLACE_PTHREAD_MUTEX_TIMEDLOCK = @REPLACE_PTHREAD_MUTEX_TIMEDLOCK@ +REPLACE_PTHREAD_MUTEX_TRYLOCK = @REPLACE_PTHREAD_MUTEX_TRYLOCK@ +REPLACE_PTHREAD_MUTEX_UNLOCK = @REPLACE_PTHREAD_MUTEX_UNLOCK@ +REPLACE_PTHREAD_ONCE = @REPLACE_PTHREAD_ONCE@ +REPLACE_PTHREAD_RWLOCKATTR_DESTROY = @REPLACE_PTHREAD_RWLOCKATTR_DESTROY@ +REPLACE_PTHREAD_RWLOCKATTR_INIT = @REPLACE_PTHREAD_RWLOCKATTR_INIT@ +REPLACE_PTHREAD_RWLOCK_DESTROY = @REPLACE_PTHREAD_RWLOCK_DESTROY@ +REPLACE_PTHREAD_RWLOCK_INIT = @REPLACE_PTHREAD_RWLOCK_INIT@ +REPLACE_PTHREAD_RWLOCK_RDLOCK = @REPLACE_PTHREAD_RWLOCK_RDLOCK@ +REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK@ +REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK@ +REPLACE_PTHREAD_RWLOCK_TRYRDLOCK = @REPLACE_PTHREAD_RWLOCK_TRYRDLOCK@ +REPLACE_PTHREAD_RWLOCK_TRYWRLOCK = @REPLACE_PTHREAD_RWLOCK_TRYWRLOCK@ +REPLACE_PTHREAD_RWLOCK_UNLOCK = @REPLACE_PTHREAD_RWLOCK_UNLOCK@ +REPLACE_PTHREAD_RWLOCK_WRLOCK = @REPLACE_PTHREAD_RWLOCK_WRLOCK@ +REPLACE_PTHREAD_SELF = @REPLACE_PTHREAD_SELF@ +REPLACE_PTHREAD_SETSPECIFIC = @REPLACE_PTHREAD_SETSPECIFIC@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ +REPLACE_PTHREAD_SPIN_DESTROY = @REPLACE_PTHREAD_SPIN_DESTROY@ +REPLACE_PTHREAD_SPIN_INIT = @REPLACE_PTHREAD_SPIN_INIT@ +REPLACE_PTHREAD_SPIN_LOCK = @REPLACE_PTHREAD_SPIN_LOCK@ +REPLACE_PTHREAD_SPIN_TRYLOCK = @REPLACE_PTHREAD_SPIN_TRYLOCK@ +REPLACE_PTHREAD_SPIN_UNLOCK = @REPLACE_PTHREAD_SPIN_UNLOCK@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RAISE = @REPLACE_RAISE@ +REPLACE_RANDOM = @REPLACE_RANDOM@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ @@ -2318,9 +2556,11 @@ REPLACE_REMOVE = @REPLACE_REMOVE@ REPLACE_RENAME = @REPLACE_RENAME@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_SCHED_YIELD = @REPLACE_SCHED_YIELD@ REPLACE_SELECT = @REPLACE_SELECT@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ +REPLACE_SETSTATE = @REPLACE_SETSTATE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ @@ -2342,6 +2582,7 @@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOLD = @REPLACE_STRTOLD@ REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ @@ -2368,6 +2609,7 @@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSTOK = @REPLACE_WCSTOK@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ @@ -2466,7 +2708,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AUTOMAKE_OPTIONS = 1.11 foreign +AUTOMAKE_OPTIONS = 1.11 foreign subdir-objects SUBDIRS = . TESTS_ENVIRONMENT = EXEEXT='@EXEEXT@' srcdir='$(srcdir)' \ USE_ACL=$(USE_ACL) LOCALE_FR='@LOCALE_FR@' \ @@ -2508,29 +2750,29 @@ EXTRA_DIST = accept.c w32sock.h test-accept.c signature.h macros.h \ macros.h test-fgetc.c signature.h macros.h \ test-file-has-acl.sh test-file-has-acl-1.sh \ test-file-has-acl-2.sh test-file-has-acl.c macros.h \ - flexmember.h test-fpending.c test-fpending.sh macros.h \ - fpurge.c stdio-impl.h test-fpurge.c macros.h test-fputc.c \ - signature.h macros.h test-fread.c signature.h macros.h \ - freading.h stdio-impl.h test-freading.c macros.h fseek.c \ - test-fseek.c test-fseek.sh test-fseek2.sh signature.h macros.h \ - fseeko.c stdio-impl.h test-fseeko.c test-fseeko.sh \ - test-fseeko2.sh test-fseeko3.c test-fseeko3.sh test-fseeko4.c \ - test-fseeko4.sh signature.h macros.h test-fstat.c signature.h \ - macros.h ftell.c test-ftell.c test-ftell.sh test-ftell2.sh \ - test-ftell3.c signature.h macros.h ftello.c stdio-impl.h \ - test-ftello.c test-ftello.sh test-ftello2.sh test-ftello3.c \ - test-ftello4.c test-ftello4.sh signature.h macros.h \ - ftruncate.c test-ftruncate.c test-ftruncate.sh signature.h \ - macros.h test-fwrite.c signature.h macros.h test-fwriting.c \ - macros.h getcwd-lgpl.c test-getcwd-lgpl.c signature.h macros.h \ + test-fpending.c test-fpending.sh macros.h fpurge.c \ + stdio-impl.h test-fpurge.c macros.h test-fputc.c signature.h \ + macros.h test-fread.c signature.h macros.h freading.h \ + stdio-impl.h test-freading.c macros.h fseek.c test-fseek.c \ + test-fseek.sh test-fseek2.sh signature.h macros.h fseeko.c \ + stdio-impl.h test-fseeko.c test-fseeko.sh test-fseeko2.sh \ + test-fseeko3.c test-fseeko3.sh test-fseeko4.c test-fseeko4.sh \ + signature.h macros.h test-fstat.c signature.h macros.h ftell.c \ + test-ftell.c test-ftell.sh test-ftell2.sh test-ftell3.c \ + signature.h macros.h ftello.c stdio-impl.h test-ftello.c \ + test-ftello.sh test-ftello2.sh test-ftello3.c test-ftello4.c \ + test-ftello4.sh signature.h macros.h ftruncate.c \ + test-ftruncate.c test-ftruncate.sh signature.h macros.h \ + test-fwrite.c signature.h macros.h test-fwriting.c macros.h \ + getcwd-lgpl.c test-getcwd-lgpl.c signature.h macros.h \ test-getdelim.c signature.h macros.h getdtablesize.c \ test-getdtablesize.c signature.h macros.h macros.h signature.h \ test-getopt-gnu.c test-getopt-main.h test-getopt.h \ test-getopt_long.h macros.h signature.h test-getopt-posix.c \ test-getopt-main.h test-getopt.h getpagesize.c \ test-getprogname.c signature.h test-gettimeofday.c \ - test-ignore-value.c inet_pton.c test-inet_pton.c signature.h \ - macros.h test-intprops.c macros.h inttypes.in.h \ + test-hard-locale.c locale.c test-ignore-value.c inet_pton.c \ + test-inet_pton.c signature.h macros.h test-intprops.c macros.h \ test-inttypes.c ioctl.c w32sock.h test-ioctl.c signature.h \ macros.h test-isblank.c signature.h macros.h test-langinfo.c \ test-limits-h.c link.c test-link.h test-link.c signature.h \ @@ -2543,56 +2785,65 @@ EXTRA_DIST = accept.c w32sock.h test-accept.c signature.h macros.h \ test-mbrtowc3.sh test-mbrtowc4.sh test-mbrtowc5.sh \ test-mbrtowc.c test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh \ test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh \ - test-mbrtowc-w32-5.sh test-mbrtowc-w32.c signature.h macros.h \ + test-mbrtowc-w32-5.sh test-mbrtowc-w32-6.sh \ + test-mbrtowc-w32-7.sh test-mbrtowc-w32.c signature.h macros.h \ test-mbsinit.sh test-mbsinit.c signature.h macros.h \ test-memchr.c zerosize-ptr.h signature.h macros.h \ test-memrchr.c zerosize-ptr.h signature.h macros.h \ test-mkdir.h test-mkdir.c signature.h macros.h nanosleep.c \ test-nanosleep.c signature.h macros.h netinet_in.in.h \ test-netinet_in.c test-nl_langinfo.sh test-nl_langinfo.c \ - signature.h macros.h open.c test-open.h test-open.c \ - signature.h macros.h dirent-private.h opendir.c test-pathmax.c \ - perror.c macros.h signature.h test-perror.c test-perror2.c \ - test-perror.sh pipe.c test-pipe.c signature.h macros.h \ - putenv.c test-quotearg-simple.c test-quotearg.h macros.h \ - zerosize-ptr.h raise.c test-raise.c signature.h macros.h \ - read-file.h test-read-file.c dirent-private.h readdir.c \ - test-readlink.h test-readlink.c signature.h macros.h realloc.c \ - test-regex.c macros.h test-rename.h test-rename.c signature.h \ - macros.h test-rmdir.h test-rmdir.c signature.h macros.h \ - select.c macros.h signature.h test-select.c test-select.h \ - test-select-fd.c test-select-in.sh test-select-out.sh \ - test-select-stdin.c setenv.c test-setenv.c signature.h \ - macros.h setlocale.c test-setlocale1.sh test-setlocale1.c \ - test-setlocale2.sh test-setlocale2.c signature.h macros.h \ - setsockopt.c w32sock.h test-setsockopt.c signature.h macros.h \ - sig-handler.h sigaction.c test-sigaction.c signature.h \ - macros.h signal.in.h test-signal-h.c sigprocmask.c \ - test-sigprocmask.c signature.h macros.h sleep.c test-sleep.c \ - signature.h macros.h _Noreturn.h arg-nonnull.h c++defs.h \ - unused-parameter.h warn-on-use.h socket.c w32sock.h w32sock.h \ - test-sockets.c test-stat.h test-stat.c signature.h macros.h \ - test-stat-time.c macros.h nap.h test-stdalign.c macros.h \ - test-stdbool.c test-stddef.c test-stdint.c test-stdio.c \ - test-stdlib.c test-sys_wait.h strdup.c test-strerror.c \ - signature.h macros.h strerror_r.c test-strerror_r.c \ - signature.h macros.h test-string.c test-strverscmp.c \ - signature.h macros.h symlink.c test-symlink.h test-symlink.c \ - signature.h macros.h sys_ioctl.in.h test-sys_ioctl.c \ - sys_select.in.h test-sys_select.c signature.h sys_socket.in.h \ + test-nl_langinfo-mt.c signature.h macros.h open.c test-open.h \ + test-open.c signature.h macros.h dirent-private.h opendir.c \ + test-pathmax.c perror.c macros.h signature.h test-perror.c \ + test-perror2.c test-perror.sh pipe.c test-pipe.c signature.h \ + macros.h pthread.in.h test-pthread.c pthread-thread.c \ + test-pthread-thread.c macros.h pthread_sigmask.c \ + test-pthread_sigmask1.c test-pthread_sigmask2.c signature.h \ + macros.h putenv.c test-quotearg-simple.c test-quotearg.h \ + macros.h zerosize-ptr.h raise.c test-raise.c signature.h \ + macros.h read-file.h test-read-file.c dirent-private.h \ + readdir.c test-readlink.h test-readlink.c signature.h macros.h \ + realloc.c test-regex.c macros.h test-rename.h test-rename.c \ + signature.h macros.h test-rmdir.h test-rmdir.c signature.h \ + macros.h sched.in.h test-sched.c select.c macros.h signature.h \ + test-select.c test-select.h test-select-fd.c test-select-in.sh \ + test-select-out.sh test-select-stdin.c setenv.c test-setenv.c \ + signature.h macros.h setlocale.c test-setlocale_null.c \ + test-setlocale_null-mt-one.c test-setlocale_null-mt-all.c \ + test-setlocale1.sh test-setlocale1.c test-setlocale2.sh \ + test-setlocale2.c signature.h macros.h setsockopt.c w32sock.h \ + test-setsockopt.c signature.h macros.h sig-handler.h \ + sigaction.c test-sigaction.c signature.h macros.h signal.in.h \ + test-signal-h.c sigprocmask.c test-sigprocmask.c signature.h \ + macros.h sleep.c test-sleep.c signature.h macros.h _Noreturn.h \ + arg-nonnull.h c++defs.h unused-parameter.h warn-on-use.h \ + socket.c w32sock.h w32sock.h test-sockets.c test-stat.h \ + test-stat.c signature.h macros.h test-stat-time.c macros.h \ + nap.h test-stdalign.c macros.h test-stdbool.c test-stddef.c \ + test-stdint.c test-stdio.c test-stdlib.c test-sys_wait.h \ + strdup.c test-strerror.c signature.h macros.h strerror_r.c \ + test-strerror_r.c signature.h macros.h test-string.c \ + test-strverscmp.c signature.h macros.h symlink.c \ + test-symlink.h test-symlink.c signature.h macros.h \ + sys_ioctl.in.h test-sys_ioctl.c sys_select.in.h \ + test-sys_select.c signature.h sys_socket.in.h \ test-sys_socket.c test-sys_stat.c test-sys_time.c \ test-sys_types.c sys_uio.in.h test-sys_uio.c init.sh \ - test-init.sh test-time.c test-unistd.c unsetenv.c \ - test-unsetenv.c signature.h macros.h test-update-copyright.sh \ + test-init.sh test-thread_self.c test-thread_create.c macros.h \ + test-time.c test-unistd.c unsetenv.c test-unsetenv.c \ + signature.h macros.h test-update-copyright.sh \ test-vc-list-files-git.sh test-vc-list-files-cvs.sh \ test-verify.c test-verify-try.c test-verify.sh \ test-version-etc.c test-version-etc.sh test-wchar.c \ test-wcrtomb.sh test-wcrtomb.c test-wcrtomb-w32-1.sh \ test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh \ - test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh test-wcrtomb-w32.c \ - signature.h macros.h test-wctype-h.c macros.h \ - test-xalloc-die.c test-xalloc-die.sh -BUILT_SOURCES = arpa/inet.h dirent.h inttypes.h $(NETINET_IN_H) \ + test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh \ + test-wcrtomb-w32-6.sh test-wcrtomb-w32-7.sh test-wcrtomb-w32.c \ + signature.h macros.h test-wctype-h.c macros.h windows-thread.c \ + windows-thread.h windows-tls.c windows-tls.h test-xalloc-die.c \ + test-xalloc-die.sh +BUILT_SOURCES = arpa/inet.h dirent.h $(NETINET_IN_H) pthread.h sched.h \ signal.h sys/ioctl.h sys/select.h sys/socket.h sys/uio.h SUFFIXES = @@ -2602,10 +2853,10 @@ SUFFIXES = MOSTLYCLEANFILES = core *.stackdump arpa/inet.h arpa/inet.h-t dirent.h \ dirent.h-t test-fflush.txt test-fpending.t t-fpurge.tmp \ t-freading.tmp t-ftell3.tmp t-ftello3.tmp t-fwriting.tmp \ - test-getdelim.txt inttypes.h inttypes.h-t netinet/in.h \ - netinet/in.h-t signal.h signal.h-t sys/ioctl.h sys/ioctl.h-t \ - sys/select.h sys/select.h-t sys/socket.h sys/socket.h-t \ - sys/uio.h sys/uio.h-t .deps/test-verify-try.Tpo + test-getdelim.txt netinet/in.h netinet/in.h-t pthread.h \ + pthread.h-t sched.h sched.h-t signal.h signal.h-t sys/ioctl.h \ + sys/ioctl.h-t sys/select.h sys/select.h-t sys/socket.h \ + sys/socket.h-t sys/uio.h sys/uio.h-t .deps/test-verify-try.Tpo MOSTLYCLEANDIRS = arpa netinet sys sys sys sys CLEANFILES = DISTCLEANFILES = @@ -2619,7 +2870,8 @@ AM_CPPFLAGS = \ LDADD = libtests.a ../lib/libsed.a libtests.a $(LIBTESTS_LIBDEPS) libtests_a_SOURCES = cloexec.c fd-hook.c file-has-acl.c freading.c \ localename.c localename-table.c read-file.c sig-handler.c \ - sockets.h sockets.c sys_socket.c + sockets.h sockets.c sys_socket.c glthread/thread.h \ + glthread/thread.c libtests_a_LIBADD = $(gltests_LIBOBJS) libtests_a_DEPENDENCIES = $(gltests_LIBOBJS) EXTRA_libtests_a_SOURCES = accept.c bind.c close.c closedir.c \ @@ -2627,31 +2879,52 @@ EXTRA_libtests_a_SOURCES = accept.c bind.c close.c closedir.c \ fseek.c fseeko.c ftell.c ftello.c ftruncate.c getcwd-lgpl.c \ getdtablesize.c getpagesize.c inet_pton.c ioctl.c link.c \ listen.c lseek.c nanosleep.c open.c opendir.c perror.c pipe.c \ - putenv.c raise.c readdir.c realloc.c select.c setenv.c \ - setlocale.c setsockopt.c sigaction.c sigprocmask.c sleep.c \ - socket.c strdup.c strerror_r.c symlink.c unsetenv.c + pthread-thread.c pthread_sigmask.c putenv.c raise.c readdir.c \ + realloc.c select.c setenv.c setlocale.c setsockopt.c \ + sigaction.c sigprocmask.c sleep.c socket.c strdup.c \ + strerror_r.c symlink.c unsetenv.c windows-thread.c \ + windows-tls.c AM_LIBTOOLFLAGS = --preserve-dup-deps test_accept_LDADD = $(LDADD) @LIBSOCKET@ -test_set_mode_acl_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ -test_copy_acl_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ -test_sameacls_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ +test_set_mode_acl_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(LIB_MBRTOWC) +test_copy_acl_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(LIB_MBRTOWC) +test_sameacls_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(LIB_MBRTOWC) test_bind_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB) +test_btowc_LDADD = $(LDADD) $(LIB_SETLOCALE) +test_c_ctype_LDADD = $(LDADD) $(LIB_SETLOCALE) +test_c_strcasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) +test_c_strncasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) test_connect_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB) -dfa_match_aux_LDADD = $(LDADD) @LIBINTL@ +dfa_match_aux_LDADD = $(LDADD) $(LIB_SETLOCALE) @LIBINTL@ $(LIB_MBRTOWC) test_file_has_acl_LDADD = $(LDADD) $(LIB_HAS_ACL) test_getcwd_lgpl_LDADD = $(LDADD) $(LIBINTL) test_getopt_gnu_LDADD = $(LDADD) $(LIBINTL) test_getopt_posix_LDADD = $(LDADD) $(LIBINTL) test_getprogname_LDADD = $(LDADD) +test_hard_locale_LDADD = $(LDADD) $(LIB_SETLOCALE) @LIB_HARD_LOCALE@ +current_locale_SOURCES = locale.c test_inet_pton_LDADD = $(LDADD) @INET_PTON_LIB@ test_listen_LDADD = $(LDADD) @LIBSOCKET@ -test_localename_LDADD = $(LDADD) @INTL_MACOSX_LIBS@ $(LIBTHREAD) +test_localcharset_LDADD = $(LDADD) $(LIB_SETLOCALE) +test_localename_LDADD = $(LDADD) $(LIB_SETLOCALE) @INTL_MACOSX_LIBS@ $(LIBTHREAD) +test_mbrtowc_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC) +test_mbsinit_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC) test_nanosleep_LDADD = $(LDADD) $(LIB_NANOSLEEP) -test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@ -test_regex_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD) $(LIB_PTHREAD) +test_nl_langinfo_LDADD = $(LDADD) $(LIB_SETLOCALE) +test_nl_langinfo_mt_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBMULTITHREAD) $(LIB_NANOSLEEP) +test_pthread_thread_LDADD = $(LDADD) @LIBPMULTITHREAD@ +test_pthread_sigmask1_LDADD = $(LDADD) @LIB_PTHREAD_SIGMASK@ +test_pthread_sigmask2_LDADD = $(LDADD) @LIB_PTHREAD_SIGMASK@ @LIBMULTITHREAD@ +test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC) +test_regex_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC) @LIBINTL@ $(LIBTHREAD) test_select_LDADD = $(LDADD) @LIB_SELECT@ @LIBSOCKET@ $(INET_PTON_LIB) test_select_fd_LDADD = $(LDADD) @LIB_SELECT@ test_select_stdin_LDADD = $(LDADD) @LIB_SELECT@ +test_setlocale_null_LDADD = $(LDADD) @LIB_SETLOCALE_NULL@ +test_setlocale_null_mt_one_LDADD = $(LDADD) @LIB_SETLOCALE_NULL@ $(LIBMULTITHREAD) $(LIB_NANOSLEEP) +test_setlocale_null_mt_all_LDADD = $(LDADD) @LIB_SETLOCALE_NULL@ $(LIBMULTITHREAD) $(LIB_NANOSLEEP) +test_setlocale1_LDADD = $(LDADD) @LIB_SETLOCALE@ +test_setlocale2_LDADD = $(LDADD) @LIB_SETLOCALE@ test_setsockopt_LDADD = $(LDADD) @LIBSOCKET@ # Because this Makefile snippet defines a variable used by other @@ -2681,7 +2954,10 @@ WARN_ON_USE_H = $(srcdir)/warn-on-use.h test_sockets_LDADD = $(LDADD) @LIBSOCKET@ test_stat_LDADD = $(LDADD) $(LIBINTL) test_stat_time_LDADD = $(LDADD) $(LIB_NANOSLEEP) +test_thread_self_LDADD = $(LDADD) @LIBTHREAD@ +test_thread_create_LDADD = $(LDADD) @LIBMULTITHREAD@ test_version_etc_LDADD = $(LDADD) @LIBINTL@ +test_wcrtomb_LDADD = $(LDADD) $(LIB_SETLOCALE) test_xalloc_die_LDADD = $(LDADD) @LIBINTL@ all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -2730,12 +3006,24 @@ clean-checkLIBRARIES: clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +glthread/$(am__dirstamp): + @$(MKDIR_P) glthread + @: > glthread/$(am__dirstamp) +glthread/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) glthread/$(DEPDIR) + @: > glthread/$(DEPDIR)/$(am__dirstamp) +glthread/thread.$(OBJEXT): glthread/$(am__dirstamp) \ + glthread/$(DEPDIR)/$(am__dirstamp) libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) $(EXTRA_libtests_a_DEPENDENCIES) $(AM_V_at)-rm -f libtests.a $(AM_V_AR)$(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD) $(AM_V_at)$(RANLIB) libtests.a +current-locale$(EXEEXT): $(current_locale_OBJECTS) $(current_locale_DEPENDENCIES) $(EXTRA_current_locale_DEPENDENCIES) + @rm -f current-locale$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(current_locale_OBJECTS) $(current_locale_LDADD) $(LIBS) + dfa-match-aux$(EXEEXT): $(dfa_match_aux_OBJECTS) $(dfa_match_aux_DEPENDENCIES) $(EXTRA_dfa_match_aux_DEPENDENCIES) @rm -f dfa-match-aux$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dfa_match_aux_OBJECTS) $(dfa_match_aux_LDADD) $(LIBS) @@ -2952,6 +3240,10 @@ test-gettimeofday$(EXEEXT): $(test_gettimeofday_OBJECTS) $(test_gettimeofday_DEP @rm -f test-gettimeofday$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_gettimeofday_OBJECTS) $(test_gettimeofday_LDADD) $(LIBS) +test-hard-locale$(EXEEXT): $(test_hard_locale_OBJECTS) $(test_hard_locale_DEPENDENCIES) $(EXTRA_test_hard_locale_DEPENDENCIES) + @rm -f test-hard-locale$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_hard_locale_OBJECTS) $(test_hard_locale_LDADD) $(LIBS) + test-ignore-value$(EXEEXT): $(test_ignore_value_OBJECTS) $(test_ignore_value_DEPENDENCIES) $(EXTRA_test_ignore_value_DEPENDENCIES) @rm -f test-ignore-value$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_ignore_value_OBJECTS) $(test_ignore_value_LDADD) $(LIBS) @@ -3056,6 +3348,10 @@ test-nl_langinfo$(EXEEXT): $(test_nl_langinfo_OBJECTS) $(test_nl_langinfo_DEPEND @rm -f test-nl_langinfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_nl_langinfo_OBJECTS) $(test_nl_langinfo_LDADD) $(LIBS) +test-nl_langinfo-mt$(EXEEXT): $(test_nl_langinfo_mt_OBJECTS) $(test_nl_langinfo_mt_DEPENDENCIES) $(EXTRA_test_nl_langinfo_mt_DEPENDENCIES) + @rm -f test-nl_langinfo-mt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_nl_langinfo_mt_OBJECTS) $(test_nl_langinfo_mt_LDADD) $(LIBS) + test-open$(EXEEXT): $(test_open_OBJECTS) $(test_open_DEPENDENCIES) $(EXTRA_test_open_DEPENDENCIES) @rm -f test-open$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_open_OBJECTS) $(test_open_LDADD) $(LIBS) @@ -3076,6 +3372,22 @@ test-pipe$(EXEEXT): $(test_pipe_OBJECTS) $(test_pipe_DEPENDENCIES) $(EXTRA_test_ @rm -f test-pipe$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_pipe_OBJECTS) $(test_pipe_LDADD) $(LIBS) +test-pthread$(EXEEXT): $(test_pthread_OBJECTS) $(test_pthread_DEPENDENCIES) $(EXTRA_test_pthread_DEPENDENCIES) + @rm -f test-pthread$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_pthread_OBJECTS) $(test_pthread_LDADD) $(LIBS) + +test-pthread-thread$(EXEEXT): $(test_pthread_thread_OBJECTS) $(test_pthread_thread_DEPENDENCIES) $(EXTRA_test_pthread_thread_DEPENDENCIES) + @rm -f test-pthread-thread$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_pthread_thread_OBJECTS) $(test_pthread_thread_LDADD) $(LIBS) + +test-pthread_sigmask1$(EXEEXT): $(test_pthread_sigmask1_OBJECTS) $(test_pthread_sigmask1_DEPENDENCIES) $(EXTRA_test_pthread_sigmask1_DEPENDENCIES) + @rm -f test-pthread_sigmask1$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_pthread_sigmask1_OBJECTS) $(test_pthread_sigmask1_LDADD) $(LIBS) + +test-pthread_sigmask2$(EXEEXT): $(test_pthread_sigmask2_OBJECTS) $(test_pthread_sigmask2_DEPENDENCIES) $(EXTRA_test_pthread_sigmask2_DEPENDENCIES) + @rm -f test-pthread_sigmask2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_pthread_sigmask2_OBJECTS) $(test_pthread_sigmask2_LDADD) $(LIBS) + test-quotearg-simple$(EXEEXT): $(test_quotearg_simple_OBJECTS) $(test_quotearg_simple_DEPENDENCIES) $(EXTRA_test_quotearg_simple_DEPENDENCIES) @rm -f test-quotearg-simple$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_quotearg_simple_OBJECTS) $(test_quotearg_simple_LDADD) $(LIBS) @@ -3108,6 +3420,10 @@ test-sameacls$(EXEEXT): $(test_sameacls_OBJECTS) $(test_sameacls_DEPENDENCIES) $ @rm -f test-sameacls$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_sameacls_OBJECTS) $(test_sameacls_LDADD) $(LIBS) +test-sched$(EXEEXT): $(test_sched_OBJECTS) $(test_sched_DEPENDENCIES) $(EXTRA_test_sched_DEPENDENCIES) + @rm -f test-sched$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sched_OBJECTS) $(test_sched_LDADD) $(LIBS) + test-select$(EXEEXT): $(test_select_OBJECTS) $(test_select_DEPENDENCIES) $(EXTRA_test_select_DEPENDENCIES) @rm -f test-select$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_select_OBJECTS) $(test_select_LDADD) $(LIBS) @@ -3136,6 +3452,18 @@ test-setlocale2$(EXEEXT): $(test_setlocale2_OBJECTS) $(test_setlocale2_DEPENDENC @rm -f test-setlocale2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_setlocale2_OBJECTS) $(test_setlocale2_LDADD) $(LIBS) +test-setlocale_null$(EXEEXT): $(test_setlocale_null_OBJECTS) $(test_setlocale_null_DEPENDENCIES) $(EXTRA_test_setlocale_null_DEPENDENCIES) + @rm -f test-setlocale_null$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_setlocale_null_OBJECTS) $(test_setlocale_null_LDADD) $(LIBS) + +test-setlocale_null-mt-all$(EXEEXT): $(test_setlocale_null_mt_all_OBJECTS) $(test_setlocale_null_mt_all_DEPENDENCIES) $(EXTRA_test_setlocale_null_mt_all_DEPENDENCIES) + @rm -f test-setlocale_null-mt-all$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_setlocale_null_mt_all_OBJECTS) $(test_setlocale_null_mt_all_LDADD) $(LIBS) + +test-setlocale_null-mt-one$(EXEEXT): $(test_setlocale_null_mt_one_OBJECTS) $(test_setlocale_null_mt_one_DEPENDENCIES) $(EXTRA_test_setlocale_null_mt_one_DEPENDENCIES) + @rm -f test-setlocale_null-mt-one$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_setlocale_null_mt_one_OBJECTS) $(test_setlocale_null_mt_one_LDADD) $(LIBS) + test-setsockopt$(EXEEXT): $(test_setsockopt_OBJECTS) $(test_setsockopt_DEPENDENCIES) $(EXTRA_test_setsockopt_DEPENDENCIES) @rm -f test-setsockopt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_setsockopt_OBJECTS) $(test_setsockopt_LDADD) $(LIBS) @@ -3240,6 +3568,14 @@ test-sys_uio$(EXEEXT): $(test_sys_uio_OBJECTS) $(test_sys_uio_DEPENDENCIES) $(EX @rm -f test-sys_uio$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_sys_uio_OBJECTS) $(test_sys_uio_LDADD) $(LIBS) +test-thread_create$(EXEEXT): $(test_thread_create_OBJECTS) $(test_thread_create_DEPENDENCIES) $(EXTRA_test_thread_create_DEPENDENCIES) + @rm -f test-thread_create$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_thread_create_OBJECTS) $(test_thread_create_LDADD) $(LIBS) + +test-thread_self$(EXEEXT): $(test_thread_self_OBJECTS) $(test_thread_self_DEPENDENCIES) $(EXTRA_test_thread_self_DEPENDENCIES) + @rm -f test-thread_self$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_thread_self_OBJECTS) $(test_thread_self_LDADD) $(LIBS) + test-time$(EXEEXT): $(test_time_OBJECTS) $(test_time_DEPENDENCIES) $(EXTRA_test_time_DEPENDENCIES) @rm -f test-time$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_time_OBJECTS) $(test_time_LDADD) $(LIBS) @@ -3286,6 +3622,7 @@ test-xalloc-die$(EXEEXT): $(test_xalloc_die_OBJECTS) $(test_xalloc_die_DEPENDENC mostlyclean-compile: -rm -f *.$(OBJEXT) + -rm -f glthread/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -3318,6 +3655,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locale.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localename-table.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ # am--include-marker @@ -3326,6 +3664,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opendir.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perror.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread-thread.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_sigmask.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/putenv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raise.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read-file.Po@am__quote@ # am--include-marker @@ -3398,6 +3738,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getopt-posix.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getprogname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-gettimeofday.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-hard-locale.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ignore-value.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inet_pton.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-intprops.Po@am__quote@ # am--include-marker @@ -3423,12 +3764,17 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mkdir.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nanosleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-netinet_in.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nl_langinfo-mt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nl_langinfo.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-open.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pathmax.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-perror.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-perror2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pipe.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pthread-thread.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pthread.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pthread_sigmask1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pthread_sigmask2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-quotearg-simple.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-raise.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-read-file.Po@am__quote@ # am--include-marker @@ -3437,6 +3783,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rmdir.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sameacls.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sched.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-select-fd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-select-stdin.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-select.Po@am__quote@ # am--include-marker @@ -3444,6 +3791,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setenv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale_null-mt-all.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale_null-mt-one.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale_null.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setsockopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigaction.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-signal-h.Po@am__quote@ # am--include-marker @@ -3470,6 +3820,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_time.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_types.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_uio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-thread_create.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-thread_self.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-time.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unistd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unsetenv.Po@am__quote@ # am--include-marker @@ -3482,6 +3834,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wctype-h.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xalloc-die.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unsetenv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-thread.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-tls.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/thread.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @@ -4207,6 +4562,13 @@ test-gettimeofday.log: test-gettimeofday$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-hard-locale.log: test-hard-locale$(EXEEXT) + @p='test-hard-locale$(EXEEXT)'; \ + b='test-hard-locale'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-ignore-value.log: test-ignore-value$(EXEEXT) @p='test-ignore-value$(EXEEXT)'; \ b='test-ignore-value'; \ @@ -4389,6 +4751,20 @@ test-mbrtowc-w32-5.sh.log: test-mbrtowc-w32-5.sh --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbrtowc-w32-6.sh.log: test-mbrtowc-w32-6.sh + @p='test-mbrtowc-w32-6.sh'; \ + b='test-mbrtowc-w32-6.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mbrtowc-w32-7.sh.log: test-mbrtowc-w32-7.sh + @p='test-mbrtowc-w32-7.sh'; \ + b='test-mbrtowc-w32-7.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-mbsinit.sh.log: test-mbsinit.sh @p='test-mbsinit.sh'; \ b='test-mbsinit.sh'; \ @@ -4438,6 +4814,13 @@ test-nl_langinfo.sh.log: test-nl_langinfo.sh --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-nl_langinfo-mt.log: test-nl_langinfo-mt$(EXEEXT) + @p='test-nl_langinfo-mt$(EXEEXT)'; \ + b='test-nl_langinfo-mt'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-open.log: test-open$(EXEEXT) @p='test-open$(EXEEXT)'; \ b='test-open'; \ @@ -4473,6 +4856,34 @@ test-pipe.log: test-pipe$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-pthread.log: test-pthread$(EXEEXT) + @p='test-pthread$(EXEEXT)'; \ + b='test-pthread'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-pthread-thread.log: test-pthread-thread$(EXEEXT) + @p='test-pthread-thread$(EXEEXT)'; \ + b='test-pthread-thread'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-pthread_sigmask1.log: test-pthread_sigmask1$(EXEEXT) + @p='test-pthread_sigmask1$(EXEEXT)'; \ + b='test-pthread_sigmask1'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-pthread_sigmask2.log: test-pthread_sigmask2$(EXEEXT) + @p='test-pthread_sigmask2$(EXEEXT)'; \ + b='test-pthread_sigmask2'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-quotearg-simple.log: test-quotearg-simple$(EXEEXT) @p='test-quotearg-simple$(EXEEXT)'; \ b='test-quotearg-simple'; \ @@ -4522,6 +4933,13 @@ test-rmdir.log: test-rmdir$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sched.log: test-sched$(EXEEXT) + @p='test-sched$(EXEEXT)'; \ + b='test-sched'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-select.log: test-select$(EXEEXT) @p='test-select$(EXEEXT)'; \ b='test-select'; \ @@ -4550,6 +4968,27 @@ test-setenv.log: test-setenv$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-setlocale_null.log: test-setlocale_null$(EXEEXT) + @p='test-setlocale_null$(EXEEXT)'; \ + b='test-setlocale_null'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-setlocale_null-mt-one.log: test-setlocale_null-mt-one$(EXEEXT) + @p='test-setlocale_null-mt-one$(EXEEXT)'; \ + b='test-setlocale_null-mt-one'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-setlocale_null-mt-all.log: test-setlocale_null-mt-all$(EXEEXT) + @p='test-setlocale_null-mt-all$(EXEEXT)'; \ + b='test-setlocale_null-mt-all'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-setlocale1.sh.log: test-setlocale1.sh @p='test-setlocale1.sh'; \ b='test-setlocale1.sh'; \ @@ -4753,6 +5192,20 @@ test-init.sh.log: test-init.sh --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-thread_self.log: test-thread_self$(EXEEXT) + @p='test-thread_self$(EXEEXT)'; \ + b='test-thread_self'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-thread_create.log: test-thread_create$(EXEEXT) + @p='test-thread_create$(EXEEXT)'; \ + b='test-thread_create'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-time.log: test-time$(EXEEXT) @p='test-time$(EXEEXT)'; \ b='test-time'; \ @@ -4865,6 +5318,20 @@ test-wcrtomb-w32-5.sh.log: test-wcrtomb-w32-5.sh --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-wcrtomb-w32-6.sh.log: test-wcrtomb-w32-6.sh + @p='test-wcrtomb-w32-6.sh'; \ + b='test-wcrtomb-w32-6.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-wcrtomb-w32-7.sh.log: test-wcrtomb-w32-7.sh + @p='test-wcrtomb-w32-7.sh'; \ + b='test-wcrtomb-w32-7.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-wctype-h.log: test-wctype-h$(EXEEXT) @p='test-wctype-h$(EXEEXT)'; \ b='test-wctype-h'; \ @@ -4992,6 +5459,8 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f glthread/$(DEPDIR)/$(am__dirstamp) + -rm -f glthread/$(am__dirstamp) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @@ -5034,6 +5503,7 @@ distclean: distclean-recursive -rm -f ./$(DEPDIR)/ioctl.Po -rm -f ./$(DEPDIR)/link.Po -rm -f ./$(DEPDIR)/listen.Po + -rm -f ./$(DEPDIR)/locale.Po -rm -f ./$(DEPDIR)/localename-table.Po -rm -f ./$(DEPDIR)/localename.Po -rm -f ./$(DEPDIR)/lseek.Po @@ -5042,6 +5512,8 @@ distclean: distclean-recursive -rm -f ./$(DEPDIR)/opendir.Po -rm -f ./$(DEPDIR)/perror.Po -rm -f ./$(DEPDIR)/pipe.Po + -rm -f ./$(DEPDIR)/pthread-thread.Po + -rm -f ./$(DEPDIR)/pthread_sigmask.Po -rm -f ./$(DEPDIR)/putenv.Po -rm -f ./$(DEPDIR)/raise.Po -rm -f ./$(DEPDIR)/read-file.Po @@ -5114,6 +5586,7 @@ distclean: distclean-recursive -rm -f ./$(DEPDIR)/test-getopt-posix.Po -rm -f ./$(DEPDIR)/test-getprogname.Po -rm -f ./$(DEPDIR)/test-gettimeofday.Po + -rm -f ./$(DEPDIR)/test-hard-locale.Po -rm -f ./$(DEPDIR)/test-ignore-value.Po -rm -f ./$(DEPDIR)/test-inet_pton.Po -rm -f ./$(DEPDIR)/test-intprops.Po @@ -5139,12 +5612,17 @@ distclean: distclean-recursive -rm -f ./$(DEPDIR)/test-mkdir.Po -rm -f ./$(DEPDIR)/test-nanosleep.Po -rm -f ./$(DEPDIR)/test-netinet_in.Po + -rm -f ./$(DEPDIR)/test-nl_langinfo-mt.Po -rm -f ./$(DEPDIR)/test-nl_langinfo.Po -rm -f ./$(DEPDIR)/test-open.Po -rm -f ./$(DEPDIR)/test-pathmax.Po -rm -f ./$(DEPDIR)/test-perror.Po -rm -f ./$(DEPDIR)/test-perror2.Po -rm -f ./$(DEPDIR)/test-pipe.Po + -rm -f ./$(DEPDIR)/test-pthread-thread.Po + -rm -f ./$(DEPDIR)/test-pthread.Po + -rm -f ./$(DEPDIR)/test-pthread_sigmask1.Po + -rm -f ./$(DEPDIR)/test-pthread_sigmask2.Po -rm -f ./$(DEPDIR)/test-quotearg-simple.Po -rm -f ./$(DEPDIR)/test-raise.Po -rm -f ./$(DEPDIR)/test-read-file.Po @@ -5153,6 +5631,7 @@ distclean: distclean-recursive -rm -f ./$(DEPDIR)/test-rename.Po -rm -f ./$(DEPDIR)/test-rmdir.Po -rm -f ./$(DEPDIR)/test-sameacls.Po + -rm -f ./$(DEPDIR)/test-sched.Po -rm -f ./$(DEPDIR)/test-select-fd.Po -rm -f ./$(DEPDIR)/test-select-stdin.Po -rm -f ./$(DEPDIR)/test-select.Po @@ -5160,6 +5639,9 @@ distclean: distclean-recursive -rm -f ./$(DEPDIR)/test-setenv.Po -rm -f ./$(DEPDIR)/test-setlocale1.Po -rm -f ./$(DEPDIR)/test-setlocale2.Po + -rm -f ./$(DEPDIR)/test-setlocale_null-mt-all.Po + -rm -f ./$(DEPDIR)/test-setlocale_null-mt-one.Po + -rm -f ./$(DEPDIR)/test-setlocale_null.Po -rm -f ./$(DEPDIR)/test-setsockopt.Po -rm -f ./$(DEPDIR)/test-sigaction.Po -rm -f ./$(DEPDIR)/test-signal-h.Po @@ -5186,6 +5668,8 @@ distclean: distclean-recursive -rm -f ./$(DEPDIR)/test-sys_time.Po -rm -f ./$(DEPDIR)/test-sys_types.Po -rm -f ./$(DEPDIR)/test-sys_uio.Po + -rm -f ./$(DEPDIR)/test-thread_create.Po + -rm -f ./$(DEPDIR)/test-thread_self.Po -rm -f ./$(DEPDIR)/test-time.Po -rm -f ./$(DEPDIR)/test-unistd.Po -rm -f ./$(DEPDIR)/test-unsetenv.Po @@ -5198,6 +5682,9 @@ distclean: distclean-recursive -rm -f ./$(DEPDIR)/test-wctype-h.Po -rm -f ./$(DEPDIR)/test-xalloc-die.Po -rm -f ./$(DEPDIR)/unsetenv.Po + -rm -f ./$(DEPDIR)/windows-thread.Po + -rm -f ./$(DEPDIR)/windows-tls.Po + -rm -f glthread/$(DEPDIR)/thread.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -5271,6 +5758,7 @@ maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/ioctl.Po -rm -f ./$(DEPDIR)/link.Po -rm -f ./$(DEPDIR)/listen.Po + -rm -f ./$(DEPDIR)/locale.Po -rm -f ./$(DEPDIR)/localename-table.Po -rm -f ./$(DEPDIR)/localename.Po -rm -f ./$(DEPDIR)/lseek.Po @@ -5279,6 +5767,8 @@ maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/opendir.Po -rm -f ./$(DEPDIR)/perror.Po -rm -f ./$(DEPDIR)/pipe.Po + -rm -f ./$(DEPDIR)/pthread-thread.Po + -rm -f ./$(DEPDIR)/pthread_sigmask.Po -rm -f ./$(DEPDIR)/putenv.Po -rm -f ./$(DEPDIR)/raise.Po -rm -f ./$(DEPDIR)/read-file.Po @@ -5351,6 +5841,7 @@ maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/test-getopt-posix.Po -rm -f ./$(DEPDIR)/test-getprogname.Po -rm -f ./$(DEPDIR)/test-gettimeofday.Po + -rm -f ./$(DEPDIR)/test-hard-locale.Po -rm -f ./$(DEPDIR)/test-ignore-value.Po -rm -f ./$(DEPDIR)/test-inet_pton.Po -rm -f ./$(DEPDIR)/test-intprops.Po @@ -5376,12 +5867,17 @@ maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/test-mkdir.Po -rm -f ./$(DEPDIR)/test-nanosleep.Po -rm -f ./$(DEPDIR)/test-netinet_in.Po + -rm -f ./$(DEPDIR)/test-nl_langinfo-mt.Po -rm -f ./$(DEPDIR)/test-nl_langinfo.Po -rm -f ./$(DEPDIR)/test-open.Po -rm -f ./$(DEPDIR)/test-pathmax.Po -rm -f ./$(DEPDIR)/test-perror.Po -rm -f ./$(DEPDIR)/test-perror2.Po -rm -f ./$(DEPDIR)/test-pipe.Po + -rm -f ./$(DEPDIR)/test-pthread-thread.Po + -rm -f ./$(DEPDIR)/test-pthread.Po + -rm -f ./$(DEPDIR)/test-pthread_sigmask1.Po + -rm -f ./$(DEPDIR)/test-pthread_sigmask2.Po -rm -f ./$(DEPDIR)/test-quotearg-simple.Po -rm -f ./$(DEPDIR)/test-raise.Po -rm -f ./$(DEPDIR)/test-read-file.Po @@ -5390,6 +5886,7 @@ maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/test-rename.Po -rm -f ./$(DEPDIR)/test-rmdir.Po -rm -f ./$(DEPDIR)/test-sameacls.Po + -rm -f ./$(DEPDIR)/test-sched.Po -rm -f ./$(DEPDIR)/test-select-fd.Po -rm -f ./$(DEPDIR)/test-select-stdin.Po -rm -f ./$(DEPDIR)/test-select.Po @@ -5397,6 +5894,9 @@ maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/test-setenv.Po -rm -f ./$(DEPDIR)/test-setlocale1.Po -rm -f ./$(DEPDIR)/test-setlocale2.Po + -rm -f ./$(DEPDIR)/test-setlocale_null-mt-all.Po + -rm -f ./$(DEPDIR)/test-setlocale_null-mt-one.Po + -rm -f ./$(DEPDIR)/test-setlocale_null.Po -rm -f ./$(DEPDIR)/test-setsockopt.Po -rm -f ./$(DEPDIR)/test-sigaction.Po -rm -f ./$(DEPDIR)/test-signal-h.Po @@ -5423,6 +5923,8 @@ maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/test-sys_time.Po -rm -f ./$(DEPDIR)/test-sys_types.Po -rm -f ./$(DEPDIR)/test-sys_uio.Po + -rm -f ./$(DEPDIR)/test-thread_create.Po + -rm -f ./$(DEPDIR)/test-thread_self.Po -rm -f ./$(DEPDIR)/test-time.Po -rm -f ./$(DEPDIR)/test-unistd.Po -rm -f ./$(DEPDIR)/test-unsetenv.Po @@ -5435,6 +5937,9 @@ maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/test-wctype-h.Po -rm -f ./$(DEPDIR)/test-xalloc-die.Po -rm -f ./$(DEPDIR)/unsetenv.Po + -rm -f ./$(DEPDIR)/windows-thread.Po + -rm -f ./$(DEPDIR)/windows-tls.Po + -rm -f glthread/$(DEPDIR)/thread.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -5490,6 +5995,7 @@ arpa/inet.h: arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \ -e 's/@''GNULIB_INET_NTOP''@/$(GNULIB_INET_NTOP)/g' \ -e 's/@''GNULIB_INET_PTON''@/$(GNULIB_INET_PTON)/g' \ + -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \ -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \ -e 's|@''REPLACE_INET_NTOP''@|$(REPLACE_INET_NTOP)|g' \ @@ -5540,43 +6046,6 @@ dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H } > $@-t && \ mv $@-t $@ -# We need the following in order to create <inttypes.h> when the system -# doesn't have one that works with the given compiler. -inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) - $(AM_V_GEN)rm -f $@-t $@ && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ - -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ - -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ - -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ - -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ - -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ - -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ - -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ - -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ - -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ - -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ - -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ - -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \ - -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \ - -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \ - -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ - -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ - -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ - -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \ - -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \ - -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \ - -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ - -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \ - -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ - -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \ - -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ - -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ - -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ - < $(srcdir)/inttypes.in.h; \ - } > $@-t && \ - mv $@-t $@ - # We need the following in order to create <netinet/in.h> when the system # doesn't have one. @GL_GENERATE_NETINET_IN_H_TRUE@netinet/in.h: netinet_in.in.h $(top_builddir)/config.status @@ -5595,6 +6064,163 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U @GL_GENERATE_NETINET_IN_H_FALSE@netinet/in.h: $(top_builddir)/config.status @GL_GENERATE_NETINET_IN_H_FALSE@ rm -f $@ +# We need the following in order to create <pthread.h> when the system +# doesn't have one that works with the given compiler. +pthread.h: pthread.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_PTHREAD_H''@|$(HAVE_PTHREAD_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_PTHREAD_H''@|$(NEXT_PTHREAD_H)|g' \ + -e 's/@''GNULIB_PTHREAD_THREAD''@/$(GNULIB_PTHREAD_THREAD)/g' \ + -e 's/@''GNULIB_PTHREAD_ONCE''@/$(GNULIB_PTHREAD_ONCE)/g' \ + -e 's/@''GNULIB_PTHREAD_MUTEX''@/$(GNULIB_PTHREAD_MUTEX)/g' \ + -e 's/@''GNULIB_PTHREAD_RWLOCK''@/$(GNULIB_PTHREAD_RWLOCK)/g' \ + -e 's/@''GNULIB_PTHREAD_COND''@/$(GNULIB_PTHREAD_COND)/g' \ + -e 's/@''GNULIB_PTHREAD_TSS''@/$(GNULIB_PTHREAD_TSS)/g' \ + -e 's/@''GNULIB_PTHREAD_SPIN''@/$(GNULIB_PTHREAD_SPIN)/g' \ + -e 's/@''GNULIB_PTHREAD_MUTEX_TIMEDLOCK''@/$(GNULIB_PTHREAD_MUTEX_TIMEDLOCK)/g' \ + -e 's|@''HAVE_PTHREAD_T''@|$(HAVE_PTHREAD_T)|g' \ + -e 's|@''HAVE_PTHREAD_SPINLOCK_T''@|$(HAVE_PTHREAD_SPINLOCK_T)|g' \ + -e 's|@''HAVE_PTHREAD_CREATE_DETACHED''@|$(HAVE_PTHREAD_CREATE_DETACHED)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_RECURSIVE''@|$(HAVE_PTHREAD_MUTEX_RECURSIVE)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_ROBUST''@|$(HAVE_PTHREAD_MUTEX_ROBUST)|g' \ + -e 's|@''HAVE_PTHREAD_PROCESS_SHARED''@|$(HAVE_PTHREAD_PROCESS_SHARED)|g' \ + -e 's|@''HAVE_PTHREAD_CREATE''@|$(HAVE_PTHREAD_CREATE)|g' \ + -e 's|@''HAVE_PTHREAD_ATTR_INIT''@|$(HAVE_PTHREAD_ATTR_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_ATTR_GETDETACHSTATE''@|$(HAVE_PTHREAD_ATTR_GETDETACHSTATE)|g' \ + -e 's|@''HAVE_PTHREAD_ATTR_SETDETACHSTATE''@|$(HAVE_PTHREAD_ATTR_SETDETACHSTATE)|g' \ + -e 's|@''HAVE_PTHREAD_ATTR_DESTROY''@|$(HAVE_PTHREAD_ATTR_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_SELF''@|$(HAVE_PTHREAD_SELF)|g' \ + -e 's|@''HAVE_PTHREAD_EQUAL''@|$(HAVE_PTHREAD_EQUAL)|g' \ + -e 's|@''HAVE_PTHREAD_DETACH''@|$(HAVE_PTHREAD_DETACH)|g' \ + -e 's|@''HAVE_PTHREAD_JOIN''@|$(HAVE_PTHREAD_JOIN)|g' \ + -e 's|@''HAVE_PTHREAD_EXIT''@|$(HAVE_PTHREAD_EXIT)|g' \ + -e 's|@''HAVE_PTHREAD_ONCE''@|$(HAVE_PTHREAD_ONCE)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_INIT''@|$(HAVE_PTHREAD_MUTEX_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_INIT''@|$(HAVE_PTHREAD_MUTEXATTR_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_GETTYPE''@|$(HAVE_PTHREAD_MUTEXATTR_GETTYPE)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_SETTYPE''@|$(HAVE_PTHREAD_MUTEXATTR_SETTYPE)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_GETROBUST''@|$(HAVE_PTHREAD_MUTEXATTR_GETROBUST)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_SETROBUST''@|$(HAVE_PTHREAD_MUTEXATTR_SETROBUST)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_DESTROY''@|$(HAVE_PTHREAD_MUTEXATTR_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_LOCK''@|$(HAVE_PTHREAD_MUTEX_LOCK)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_TRYLOCK''@|$(HAVE_PTHREAD_MUTEX_TRYLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_TIMEDLOCK''@|$(HAVE_PTHREAD_MUTEX_TIMEDLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_UNLOCK''@|$(HAVE_PTHREAD_MUTEX_UNLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_DESTROY''@|$(HAVE_PTHREAD_MUTEX_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_INIT''@|$(HAVE_PTHREAD_RWLOCK_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCKATTR_INIT''@|$(HAVE_PTHREAD_RWLOCKATTR_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCKATTR_DESTROY''@|$(HAVE_PTHREAD_RWLOCKATTR_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_RDLOCK''@|$(HAVE_PTHREAD_RWLOCK_RDLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_WRLOCK''@|$(HAVE_PTHREAD_RWLOCK_WRLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_TRYRDLOCK''@|$(HAVE_PTHREAD_RWLOCK_TRYRDLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_TRYWRLOCK''@|$(HAVE_PTHREAD_RWLOCK_TRYWRLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK''@|$(HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK''@|$(HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_UNLOCK''@|$(HAVE_PTHREAD_RWLOCK_UNLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_DESTROY''@|$(HAVE_PTHREAD_RWLOCK_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_COND_INIT''@|$(HAVE_PTHREAD_COND_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_CONDATTR_INIT''@|$(HAVE_PTHREAD_CONDATTR_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_CONDATTR_DESTROY''@|$(HAVE_PTHREAD_CONDATTR_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_COND_WAIT''@|$(HAVE_PTHREAD_COND_WAIT)|g' \ + -e 's|@''HAVE_PTHREAD_COND_TIMEDWAIT''@|$(HAVE_PTHREAD_COND_TIMEDWAIT)|g' \ + -e 's|@''HAVE_PTHREAD_COND_SIGNAL''@|$(HAVE_PTHREAD_COND_SIGNAL)|g' \ + -e 's|@''HAVE_PTHREAD_COND_BROADCAST''@|$(HAVE_PTHREAD_COND_BROADCAST)|g' \ + -e 's|@''HAVE_PTHREAD_COND_DESTROY''@|$(HAVE_PTHREAD_COND_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_KEY_CREATE''@|$(HAVE_PTHREAD_KEY_CREATE)|g' \ + -e 's|@''HAVE_PTHREAD_SETSPECIFIC''@|$(HAVE_PTHREAD_SETSPECIFIC)|g' \ + -e 's|@''HAVE_PTHREAD_GETSPECIFIC''@|$(HAVE_PTHREAD_GETSPECIFIC)|g' \ + -e 's|@''HAVE_PTHREAD_KEY_DELETE''@|$(HAVE_PTHREAD_KEY_DELETE)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_INIT''@|$(HAVE_PTHREAD_SPIN_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_LOCK''@|$(HAVE_PTHREAD_SPIN_LOCK)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_TRYLOCK''@|$(HAVE_PTHREAD_SPIN_TRYLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_UNLOCK''@|$(HAVE_PTHREAD_SPIN_UNLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_DESTROY''@|$(HAVE_PTHREAD_SPIN_DESTROY)|g' \ + < $(srcdir)/pthread.in.h | \ + sed -e 's|@''REPLACE_PTHREAD_CREATE''@|$(REPLACE_PTHREAD_CREATE)|g' \ + -e 's|@''REPLACE_PTHREAD_ATTR_INIT''@|$(REPLACE_PTHREAD_ATTR_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_ATTR_GETDETACHSTATE''@|$(REPLACE_PTHREAD_ATTR_GETDETACHSTATE)|g' \ + -e 's|@''REPLACE_PTHREAD_ATTR_SETDETACHSTATE''@|$(REPLACE_PTHREAD_ATTR_SETDETACHSTATE)|g' \ + -e 's|@''REPLACE_PTHREAD_ATTR_DESTROY''@|$(REPLACE_PTHREAD_ATTR_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_SELF''@|$(REPLACE_PTHREAD_SELF)|g' \ + -e 's|@''REPLACE_PTHREAD_EQUAL''@|$(REPLACE_PTHREAD_EQUAL)|g' \ + -e 's|@''REPLACE_PTHREAD_DETACH''@|$(REPLACE_PTHREAD_DETACH)|g' \ + -e 's|@''REPLACE_PTHREAD_JOIN''@|$(REPLACE_PTHREAD_JOIN)|g' \ + -e 's|@''REPLACE_PTHREAD_EXIT''@|$(REPLACE_PTHREAD_EXIT)|g' \ + -e 's|@''REPLACE_PTHREAD_ONCE''@|$(REPLACE_PTHREAD_ONCE)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_INIT''@|$(REPLACE_PTHREAD_MUTEX_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_INIT''@|$(REPLACE_PTHREAD_MUTEXATTR_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_GETTYPE''@|$(REPLACE_PTHREAD_MUTEXATTR_GETTYPE)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_SETTYPE''@|$(REPLACE_PTHREAD_MUTEXATTR_SETTYPE)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_GETROBUST''@|$(REPLACE_PTHREAD_MUTEXATTR_GETROBUST)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_SETROBUST''@|$(REPLACE_PTHREAD_MUTEXATTR_SETROBUST)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_DESTROY''@|$(REPLACE_PTHREAD_MUTEXATTR_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_LOCK''@|$(REPLACE_PTHREAD_MUTEX_LOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_TRYLOCK''@|$(REPLACE_PTHREAD_MUTEX_TRYLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_TIMEDLOCK''@|$(REPLACE_PTHREAD_MUTEX_TIMEDLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_UNLOCK''@|$(REPLACE_PTHREAD_MUTEX_UNLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_DESTROY''@|$(REPLACE_PTHREAD_MUTEX_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_INIT''@|$(REPLACE_PTHREAD_RWLOCK_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCKATTR_INIT''@|$(REPLACE_PTHREAD_RWLOCKATTR_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCKATTR_DESTROY''@|$(REPLACE_PTHREAD_RWLOCKATTR_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_RDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_RDLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_WRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_WRLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_TRYRDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TRYRDLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_TRYWRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TRYWRLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_UNLOCK''@|$(REPLACE_PTHREAD_RWLOCK_UNLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_DESTROY''@|$(REPLACE_PTHREAD_RWLOCK_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_INIT''@|$(REPLACE_PTHREAD_COND_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_CONDATTR_INIT''@|$(REPLACE_PTHREAD_CONDATTR_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_CONDATTR_DESTROY''@|$(REPLACE_PTHREAD_CONDATTR_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_WAIT''@|$(REPLACE_PTHREAD_COND_WAIT)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_TIMEDWAIT''@|$(REPLACE_PTHREAD_COND_TIMEDWAIT)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_SIGNAL''@|$(REPLACE_PTHREAD_COND_SIGNAL)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_BROADCAST''@|$(REPLACE_PTHREAD_COND_BROADCAST)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_DESTROY''@|$(REPLACE_PTHREAD_COND_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_KEY_CREATE''@|$(REPLACE_PTHREAD_KEY_CREATE)|g' \ + -e 's|@''REPLACE_PTHREAD_SETSPECIFIC''@|$(REPLACE_PTHREAD_SETSPECIFIC)|g' \ + -e 's|@''REPLACE_PTHREAD_GETSPECIFIC''@|$(REPLACE_PTHREAD_GETSPECIFIC)|g' \ + -e 's|@''REPLACE_PTHREAD_KEY_DELETE''@|$(REPLACE_PTHREAD_KEY_DELETE)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_INIT''@|$(REPLACE_PTHREAD_SPIN_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_LOCK''@|$(REPLACE_PTHREAD_SPIN_LOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_TRYLOCK''@|$(REPLACE_PTHREAD_SPIN_TRYLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_UNLOCK''@|$(REPLACE_PTHREAD_SPIN_UNLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_DESTROY''@|$(REPLACE_PTHREAD_SPIN_DESTROY)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _Noreturn/r $(_NORETURN_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create a replacement for <sched.h> when +# the system doesn't have one. +sched.h: sched.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_SCHED_H''@|$(HAVE_SCHED_H)|g' \ + -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SCHED_H''@|$(NEXT_SCHED_H)|g' \ + -e 's|@''HAVE_STRUCT_SCHED_PARAM''@|$(HAVE_STRUCT_SCHED_PARAM)|g' \ + -e 's/@''GNULIB_SCHED_YIELD''@/$(GNULIB_SCHED_YIELD)/g' \ + -e 's|@''HAVE_SCHED_YIELD''@|$(HAVE_SCHED_YIELD)|g' \ + -e 's|@''REPLACE_SCHED_YIELD''@|$(REPLACE_SCHED_YIELD)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sched.in.h; \ + } > $@-t && \ + mv $@-t $@ + # We need the following in order to create <signal.h> when the system # doesn't have a complete one. signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) diff --git a/gnulib-tests/_Noreturn.h b/gnulib-tests/_Noreturn.h index 94fdfaf..0d4b9c2 100644 --- a/gnulib-tests/_Noreturn.h +++ b/gnulib-tests/_Noreturn.h @@ -1,8 +1,34 @@ +/* A C macro for declaring that a function does not return. + Copyright (C) 2011-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + #ifndef _Noreturn -# if 201103 <= (defined __cplusplus ? __cplusplus : 0) +# if (defined __cplusplus \ + && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \ + || (defined _MSC_VER && 1900 <= _MSC_VER)) \ + && 0) + /* [[noreturn]] is not practically usable, because with it the syntax + extern _Noreturn void func (...); + would not be valid; such a declaration would only be valid with 'extern' + and '_Noreturn' swapped, or without the 'extern' keyword. However, some + AIX system header files and several gnulib header files use precisely + this syntax with 'extern'. */ # define _Noreturn [[noreturn]] -# elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ - || 4 < __GNUC__ + (7 <= __GNUC_MINOR__)) +# elif ((!defined __cplusplus || defined __clang__) \ + && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ + || 4 < __GNUC__ + (7 <= __GNUC_MINOR__))) /* _Noreturn works as-is. */ # elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C # define _Noreturn __attribute__ ((__noreturn__)) diff --git a/gnulib-tests/accept.c b/gnulib-tests/accept.c index 9659c71..9be0211 100644 --- a/gnulib-tests/accept.c +++ b/gnulib-tests/accept.c @@ -1,6 +1,6 @@ /* accept.c --- wrappers for Windows accept function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/arg-nonnull.h b/gnulib-tests/arg-nonnull.h index 5f03408..ac26ca8 100644 --- a/gnulib-tests/arg-nonnull.h +++ b/gnulib-tests/arg-nonnull.h @@ -1,5 +1,5 @@ /* A C macro for declaring that specific arguments must not be NULL. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/gnulib-tests/arpa_inet.in.h b/gnulib-tests/arpa_inet.in.h index 3253d79..9f13d48 100644 --- a/gnulib-tests/arpa_inet.in.h +++ b/gnulib-tests/arpa_inet.in.h @@ -1,6 +1,6 @@ /* A GNU-like <arpa/inet.h>. - Copyright (C) 2005-2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc. 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 @@ -49,6 +49,12 @@ #ifndef _@GUARD_PREFIX@_ARPA_INET_H #define _@GUARD_PREFIX@_ARPA_INET_H +/* Get all possible declarations of inet_ntop() and inet_pton(). */ +#if (@GNULIB_INET_NTOP@ || @GNULIB_INET_PTON@ || defined GNULIB_POSIXCHECK) \ + && @HAVE_WS2TCPIP_H@ +# include <ws2tcpip.h> +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */ @@ -70,8 +76,8 @@ the return value is NULL and errno is set to ENOSPC. A good value for CNT is 46. - For more details, see the POSIX:2001 specification - <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */ + For more details, see the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/inet_ntop.html>. */ # if @REPLACE_INET_NTOP@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef inet_ntop @@ -97,7 +103,9 @@ _GL_CXXALIAS_SYS_CAST (inet_ntop, const char *, (int af, const void *restrict src, char *restrict dst, socklen_t cnt)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (inet_ntop); +# endif #elif defined GNULIB_POSIXCHECK # undef inet_ntop # if HAVE_RAW_DECL_INET_NTOP @@ -126,7 +134,9 @@ _GL_FUNCDECL_SYS (inet_pton, int, _GL_CXXALIAS_SYS (inet_pton, int, (int af, const char *restrict src, void *restrict dst)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (inet_pton); +# endif #elif defined GNULIB_POSIXCHECK # undef inet_pton # if HAVE_RAW_DECL_INET_PTON diff --git a/gnulib-tests/bind.c b/gnulib-tests/bind.c index 5c3556d..3c60a76 100644 --- a/gnulib-tests/bind.c +++ b/gnulib-tests/bind.c @@ -1,6 +1,6 @@ /* bind.c --- wrappers for Windows bind function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/c++defs.h b/gnulib-tests/c++defs.h index 72ff1ff..7a05763 100644 --- a/gnulib-tests/c++defs.h +++ b/gnulib-tests/c++defs.h @@ -1,5 +1,5 @@ /* C++ compatible function declaration macros. - Copyright (C) 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2010-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/gnulib-tests/cloexec.c b/gnulib-tests/cloexec.c index 238ab18..510be3d 100644 --- a/gnulib-tests/cloexec.c +++ b/gnulib-tests/cloexec.c @@ -1,6 +1,6 @@ /* cloexec.c - set or clear the close-on-exec descriptor flag - Copyright (C) 1991, 2004-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1991, 2004-2006, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/cloexec.h b/gnulib-tests/cloexec.h index 5902805..f14a997 100644 --- a/gnulib-tests/cloexec.h +++ b/gnulib-tests/cloexec.h @@ -1,6 +1,6 @@ /* cloexec.c - set or clear the close-on-exec descriptor flag - Copyright (C) 2004, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2004, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/close.c b/gnulib-tests/close.c index 01c326a..0c8780d 100644 --- a/gnulib-tests/close.c +++ b/gnulib-tests/close.c @@ -1,5 +1,5 @@ /* close replacement. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/closedir.c b/gnulib-tests/closedir.c index 562a3ec..9afaa1f 100644 --- a/gnulib-tests/closedir.c +++ b/gnulib-tests/closedir.c @@ -1,5 +1,5 @@ /* Stop reading the entries of a directory. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/connect.c b/gnulib-tests/connect.c index 300a594..aaf36c8 100644 --- a/gnulib-tests/connect.c +++ b/gnulib-tests/connect.c @@ -1,6 +1,6 @@ /* connect.c --- wrappers for Windows connect function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/dfa-invalid-char-class.sh b/gnulib-tests/dfa-invalid-char-class.sh index 5ddd1b6..8e8824d 100755 --- a/gnulib-tests/dfa-invalid-char-class.sh +++ b/gnulib-tests/dfa-invalid-char-class.sh @@ -1,7 +1,7 @@ #!/bin/sh # This use of our DFA-testing helper would fail for grep-2.21. -# Copyright 2014-2018 Free Software Foundation, Inc. +# Copyright 2014-2020 Free Software Foundation, Inc. # 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 @@ -24,7 +24,7 @@ path_prepend_ . fail=0 echo 'dfaerror: invalid character class' > exp -LC_ALL=C dfa-match-aux '[[:foo:]]' a > out 2>&1 +LC_ALL=C ${CHECKER} dfa-match-aux '[[:foo:]]' a > out 2>&1 compare exp out || fail=1 Exit $fail diff --git a/gnulib-tests/dfa-match-aux.c b/gnulib-tests/dfa-match-aux.c index 85b0b5b..e0c5f3d 100644 --- a/gnulib-tests/dfa-match-aux.c +++ b/gnulib-tests/dfa-match-aux.c @@ -1,6 +1,6 @@ /* Auxiliary program to test a DFA code path that cannot be triggered by grep or gawk. - Copyright 2014-2018 Free Software Foundation, Inc. + Copyright 2014-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/dfa-match.sh b/gnulib-tests/dfa-match.sh index 1923c2d..bc9e1dc 100755 --- a/gnulib-tests/dfa-match.sh +++ b/gnulib-tests/dfa-match.sh @@ -1,7 +1,7 @@ #!/bin/sh # This would fail with grep-2.21's dfa.c. -# Copyright 2014-2018 Free Software Foundation, Inc. +# Copyright 2014-2020 Free Software Foundation, Inc. # 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 @@ -33,11 +33,11 @@ fi fail=0 -dfa-match-aux a ba 0 > out || fail=1 +${CHECKER} dfa-match-aux a ba 0 > out || fail=1 compare /dev/null out || fail=1 in=$(printf "bb\nbb") -$timeout_10 dfa-match-aux a "$in" 1 > out || fail=1 +$timeout_10 ${CHECKER} dfa-match-aux a "$in" 1 > out || fail=1 compare /dev/null out || fail=1 Exit $fail diff --git a/gnulib-tests/dirent-private.h b/gnulib-tests/dirent-private.h index 69edcc5..4b4eba4 100644 --- a/gnulib-tests/dirent-private.h +++ b/gnulib-tests/dirent-private.h @@ -1,5 +1,5 @@ /* Private details of the DIR type. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/dirent.in.h b/gnulib-tests/dirent.in.h index 2ab25af..f7c2681 100644 --- a/gnulib-tests/dirent.in.h +++ b/gnulib-tests/dirent.in.h @@ -1,5 +1,5 @@ /* A GNU-like <dirent.h>. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/dirfd.c b/gnulib-tests/dirfd.c index 19c8046..f653977 100644 --- a/gnulib-tests/dirfd.c +++ b/gnulib-tests/dirfd.c @@ -1,6 +1,6 @@ /* dirfd.c -- return the file descriptor associated with an open DIR* - Copyright (C) 2001, 2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2001, 2006, 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/dup2.c b/gnulib-tests/dup2.c index c7d1767..88ef259 100644 --- a/gnulib-tests/dup2.c +++ b/gnulib-tests/dup2.c @@ -1,6 +1,6 @@ /* Duplicate an open file descriptor to a specified file descriptor. - Copyright (C) 1999, 2004-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1999, 2004-2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/fcntl.c b/gnulib-tests/fcntl.c index 74e0f5d..6b9927e 100644 --- a/gnulib-tests/fcntl.c +++ b/gnulib-tests/fcntl.c @@ -1,6 +1,6 @@ /* Provide file descriptor control. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 @@ -25,6 +25,7 @@ #include <errno.h> #include <limits.h> #include <stdarg.h> +#include <stdlib.h> #include <unistd.h> #ifdef __KLIBC__ @@ -545,7 +546,7 @@ rpl_fcntl_DUPFD_CLOEXEC (int fd, int target) #ifdef __KLIBC__ static int -klibc_fcntl (int fd, int action, /* arg */...); +klibc_fcntl (int fd, int action, /* arg */...) { va_list arg_ptr; int arg; diff --git a/gnulib-tests/fd-hook.c b/gnulib-tests/fd-hook.c index 95a0662..8840f63 100644 --- a/gnulib-tests/fd-hook.c +++ b/gnulib-tests/fd-hook.c @@ -1,5 +1,5 @@ /* Hook for making file descriptor functions close(), ioctl() extensible. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it diff --git a/gnulib-tests/fd-hook.h b/gnulib-tests/fd-hook.h index dbc5b67..ed1a15a 100644 --- a/gnulib-tests/fd-hook.h +++ b/gnulib-tests/fd-hook.h @@ -1,5 +1,5 @@ /* Hook for making file descriptor functions close(), ioctl() extensible. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/gnulib-tests/fdopen.c b/gnulib-tests/fdopen.c index 669d85d..b0f13fa 100644 --- a/gnulib-tests/fdopen.c +++ b/gnulib-tests/fdopen.c @@ -1,5 +1,5 @@ /* Open a stream with a given file descriptor. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/fflush.c b/gnulib-tests/fflush.c index a140b7a..b3a40e8 100644 --- a/gnulib-tests/fflush.c +++ b/gnulib-tests/fflush.c @@ -1,5 +1,5 @@ /* fflush.c -- allow flushing input streams - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 @@ -159,25 +159,28 @@ rpl_fflush (FILE *stream) #else { - /* Notes about the file-position indicator: - 1) The file position indicator is incremented by fgetc() and decremented + /* What POSIX says: + 1) About the file-position indicator (-> fseeko, ftello): + The file position indicator is incremented by fgetc() and decremented by ungetc(): - <http://www.opengroup.org/susv3/functions/fgetc.html> + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fgetc.html> "... the fgetc() function shall ... advance the associated file position indicator for the stream ..." - <http://www.opengroup.org/susv3/functions/ungetc.html> + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ungetc.html> "The file-position indicator is decremented by each successful call to ungetc()..." - 2) <http://www.opengroup.org/susv3/functions/ungetc.html> says: - "The value of the file-position indicator for the stream after - reading or discarding all pushed-back bytes shall be the same - as it was before the bytes were pushed back." - Here we are discarding all pushed-back bytes. But more specifically, - 3) <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> says: - "[After fflush(),] the file offset of the underlying open file - description shall be set to the file position of the stream, and - any characters pushed back onto the stream by ungetc() ... shall - be discarded." */ + 2) fflush discards bytes pushed back by ungetc: + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fflush.html> + "...any characters pushed back onto the stream by ungetc() + or ungetwc() that have not subsequently been read from the + stream shall be discarded..." + This implies implicitly: fflush does not change the file position + indicator. + 3) Effects on the file descriptor, if the file descriptor is capable of + seeking: + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fflush.html> + "...the file offset of the underlying open file description shall + be set to the file position of the stream..." */ /* POSIX does not specify fflush behavior for non-seekable input streams. Some implementations purge unread data, some return diff --git a/gnulib-tests/file-has-acl.c b/gnulib-tests/file-has-acl.c index 97fb08a..c667ae9 100644 --- a/gnulib-tests/file-has-acl.c +++ b/gnulib-tests/file-has-acl.c @@ -1,6 +1,6 @@ /* Test whether a file has a nontrivial ACL. -*- coding: utf-8 -*- - Copyright (C) 2002-2003, 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/flexmember.h b/gnulib-tests/flexmember.h deleted file mode 100644 index 7e3f598..0000000 --- a/gnulib-tests/flexmember.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Sizes of structs with flexible array members. - - Copyright 2016-2018 Free Software Foundation, Inc. - - This file is part of the GNU C Library. - - The GNU C Library 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 3 of the License, or (at your option) any later version. - - The GNU C 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 - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. - - Written by Paul Eggert. */ - -#include <stddef.h> - -/* Nonzero multiple of alignment of TYPE, suitable for FLEXSIZEOF below. - On older platforms without _Alignof, use a pessimistic bound that is - safe in practice even if FLEXIBLE_ARRAY_MEMBER is 1. - On newer platforms, use _Alignof to get a tighter bound. */ - -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 -# define FLEXALIGNOF(type) (sizeof (type) & ~ (sizeof (type) - 1)) -#else -# define FLEXALIGNOF(type) _Alignof (type) -#endif - -/* Upper bound on the size of a struct of type TYPE with a flexible - array member named MEMBER that is followed by N bytes of other data. - This is not simply sizeof (TYPE) + N, since it may require - alignment on unusually picky C11 platforms, and - FLEXIBLE_ARRAY_MEMBER may be 1 on pre-C11 platforms. - Yield a value less than N if and only if arithmetic overflow occurs. */ - -#define FLEXSIZEOF(type, member, n) \ - ((offsetof (type, member) + FLEXALIGNOF (type) - 1 + (n)) \ - & ~ (FLEXALIGNOF (type) - 1)) diff --git a/gnulib-tests/fpurge.c b/gnulib-tests/fpurge.c index f9c82cd..f05da5a 100644 --- a/gnulib-tests/fpurge.c +++ b/gnulib-tests/fpurge.c @@ -1,5 +1,5 @@ /* Flushing buffers of a FILE stream. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/freading.c b/gnulib-tests/freading.c index 790f92c..f4dab78 100644 --- a/gnulib-tests/freading.c +++ b/gnulib-tests/freading.c @@ -1,5 +1,5 @@ /* Retrieve information about a FILE stream. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/freading.h b/gnulib-tests/freading.h index 31d71fd..6c5592e 100644 --- a/gnulib-tests/freading.h +++ b/gnulib-tests/freading.h @@ -1,5 +1,5 @@ /* Retrieve information about a FILE stream. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/fseek.c b/gnulib-tests/fseek.c index e0b5877..81f35a2 100644 --- a/gnulib-tests/fseek.c +++ b/gnulib-tests/fseek.c @@ -1,5 +1,5 @@ /* An fseek() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/fseeko.c b/gnulib-tests/fseeko.c index 5bd7d66..9c0b7a9 100644 --- a/gnulib-tests/fseeko.c +++ b/gnulib-tests/fseeko.c @@ -1,5 +1,5 @@ /* An fseeko() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/ftell.c b/gnulib-tests/ftell.c index 74a1da8..234c193 100644 --- a/gnulib-tests/ftell.c +++ b/gnulib-tests/ftell.c @@ -1,5 +1,5 @@ /* An ftell() function that works around platform bugs. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/ftello.c b/gnulib-tests/ftello.c index 495c254..43d4a4d 100644 --- a/gnulib-tests/ftello.c +++ b/gnulib-tests/ftello.c @@ -1,5 +1,5 @@ /* An ftello() function that works around platform bugs. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/ftruncate.c b/gnulib-tests/ftruncate.c index 80cb480..a185637 100644 --- a/gnulib-tests/ftruncate.c +++ b/gnulib-tests/ftruncate.c @@ -1,5 +1,5 @@ /* ftruncate emulations for native Windows. - Copyright (C) 1992-2018 Free Software Foundation, Inc. + Copyright (C) 1992-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/getcwd-lgpl.c b/gnulib-tests/getcwd-lgpl.c index 9f0e007..fca6bde 100644 --- a/gnulib-tests/getcwd-lgpl.c +++ b/gnulib-tests/getcwd-lgpl.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2018 Free Software Foundation, Inc. +/* Copyright (C) 2011-2020 Free Software Foundation, Inc. This file is part of gnulib. This program is free software: you can redistribute it and/or modify @@ -115,10 +115,15 @@ rpl_getcwd (char *buf, size_t size) } else { - /* Trim to fit, if possible. */ - result = realloc (buf, strlen (buf) + 1); - if (!result) - result = buf; + /* Here result == buf. */ + /* Shrink result before returning it. */ + size_t actual_size = strlen (result) + 1; + if (actual_size < size) + { + char *shrinked_result = realloc (result, actual_size); + if (shrinked_result != NULL) + result = shrinked_result; + } } return result; } diff --git a/gnulib-tests/getdtablesize.c b/gnulib-tests/getdtablesize.c index ac05bc4..0fe7092 100644 --- a/gnulib-tests/getdtablesize.c +++ b/gnulib-tests/getdtablesize.c @@ -1,5 +1,5 @@ /* getdtablesize() function: Return maximum possible file descriptor value + 1. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/getpagesize.c b/gnulib-tests/getpagesize.c index 9e79ed6..0ce5ae5 100644 --- a/gnulib-tests/getpagesize.c +++ b/gnulib-tests/getpagesize.c @@ -1,6 +1,6 @@ /* getpagesize emulation for systems where it cannot be done in a C macro. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/glthread/thread.c b/gnulib-tests/glthread/thread.c new file mode 100644 index 0000000..08ef339 --- /dev/null +++ b/gnulib-tests/glthread/thread.c @@ -0,0 +1,205 @@ +/* Creating and controlling threads. + Copyright (C) 2005-2020 Free Software Foundation, Inc. + + 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 3, 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2005. + Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h. */ + +#include <config.h> + +/* Specification. */ +# define _GLTHREAD_THREAD_INLINE _GL_EXTERN_INLINE +#include "glthread/thread.h" + +#include <stdlib.h> +#include "glthread/lock.h" + +/* ========================================================================= */ + +#if USE_ISOC_THREADS + +struct thrd_with_exitvalue +{ + thrd_t volatile tid; + void * volatile exitvalue; +}; + +/* The Thread-Specific Storage (TSS) key that allows to access each thread's + 'struct thrd_with_exitvalue *' pointer. */ +static tss_t thrd_with_exitvalue_key; + +/* Initializes thrd_with_exitvalue_key. + This function must only be called once. */ +static void +do_init_thrd_with_exitvalue_key (void) +{ + if (tss_create (&thrd_with_exitvalue_key, NULL) != thrd_success) + abort (); +} + +/* Initializes thrd_with_exitvalue_key. */ +static void +init_thrd_with_exitvalue_key (void) +{ + static once_flag once = ONCE_FLAG_INIT; + call_once (&once, do_init_thrd_with_exitvalue_key); +} + +typedef union + { + struct thrd_with_exitvalue t; + struct + { + thrd_t tid; /* reserve memory for t.tid */ + void *(*mainfunc) (void *); + void *arg; + } a; + } + main_arg_t; + +static int +thrd_main_func (void *pmarg) +{ + /* Unpack the object that combines mainfunc and arg. */ + main_arg_t *main_arg = (main_arg_t *) pmarg; + void *(*mainfunc) (void *) = main_arg->a.mainfunc; + void *arg = main_arg->a.arg; + + if (tss_set (thrd_with_exitvalue_key, &main_arg->t) != thrd_success) + abort (); + + /* Execute mainfunc, with arg as argument. */ + { + void *exitvalue = mainfunc (arg); + /* Store the exitvalue, for use by glthread_join(). */ + main_arg->t.exitvalue = exitvalue; + return 0; + } +} + +int +glthread_create (gl_thread_t *threadp, void *(*mainfunc) (void *), void *arg) +{ + init_thrd_with_exitvalue_key (); + { + /* Combine mainfunc and arg in a single object. + A stack-allocated object does not work, because it would be out of + existence when thrd_create returns before thrd_main_func is + entered. So, allocate it in the heap. */ + main_arg_t *main_arg = (main_arg_t *) malloc (sizeof (main_arg_t)); + if (main_arg == NULL) + return ENOMEM; + main_arg->a.mainfunc = mainfunc; + main_arg->a.arg = arg; + switch (thrd_create ((thrd_t *) &main_arg->t.tid, thrd_main_func, main_arg)) + { + case thrd_success: + break; + case thrd_nomem: + free (main_arg); + return ENOMEM; + default: + free (main_arg); + return EAGAIN; + } + *threadp = &main_arg->t; + return 0; + } +} + +gl_thread_t +gl_thread_self (void) +{ + init_thrd_with_exitvalue_key (); + { + gl_thread_t thread = + (struct thrd_with_exitvalue *) tss_get (thrd_with_exitvalue_key); + if (thread == NULL) + { + /* This happens only in threads that have not been created through + glthread_create(), such as the main thread. */ + for (;;) + { + thread = + (struct thrd_with_exitvalue *) + malloc (sizeof (struct thrd_with_exitvalue)); + if (thread != NULL) + break; + /* Memory allocation failed. There is not much we can do. Have to + busy-loop, waiting for the availability of memory. */ + { + struct timespec ts; + ts.tv_sec = 1; + ts.tv_nsec = 0; + thrd_sleep (&ts, NULL); + } + } + thread->tid = thrd_current (); + thread->exitvalue = NULL; /* just to be deterministic */ + if (tss_set (thrd_with_exitvalue_key, thread) != thrd_success) + abort (); + } + return thread; + } +} + +int +glthread_join (gl_thread_t thread, void **return_value_ptr) +{ + /* On Solaris 11.4, thrd_join crashes when the second argument we pass is + NULL. */ + int dummy; + + if (thread == gl_thread_self ()) + return EINVAL; + if (thrd_join (thread->tid, &dummy) != thrd_success) + return EINVAL; + if (return_value_ptr != NULL) + *return_value_ptr = thread->exitvalue; + free (thread); + return 0; +} + +_Noreturn void +gl_thread_exit (void *return_value) +{ + gl_thread_t thread = gl_thread_self (); + thread->exitvalue = return_value; + thrd_exit (0); +} + +#endif + +/* ========================================================================= */ + +#if USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS + +#include <pthread.h> + +#if defined PTW32_VERSION || defined __MVS__ + +const gl_thread_t gl_null_thread /* = { .p = NULL } */; + +#endif + +#endif + +/* ========================================================================= */ + +#if USE_WINDOWS_THREADS + +#endif + +/* ========================================================================= */ diff --git a/gnulib-tests/glthread/thread.h b/gnulib-tests/glthread/thread.h new file mode 100644 index 0000000..a980e65 --- /dev/null +++ b/gnulib-tests/glthread/thread.h @@ -0,0 +1,356 @@ +/* Creating and controlling threads. + Copyright (C) 2005-2020 Free Software Foundation, Inc. + + 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 3, 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2005. + Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h. */ + +/* This file contains primitives for creating and controlling threads. + + Thread data type: gl_thread_t. + + Creating a thread: + thread = gl_thread_create (func, arg); + Or with control of error handling: + err = glthread_create (&thread, func, arg); + extern int glthread_create (gl_thread_t *result, + void *(*func) (void *), void *arg); + + Querying and changing the signal mask of a thread (not supported on all + platforms): + gl_thread_sigmask (how, newmask, oldmask); + Or with control of error handling: + err = glthread_sigmask (how, newmask, oldmask); + extern int glthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask); + + Waiting for termination of another thread: + gl_thread_join (thread, &return_value); + Or with control of error handling: + err = glthread_join (thread, &return_value); + extern int glthread_join (gl_thread_t thread, void **return_value_ptr); + + Getting a reference to the current thread: + current = gl_thread_self (); + extern gl_thread_t gl_thread_self (void); + + Getting a reference to the current thread as a pointer, for debugging: + ptr = gl_thread_self_pointer (); + extern void * gl_thread_self_pointer (void); + + Terminating the current thread: + gl_thread_exit (return_value); + extern _Noreturn void gl_thread_exit (void *return_value); + + Requesting custom code to be executed at fork() time (not supported on all + platforms): + gl_thread_atfork (prepare_func, parent_func, child_func); + Or with control of error handling: + err = glthread_atfork (prepare_func, parent_func, child_func); + extern int glthread_atfork (void (*prepare_func) (void), + void (*parent_func) (void), + void (*child_func) (void)); + Note that even on platforms where this is supported, use of fork() and + threads together is problematic, see + <https://lists.gnu.org/r/bug-gnulib/2008-08/msg00062.html> + */ + + +#ifndef _GLTHREAD_THREAD_H +#define _GLTHREAD_THREAD_H + +#include <errno.h> +#include <stdlib.h> + +#if !defined c11_threads_in_use +# if HAVE_THREADS_H && USE_POSIX_THREADS_WEAK +# include <threads.h> +# pragma weak thrd_exit +# define c11_threads_in_use() (thrd_exit != NULL) +# else +# define c11_threads_in_use() 0 +# endif +#endif + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef _GLTHREAD_THREAD_INLINE +# define _GLTHREAD_THREAD_INLINE _GL_INLINE +#endif + +/* ========================================================================= */ + +#if USE_ISOC_THREADS + +/* Use the ISO C threads library. */ + +# include <threads.h> + +# ifdef __cplusplus +extern "C" { +# endif + +/* -------------------------- gl_thread_t datatype -------------------------- */ + +typedef struct thrd_with_exitvalue *gl_thread_t; +extern int glthread_create (gl_thread_t *threadp, + void *(*func) (void *), void *arg); +# define glthread_sigmask(HOW, SET, OSET) \ + pthread_sigmask (HOW, SET, OSET) +extern int glthread_join (gl_thread_t thread, void **return_value_ptr); +extern gl_thread_t gl_thread_self (void); +# define gl_thread_self_pointer() \ + (void *) gl_thread_self () +extern _Noreturn void gl_thread_exit (void *return_value); +# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0 + +# ifdef __cplusplus +} +# endif + +#endif + +/* ========================================================================= */ + +#if USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS + +/* Use the POSIX threads library. */ + +# include <pthread.h> + +/* On IRIX, pthread_atfork is declared in <unistd.h>, not in <pthread.h>. */ +# if defined __sgi +# include <unistd.h> +# endif + +# if USE_POSIX_THREADS_WEAK +/* Compilers other than GCC need to see the declaration of pthread_sigmask + before the "#pragma weak pthread_sigmask" below. */ +# include <signal.h> +# endif + +# ifdef __cplusplus +extern "C" { +# endif + +# if PTHREAD_IN_USE_DETECTION_HARD + +/* The pthread_in_use() detection needs to be done at runtime. */ +# define pthread_in_use() \ + glthread_in_use () +extern int glthread_in_use (void); + +# endif + +# if USE_POSIX_THREADS_WEAK + +/* Use weak references to the POSIX threads library. */ + +/* Weak references avoid dragging in external libraries if the other parts + of the program don't use them. Here we use them, because we don't want + every program that uses libintl to depend on libpthread. This assumes + that libpthread would not be loaded after libintl; i.e. if libintl is + loaded first, by an executable that does not depend on libpthread, and + then a module is dynamically loaded that depends on libpthread, libintl + will not be multithread-safe. */ + +/* The way to test at runtime whether libpthread is present is to test + whether a function pointer's value, such as &pthread_mutex_init, is + non-NULL. However, some versions of GCC have a bug through which, in + PIC mode, &foo != NULL always evaluates to true if there is a direct + call to foo(...) in the same function. To avoid this, we test the + address of a function in libpthread that we don't use. */ + +# ifndef pthread_sigmask /* Do not declare rpl_pthread_sigmask weak. */ +# pragma weak pthread_sigmask +# endif + +# pragma weak pthread_join +# ifndef pthread_self +# pragma weak pthread_self +# endif +# pragma weak pthread_exit +# if HAVE_PTHREAD_ATFORK +# pragma weak pthread_atfork +# endif + +# if !PTHREAD_IN_USE_DETECTION_HARD +# pragma weak pthread_mutexattr_gettype +# define pthread_in_use() \ + (pthread_mutexattr_gettype != NULL || c11_threads_in_use ()) +# endif + +# else + +# if !PTHREAD_IN_USE_DETECTION_HARD +# define pthread_in_use() 1 +# endif + +# endif + +/* -------------------------- gl_thread_t datatype -------------------------- */ + +/* This choice of gl_thread_t assumes that + pthread_equal (a, b) is equivalent to ((a) == (b)). + This is the case on all platforms in use in 2008. */ +typedef pthread_t gl_thread_t; +# define glthread_create(THREADP, FUNC, ARG) \ + (pthread_in_use () ? pthread_create (THREADP, NULL, FUNC, ARG) : ENOSYS) +# define glthread_sigmask(HOW, SET, OSET) \ + (pthread_in_use () ? pthread_sigmask (HOW, SET, OSET) : 0) +# define glthread_join(THREAD, RETVALP) \ + (pthread_in_use () ? pthread_join (THREAD, RETVALP) : 0) +# ifdef PTW32_VERSION + /* In pthreads-win32, pthread_t is a struct with a pointer field 'p' and + other fields. */ +# define gl_thread_self() \ + (pthread_in_use () ? pthread_self () : gl_null_thread) +# define gl_thread_self_pointer() \ + (pthread_in_use () ? pthread_self ().p : NULL) +extern const gl_thread_t gl_null_thread; +# elif defined __MVS__ + /* On IBM z/OS, pthread_t is a struct with an 8-byte '__' field. + The first three bytes of this field appear to uniquely identify a + pthread_t, though not necessarily representing a pointer. */ +# define gl_thread_self() \ + (pthread_in_use () ? pthread_self () : gl_null_thread) +# define gl_thread_self_pointer() \ + (pthread_in_use () ? *((void **) pthread_self ().__) : NULL) +extern const gl_thread_t gl_null_thread; +# else +# define gl_thread_self() \ + (pthread_in_use () ? pthread_self () : (pthread_t) NULL) +# define gl_thread_self_pointer() \ + (pthread_in_use () ? (void *) pthread_self () : NULL) +# endif +# define gl_thread_exit(RETVAL) \ + (pthread_in_use () ? pthread_exit (RETVAL) : 0) + +# if HAVE_PTHREAD_ATFORK +# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) \ + (pthread_in_use () ? pthread_atfork (PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) : 0) +# else +# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0 +# endif + +# ifdef __cplusplus +} +# endif + +#endif + +/* ========================================================================= */ + +#if USE_WINDOWS_THREADS + +# define WIN32_LEAN_AND_MEAN /* avoid including junk */ +# include <windows.h> + +# include "windows-thread.h" + +# ifdef __cplusplus +extern "C" { +# endif + +/* -------------------------- gl_thread_t datatype -------------------------- */ + +typedef glwthread_thread_t gl_thread_t; +# define glthread_create(THREADP, FUNC, ARG) \ + glwthread_thread_create (THREADP, 0, FUNC, ARG) +# define glthread_sigmask(HOW, SET, OSET) \ + /* unsupported */ 0 +# define glthread_join(THREAD, RETVALP) \ + glwthread_thread_join (THREAD, RETVALP) +# define gl_thread_self() \ + glwthread_thread_self () +# define gl_thread_self_pointer() \ + gl_thread_self () +# define gl_thread_exit(RETVAL) \ + glwthread_thread_exit (RETVAL) +# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0 + +# ifdef __cplusplus +} +# endif + +#endif + +/* ========================================================================= */ + +#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS) + +/* Provide dummy implementation if threads are not supported. */ + +typedef int gl_thread_t; +# define glthread_create(THREADP, FUNC, ARG) ENOSYS +# define glthread_sigmask(HOW, SET, OSET) 0 +# define glthread_join(THREAD, RETVALP) 0 +# define gl_thread_self() 0 +# define gl_thread_self_pointer() \ + ((void *) gl_thread_self ()) +# define gl_thread_exit(RETVAL) 0 +# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0 + +#endif + +/* ========================================================================= */ + +/* Macros with built-in error handling. */ + +#ifdef __cplusplus +extern "C" { +#endif + +_GLTHREAD_THREAD_INLINE gl_thread_t +gl_thread_create (void *(*func) (void *arg), void *arg) +{ + gl_thread_t thread; + int ret; + + ret = glthread_create (&thread, func, arg); + if (ret != 0) + abort (); + return thread; +} +#define gl_thread_sigmask(HOW, SET, OSET) \ + do \ + { \ + if (glthread_sigmask (HOW, SET, OSET)) \ + abort (); \ + } \ + while (0) +#define gl_thread_join(THREAD, RETVAL) \ + do \ + { \ + if (glthread_join (THREAD, RETVAL)) \ + abort (); \ + } \ + while (0) +#define gl_thread_atfork(PREPARE, PARENT, CHILD) \ + do \ + { \ + if (glthread_atfork (PREPARE, PARENT, CHILD)) \ + abort (); \ + } \ + while (0) + +#ifdef __cplusplus +} +#endif + +_GL_INLINE_HEADER_END + +#endif /* _GLTHREAD_THREAD_H */ diff --git a/gnulib-tests/gnulib.mk b/gnulib-tests/gnulib.mk index cd6d2a8..62a679f 100644 --- a/gnulib-tests/gnulib.mk +++ b/gnulib-tests/gnulib.mk @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2020 Free Software Foundation, Inc. # # 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 @@ -22,7 +22,7 @@ # # Generated by gnulib-tool. -AUTOMAKE_OPTIONS = 1.11 foreign +AUTOMAKE_OPTIONS = 1.11 foreign subdir-objects SUBDIRS = . TESTS = @@ -84,9 +84,9 @@ TESTS += \ test-copy-acl.sh test-copy-acl-1.sh test-copy-acl-2.sh TESTS_ENVIRONMENT += USE_ACL=$(USE_ACL) check_PROGRAMS += test-set-mode-acl test-copy-acl test-sameacls -test_set_mode_acl_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ -test_copy_acl_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ -test_sameacls_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ +test_set_mode_acl_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(LIB_MBRTOWC) +test_copy_acl_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(LIB_MBRTOWC) +test_sameacls_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(LIB_MBRTOWC) EXTRA_DIST += test-set-mode-acl.sh test-set-mode-acl-1.sh test-set-mode-acl-2.sh test-copy-acl.sh test-copy-acl-1.sh test-copy-acl-2.sh test-set-mode-acl.c test-copy-acl.c test-sameacls.c macros.h ## end gnulib module acl-tests @@ -128,6 +128,7 @@ arpa/inet.h: arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \ -e 's/@''GNULIB_INET_NTOP''@/$(GNULIB_INET_NTOP)/g' \ -e 's/@''GNULIB_INET_PTON''@/$(GNULIB_INET_PTON)/g' \ + -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \ -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \ -e 's|@''REPLACE_INET_NTOP''@|$(REPLACE_INET_NTOP)|g' \ @@ -185,7 +186,7 @@ EXTRA_DIST += test-bind.c signature.h macros.h TESTS += test-btowc1.sh test-btowc2.sh TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' check_PROGRAMS += test-btowc - +test_btowc_LDADD = $(LDADD) $(LIB_SETLOCALE) EXTRA_DIST += test-btowc1.sh test-btowc2.sh test-btowc.c signature.h macros.h ## end gnulib module btowc-tests @@ -194,6 +195,7 @@ EXTRA_DIST += test-btowc1.sh test-btowc2.sh test-btowc.c signature.h macros.h TESTS += test-c-ctype check_PROGRAMS += test-c-ctype +test_c_ctype_LDADD = $(LDADD) $(LIB_SETLOCALE) EXTRA_DIST += test-c-ctype.c macros.h ## end gnulib module c-ctype-tests @@ -203,6 +205,8 @@ EXTRA_DIST += test-c-ctype.c macros.h TESTS += test-c-strcase.sh TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_TR_UTF8='@LOCALE_TR_UTF8@' check_PROGRAMS += test-c-strcasecmp test-c-strncasecmp +test_c_strcasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) +test_c_strncasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) EXTRA_DIST += test-c-strcase.sh test-c-strcasecmp.c test-c-strncasecmp.c macros.h ## end gnulib module c-strcase-tests @@ -298,7 +302,7 @@ TESTS += \ dfa-match.sh check_PROGRAMS += dfa-match-aux -dfa_match_aux_LDADD = $(LDADD) @LIBINTL@ +dfa_match_aux_LDADD = $(LDADD) $(LIB_SETLOCALE) @LIBINTL@ $(LIB_MBRTOWC) EXTRA_DIST += dfa-match.sh dfa-match-aux.c dfa-invalid-char-class.sh ## end gnulib module dfa-tests @@ -496,13 +500,6 @@ EXTRA_DIST += test-file-has-acl.sh test-file-has-acl-1.sh test-file-has-acl-2.sh ## end gnulib module file-has-acl-tests -## begin gnulib module flexmember - - -EXTRA_DIST += flexmember.h - -## end gnulib module flexmember - ## begin gnulib module fpending-tests TESTS += test-fpending.sh @@ -765,6 +762,19 @@ EXTRA_DIST += signature.h test-gettimeofday.c ## end gnulib module gettimeofday-tests +## begin gnulib module hard-locale-tests + +TESTS += test-hard-locale +check_PROGRAMS += test-hard-locale +test_hard_locale_LDADD = $(LDADD) $(LIB_SETLOCALE) @LIB_HARD_LOCALE@ +# We cannot call this program 'locale', because the C++ compiler on Mac OS X +# would then barf upon '#include <locale>'. So, call it 'current-locale'. +noinst_PROGRAMS += current-locale +current_locale_SOURCES = locale.c +EXTRA_DIST += test-hard-locale.c locale.c + +## end gnulib module hard-locale-tests + ## begin gnulib module ignore-value-tests TESTS += test-ignore-value @@ -799,52 +809,6 @@ EXTRA_DIST += test-intprops.c macros.h ## end gnulib module intprops-tests -## begin gnulib module inttypes-incomplete - -BUILT_SOURCES += inttypes.h - -# We need the following in order to create <inttypes.h> when the system -# doesn't have one that works with the given compiler. -inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) - $(AM_V_GEN)rm -f $@-t $@ && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ - -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ - -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ - -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ - -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ - -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ - -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ - -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ - -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ - -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ - -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ - -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ - -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \ - -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \ - -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \ - -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ - -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ - -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ - -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \ - -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \ - -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \ - -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ - -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \ - -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ - -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \ - -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ - -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ - -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ - < $(srcdir)/inttypes.in.h; \ - } > $@-t && \ - mv $@-t $@ -MOSTLYCLEANFILES += inttypes.h inttypes.h-t - -EXTRA_DIST += inttypes.in.h - -## end gnulib module inttypes-incomplete - ## begin gnulib module inttypes-tests TESTS += test-inttypes @@ -932,6 +896,7 @@ EXTRA_DIST += test-listen.c signature.h macros.h ## begin gnulib module localcharset-tests noinst_PROGRAMS += test-localcharset +test_localcharset_LDADD = $(LDADD) $(LIB_SETLOCALE) EXTRA_DIST += test-localcharset.c ## end gnulib module localcharset-tests @@ -964,7 +929,7 @@ EXTRA_DIST += localename-table.h localename.h TESTS += test-localename check_PROGRAMS += test-localename -test_localename_LDADD = $(LDADD) @INTL_MACOSX_LIBS@ $(LIBTHREAD) +test_localename_LDADD = $(LDADD) $(LIB_SETLOCALE) @INTL_MACOSX_LIBS@ $(LIBTHREAD) EXTRA_DIST += test-localename.c macros.h @@ -1010,14 +975,16 @@ TESTS += \ test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh \ test-mbrtowc5.sh \ test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh test-mbrtowc-w32-3.sh \ - test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh + test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh test-mbrtowc-w32-6.sh \ + test-mbrtowc-w32-7.sh TESTS_ENVIRONMENT += \ LOCALE_FR='@LOCALE_FR@' \ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ LOCALE_JA='@LOCALE_JA@' \ LOCALE_ZH_CN='@LOCALE_ZH_CN@' check_PROGRAMS += test-mbrtowc test-mbrtowc-w32 -EXTRA_DIST += test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh test-mbrtowc5.sh test-mbrtowc.c test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh test-mbrtowc-w32.c signature.h macros.h +test_mbrtowc_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC) +EXTRA_DIST += test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh test-mbrtowc5.sh test-mbrtowc.c test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh test-mbrtowc-w32-6.sh test-mbrtowc-w32-7.sh test-mbrtowc-w32.c signature.h macros.h ## end gnulib module mbrtowc-tests @@ -1026,7 +993,7 @@ EXTRA_DIST += test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.s TESTS += test-mbsinit.sh TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' check_PROGRAMS += test-mbsinit - +test_mbsinit_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC) EXTRA_DIST += test-mbsinit.sh test-mbsinit.c signature.h macros.h ## end gnulib module mbsinit-tests @@ -1114,10 +1081,12 @@ EXTRA_DIST += test-netinet_in.c ## begin gnulib module nl_langinfo-tests -TESTS += test-nl_langinfo.sh +TESTS += test-nl_langinfo.sh test-nl_langinfo-mt TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' -check_PROGRAMS += test-nl_langinfo -EXTRA_DIST += test-nl_langinfo.sh test-nl_langinfo.c signature.h macros.h +check_PROGRAMS += test-nl_langinfo test-nl_langinfo-mt +test_nl_langinfo_LDADD = $(LDADD) $(LIB_SETLOCALE) +test_nl_langinfo_mt_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBMULTITHREAD) $(LIB_NANOSLEEP) +EXTRA_DIST += test-nl_langinfo.sh test-nl_langinfo.c test-nl_langinfo-mt.c signature.h macros.h ## end gnulib module nl_langinfo-tests @@ -1189,6 +1158,195 @@ EXTRA_DIST += test-pipe.c signature.h macros.h ## end gnulib module pipe-posix-tests +## begin gnulib module pthread-h + +BUILT_SOURCES += pthread.h + +# We need the following in order to create <pthread.h> when the system +# doesn't have one that works with the given compiler. +pthread.h: pthread.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_PTHREAD_H''@|$(HAVE_PTHREAD_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_PTHREAD_H''@|$(NEXT_PTHREAD_H)|g' \ + -e 's/@''GNULIB_PTHREAD_THREAD''@/$(GNULIB_PTHREAD_THREAD)/g' \ + -e 's/@''GNULIB_PTHREAD_ONCE''@/$(GNULIB_PTHREAD_ONCE)/g' \ + -e 's/@''GNULIB_PTHREAD_MUTEX''@/$(GNULIB_PTHREAD_MUTEX)/g' \ + -e 's/@''GNULIB_PTHREAD_RWLOCK''@/$(GNULIB_PTHREAD_RWLOCK)/g' \ + -e 's/@''GNULIB_PTHREAD_COND''@/$(GNULIB_PTHREAD_COND)/g' \ + -e 's/@''GNULIB_PTHREAD_TSS''@/$(GNULIB_PTHREAD_TSS)/g' \ + -e 's/@''GNULIB_PTHREAD_SPIN''@/$(GNULIB_PTHREAD_SPIN)/g' \ + -e 's/@''GNULIB_PTHREAD_MUTEX_TIMEDLOCK''@/$(GNULIB_PTHREAD_MUTEX_TIMEDLOCK)/g' \ + -e 's|@''HAVE_PTHREAD_T''@|$(HAVE_PTHREAD_T)|g' \ + -e 's|@''HAVE_PTHREAD_SPINLOCK_T''@|$(HAVE_PTHREAD_SPINLOCK_T)|g' \ + -e 's|@''HAVE_PTHREAD_CREATE_DETACHED''@|$(HAVE_PTHREAD_CREATE_DETACHED)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_RECURSIVE''@|$(HAVE_PTHREAD_MUTEX_RECURSIVE)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_ROBUST''@|$(HAVE_PTHREAD_MUTEX_ROBUST)|g' \ + -e 's|@''HAVE_PTHREAD_PROCESS_SHARED''@|$(HAVE_PTHREAD_PROCESS_SHARED)|g' \ + -e 's|@''HAVE_PTHREAD_CREATE''@|$(HAVE_PTHREAD_CREATE)|g' \ + -e 's|@''HAVE_PTHREAD_ATTR_INIT''@|$(HAVE_PTHREAD_ATTR_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_ATTR_GETDETACHSTATE''@|$(HAVE_PTHREAD_ATTR_GETDETACHSTATE)|g' \ + -e 's|@''HAVE_PTHREAD_ATTR_SETDETACHSTATE''@|$(HAVE_PTHREAD_ATTR_SETDETACHSTATE)|g' \ + -e 's|@''HAVE_PTHREAD_ATTR_DESTROY''@|$(HAVE_PTHREAD_ATTR_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_SELF''@|$(HAVE_PTHREAD_SELF)|g' \ + -e 's|@''HAVE_PTHREAD_EQUAL''@|$(HAVE_PTHREAD_EQUAL)|g' \ + -e 's|@''HAVE_PTHREAD_DETACH''@|$(HAVE_PTHREAD_DETACH)|g' \ + -e 's|@''HAVE_PTHREAD_JOIN''@|$(HAVE_PTHREAD_JOIN)|g' \ + -e 's|@''HAVE_PTHREAD_EXIT''@|$(HAVE_PTHREAD_EXIT)|g' \ + -e 's|@''HAVE_PTHREAD_ONCE''@|$(HAVE_PTHREAD_ONCE)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_INIT''@|$(HAVE_PTHREAD_MUTEX_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_INIT''@|$(HAVE_PTHREAD_MUTEXATTR_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_GETTYPE''@|$(HAVE_PTHREAD_MUTEXATTR_GETTYPE)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_SETTYPE''@|$(HAVE_PTHREAD_MUTEXATTR_SETTYPE)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_GETROBUST''@|$(HAVE_PTHREAD_MUTEXATTR_GETROBUST)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_SETROBUST''@|$(HAVE_PTHREAD_MUTEXATTR_SETROBUST)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_DESTROY''@|$(HAVE_PTHREAD_MUTEXATTR_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_LOCK''@|$(HAVE_PTHREAD_MUTEX_LOCK)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_TRYLOCK''@|$(HAVE_PTHREAD_MUTEX_TRYLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_TIMEDLOCK''@|$(HAVE_PTHREAD_MUTEX_TIMEDLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_UNLOCK''@|$(HAVE_PTHREAD_MUTEX_UNLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_DESTROY''@|$(HAVE_PTHREAD_MUTEX_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_INIT''@|$(HAVE_PTHREAD_RWLOCK_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCKATTR_INIT''@|$(HAVE_PTHREAD_RWLOCKATTR_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCKATTR_DESTROY''@|$(HAVE_PTHREAD_RWLOCKATTR_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_RDLOCK''@|$(HAVE_PTHREAD_RWLOCK_RDLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_WRLOCK''@|$(HAVE_PTHREAD_RWLOCK_WRLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_TRYRDLOCK''@|$(HAVE_PTHREAD_RWLOCK_TRYRDLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_TRYWRLOCK''@|$(HAVE_PTHREAD_RWLOCK_TRYWRLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK''@|$(HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK''@|$(HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_UNLOCK''@|$(HAVE_PTHREAD_RWLOCK_UNLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_DESTROY''@|$(HAVE_PTHREAD_RWLOCK_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_COND_INIT''@|$(HAVE_PTHREAD_COND_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_CONDATTR_INIT''@|$(HAVE_PTHREAD_CONDATTR_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_CONDATTR_DESTROY''@|$(HAVE_PTHREAD_CONDATTR_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_COND_WAIT''@|$(HAVE_PTHREAD_COND_WAIT)|g' \ + -e 's|@''HAVE_PTHREAD_COND_TIMEDWAIT''@|$(HAVE_PTHREAD_COND_TIMEDWAIT)|g' \ + -e 's|@''HAVE_PTHREAD_COND_SIGNAL''@|$(HAVE_PTHREAD_COND_SIGNAL)|g' \ + -e 's|@''HAVE_PTHREAD_COND_BROADCAST''@|$(HAVE_PTHREAD_COND_BROADCAST)|g' \ + -e 's|@''HAVE_PTHREAD_COND_DESTROY''@|$(HAVE_PTHREAD_COND_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_KEY_CREATE''@|$(HAVE_PTHREAD_KEY_CREATE)|g' \ + -e 's|@''HAVE_PTHREAD_SETSPECIFIC''@|$(HAVE_PTHREAD_SETSPECIFIC)|g' \ + -e 's|@''HAVE_PTHREAD_GETSPECIFIC''@|$(HAVE_PTHREAD_GETSPECIFIC)|g' \ + -e 's|@''HAVE_PTHREAD_KEY_DELETE''@|$(HAVE_PTHREAD_KEY_DELETE)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_INIT''@|$(HAVE_PTHREAD_SPIN_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_LOCK''@|$(HAVE_PTHREAD_SPIN_LOCK)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_TRYLOCK''@|$(HAVE_PTHREAD_SPIN_TRYLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_UNLOCK''@|$(HAVE_PTHREAD_SPIN_UNLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_DESTROY''@|$(HAVE_PTHREAD_SPIN_DESTROY)|g' \ + < $(srcdir)/pthread.in.h | \ + sed -e 's|@''REPLACE_PTHREAD_CREATE''@|$(REPLACE_PTHREAD_CREATE)|g' \ + -e 's|@''REPLACE_PTHREAD_ATTR_INIT''@|$(REPLACE_PTHREAD_ATTR_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_ATTR_GETDETACHSTATE''@|$(REPLACE_PTHREAD_ATTR_GETDETACHSTATE)|g' \ + -e 's|@''REPLACE_PTHREAD_ATTR_SETDETACHSTATE''@|$(REPLACE_PTHREAD_ATTR_SETDETACHSTATE)|g' \ + -e 's|@''REPLACE_PTHREAD_ATTR_DESTROY''@|$(REPLACE_PTHREAD_ATTR_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_SELF''@|$(REPLACE_PTHREAD_SELF)|g' \ + -e 's|@''REPLACE_PTHREAD_EQUAL''@|$(REPLACE_PTHREAD_EQUAL)|g' \ + -e 's|@''REPLACE_PTHREAD_DETACH''@|$(REPLACE_PTHREAD_DETACH)|g' \ + -e 's|@''REPLACE_PTHREAD_JOIN''@|$(REPLACE_PTHREAD_JOIN)|g' \ + -e 's|@''REPLACE_PTHREAD_EXIT''@|$(REPLACE_PTHREAD_EXIT)|g' \ + -e 's|@''REPLACE_PTHREAD_ONCE''@|$(REPLACE_PTHREAD_ONCE)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_INIT''@|$(REPLACE_PTHREAD_MUTEX_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_INIT''@|$(REPLACE_PTHREAD_MUTEXATTR_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_GETTYPE''@|$(REPLACE_PTHREAD_MUTEXATTR_GETTYPE)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_SETTYPE''@|$(REPLACE_PTHREAD_MUTEXATTR_SETTYPE)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_GETROBUST''@|$(REPLACE_PTHREAD_MUTEXATTR_GETROBUST)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_SETROBUST''@|$(REPLACE_PTHREAD_MUTEXATTR_SETROBUST)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_DESTROY''@|$(REPLACE_PTHREAD_MUTEXATTR_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_LOCK''@|$(REPLACE_PTHREAD_MUTEX_LOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_TRYLOCK''@|$(REPLACE_PTHREAD_MUTEX_TRYLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_TIMEDLOCK''@|$(REPLACE_PTHREAD_MUTEX_TIMEDLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_UNLOCK''@|$(REPLACE_PTHREAD_MUTEX_UNLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_DESTROY''@|$(REPLACE_PTHREAD_MUTEX_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_INIT''@|$(REPLACE_PTHREAD_RWLOCK_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCKATTR_INIT''@|$(REPLACE_PTHREAD_RWLOCKATTR_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCKATTR_DESTROY''@|$(REPLACE_PTHREAD_RWLOCKATTR_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_RDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_RDLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_WRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_WRLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_TRYRDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TRYRDLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_TRYWRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TRYWRLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_UNLOCK''@|$(REPLACE_PTHREAD_RWLOCK_UNLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_DESTROY''@|$(REPLACE_PTHREAD_RWLOCK_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_INIT''@|$(REPLACE_PTHREAD_COND_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_CONDATTR_INIT''@|$(REPLACE_PTHREAD_CONDATTR_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_CONDATTR_DESTROY''@|$(REPLACE_PTHREAD_CONDATTR_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_WAIT''@|$(REPLACE_PTHREAD_COND_WAIT)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_TIMEDWAIT''@|$(REPLACE_PTHREAD_COND_TIMEDWAIT)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_SIGNAL''@|$(REPLACE_PTHREAD_COND_SIGNAL)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_BROADCAST''@|$(REPLACE_PTHREAD_COND_BROADCAST)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_DESTROY''@|$(REPLACE_PTHREAD_COND_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_KEY_CREATE''@|$(REPLACE_PTHREAD_KEY_CREATE)|g' \ + -e 's|@''REPLACE_PTHREAD_SETSPECIFIC''@|$(REPLACE_PTHREAD_SETSPECIFIC)|g' \ + -e 's|@''REPLACE_PTHREAD_GETSPECIFIC''@|$(REPLACE_PTHREAD_GETSPECIFIC)|g' \ + -e 's|@''REPLACE_PTHREAD_KEY_DELETE''@|$(REPLACE_PTHREAD_KEY_DELETE)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_INIT''@|$(REPLACE_PTHREAD_SPIN_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_LOCK''@|$(REPLACE_PTHREAD_SPIN_LOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_TRYLOCK''@|$(REPLACE_PTHREAD_SPIN_TRYLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_UNLOCK''@|$(REPLACE_PTHREAD_SPIN_UNLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_DESTROY''@|$(REPLACE_PTHREAD_SPIN_DESTROY)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _Noreturn/r $(_NORETURN_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += pthread.h pthread.h-t + +EXTRA_DIST += pthread.in.h + +## end gnulib module pthread-h + +## begin gnulib module pthread-h-tests + +TESTS += test-pthread +check_PROGRAMS += test-pthread +EXTRA_DIST += test-pthread.c + +## end gnulib module pthread-h-tests + +## begin gnulib module pthread-thread + + +EXTRA_DIST += pthread-thread.c + +EXTRA_libtests_a_SOURCES += pthread-thread.c + +## end gnulib module pthread-thread + +## begin gnulib module pthread-thread-tests + +TESTS += test-pthread-thread +check_PROGRAMS += test-pthread-thread +test_pthread_thread_LDADD = $(LDADD) @LIBPMULTITHREAD@ +EXTRA_DIST += test-pthread-thread.c macros.h + +## end gnulib module pthread-thread-tests + +## begin gnulib module pthread_sigmask + + +EXTRA_DIST += pthread_sigmask.c + +EXTRA_libtests_a_SOURCES += pthread_sigmask.c + +## end gnulib module pthread_sigmask + +## begin gnulib module pthread_sigmask-tests + +TESTS += test-pthread_sigmask1 test-pthread_sigmask2 +check_PROGRAMS += test-pthread_sigmask1 test-pthread_sigmask2 +test_pthread_sigmask1_LDADD = $(LDADD) @LIB_PTHREAD_SIGMASK@ +test_pthread_sigmask2_LDADD = $(LDADD) @LIB_PTHREAD_SIGMASK@ @LIBMULTITHREAD@ +EXTRA_DIST += test-pthread_sigmask1.c test-pthread_sigmask2.c signature.h macros.h + +## end gnulib module pthread_sigmask-tests + ## begin gnulib module putenv @@ -1202,7 +1360,7 @@ EXTRA_libtests_a_SOURCES += putenv.c TESTS += test-quotearg-simple check_PROGRAMS += test-quotearg-simple -test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@ +test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC) EXTRA_DIST += test-quotearg-simple.c test-quotearg.h macros.h zerosize-ptr.h ## end gnulib module quotearg-simple-tests @@ -1270,7 +1428,7 @@ EXTRA_libtests_a_SOURCES += realloc.c TESTS += test-regex check_PROGRAMS += test-regex -test_regex_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD) $(LIB_PTHREAD) +test_regex_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC) @LIBINTL@ $(LIBTHREAD) EXTRA_DIST += test-regex.c macros.h ## end gnulib module regex-tests @@ -1291,6 +1449,45 @@ EXTRA_DIST += test-rmdir.h test-rmdir.c signature.h macros.h ## end gnulib module rmdir-tests +## begin gnulib module sched + +BUILT_SOURCES += sched.h + +# We need the following in order to create a replacement for <sched.h> when +# the system doesn't have one. +sched.h: sched.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_SCHED_H''@|$(HAVE_SCHED_H)|g' \ + -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SCHED_H''@|$(NEXT_SCHED_H)|g' \ + -e 's|@''HAVE_STRUCT_SCHED_PARAM''@|$(HAVE_STRUCT_SCHED_PARAM)|g' \ + -e 's/@''GNULIB_SCHED_YIELD''@/$(GNULIB_SCHED_YIELD)/g' \ + -e 's|@''HAVE_SCHED_YIELD''@|$(HAVE_SCHED_YIELD)|g' \ + -e 's|@''REPLACE_SCHED_YIELD''@|$(REPLACE_SCHED_YIELD)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sched.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sched.h sched.h-t + +EXTRA_DIST += sched.in.h + +## end gnulib module sched + +## begin gnulib module sched-tests + +TESTS += test-sched +check_PROGRAMS += test-sched +EXTRA_DIST += test-sched.c + +## end gnulib module sched-tests + ## begin gnulib module select @@ -1338,6 +1535,23 @@ EXTRA_libtests_a_SOURCES += setlocale.c ## end gnulib module setlocale +## begin gnulib module setlocale-null-tests + +TESTS += \ + test-setlocale_null \ + test-setlocale_null-mt-one \ + test-setlocale_null-mt-all +check_PROGRAMS += \ + test-setlocale_null \ + test-setlocale_null-mt-one \ + test-setlocale_null-mt-all +test_setlocale_null_LDADD = $(LDADD) @LIB_SETLOCALE_NULL@ +test_setlocale_null_mt_one_LDADD = $(LDADD) @LIB_SETLOCALE_NULL@ $(LIBMULTITHREAD) $(LIB_NANOSLEEP) +test_setlocale_null_mt_all_LDADD = $(LDADD) @LIB_SETLOCALE_NULL@ $(LIBMULTITHREAD) $(LIB_NANOSLEEP) +EXTRA_DIST += test-setlocale_null.c test-setlocale_null-mt-one.c test-setlocale_null-mt-all.c + +## end gnulib module setlocale-null-tests + ## begin gnulib module setlocale-tests TESTS += test-setlocale1.sh test-setlocale2.sh @@ -1347,6 +1561,8 @@ TESTS_ENVIRONMENT += \ LOCALE_JA='@LOCALE_JA@' \ LOCALE_ZH_CN='@LOCALE_ZH_CN@' check_PROGRAMS += test-setlocale1 test-setlocale2 +test_setlocale1_LDADD = $(LDADD) @LIB_SETLOCALE@ +test_setlocale2_LDADD = $(LDADD) @LIB_SETLOCALE@ EXTRA_DIST += test-setlocale1.sh test-setlocale1.c test-setlocale2.sh test-setlocale2.c signature.h macros.h ## end gnulib module setlocale-tests @@ -1898,6 +2114,22 @@ EXTRA_DIST += test-init.sh ## end gnulib module test-framework-sh-tests +## begin gnulib module thread + +libtests_a_SOURCES += glthread/thread.h glthread/thread.c + +## end gnulib module thread + +## begin gnulib module thread-tests + +TESTS += test-thread_self test-thread_create +check_PROGRAMS += test-thread_self test-thread_create +test_thread_self_LDADD = $(LDADD) @LIBTHREAD@ +test_thread_create_LDADD = $(LDADD) @LIBMULTITHREAD@ +EXTRA_DIST += test-thread_self.c test-thread_create.c macros.h + +## end gnulib module thread-tests + ## begin gnulib module time-tests TESTS += test-time @@ -1987,15 +2219,16 @@ EXTRA_DIST += test-wchar.c TESTS += \ test-wcrtomb.sh \ test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh \ - test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh + test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh test-wcrtomb-w32-6.sh \ + test-wcrtomb-w32-7.sh TESTS_ENVIRONMENT += \ LOCALE_FR='@LOCALE_FR@' \ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ LOCALE_JA='@LOCALE_JA@' \ LOCALE_ZH_CN='@LOCALE_ZH_CN@' check_PROGRAMS += test-wcrtomb test-wcrtomb-w32 - -EXTRA_DIST += test-wcrtomb.sh test-wcrtomb.c test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh test-wcrtomb-w32.c signature.h macros.h +test_wcrtomb_LDADD = $(LDADD) $(LIB_SETLOCALE) +EXTRA_DIST += test-wcrtomb.sh test-wcrtomb.c test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh test-wcrtomb-w32-6.sh test-wcrtomb-w32-7.sh test-wcrtomb-w32.c signature.h macros.h ## end gnulib module wcrtomb-tests @@ -2007,6 +2240,24 @@ EXTRA_DIST += test-wctype-h.c macros.h ## end gnulib module wctype-h-tests +## begin gnulib module windows-thread + + +EXTRA_DIST += windows-thread.c windows-thread.h + +EXTRA_libtests_a_SOURCES += windows-thread.c + +## end gnulib module windows-thread + +## begin gnulib module windows-tls + + +EXTRA_DIST += windows-tls.c windows-tls.h + +EXTRA_libtests_a_SOURCES += windows-tls.c + +## end gnulib module windows-tls + ## begin gnulib module xalloc-die-tests TESTS += test-xalloc-die.sh diff --git a/gnulib-tests/inet_pton.c b/gnulib-tests/inet_pton.c index c10b6f2..3e392fc 100644 --- a/gnulib-tests/inet_pton.c +++ b/gnulib-tests/inet_pton.c @@ -1,6 +1,6 @@ /* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form - Copyright (C) 2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2006, 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/init.sh b/gnulib-tests/init.sh index 93d14f5..b4a5944 100644 --- a/gnulib-tests/init.sh +++ b/gnulib-tests/init.sh @@ -1,6 +1,6 @@ # source this file; set up for tests -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2020 Free Software Foundation, Inc. # 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 @@ -60,6 +60,9 @@ # 4. Finally # $ exit +# ============================================================================= +# Elementary diagnostics + ME_=`expr "./$0" : '.*/\(.*\)$'` # Prepare PATH_SEPARATOR. @@ -109,26 +112,8 @@ skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; } fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; } framework_failure_ () { warn_ "$ME_: set-up failure: $@"; Exit 99; } -# This is used to simplify checking of the return value -# which is useful when ensuring a command fails as desired. -# I.e., just doing `command ... &&fail=1` will not catch -# a segfault in command for example. With this helper you -# instead check an explicit exit code like -# returns_ 1 command ... || fail -returns_ () { - # Disable tracing so it doesn't interfere with stderr of the wrapped command - { set +x; } 2>/dev/null - - local exp_exit="$1" - shift - "$@" - test $? -eq $exp_exit && ret_=0 || ret_=1 - - if test "$VERBOSE" = yes && test "$gl_set_x_corrupts_stderr_" = false; then - set -x - fi - { return $ret_; } 2>/dev/null -} +# ============================================================================= +# Ensure the shell supports modern syntax. # Sanitize this shell to POSIX mode, if possible. DUALCASE=1; export DUALCASE @@ -144,6 +129,8 @@ else fi # We require $(...) support unconditionally. +# We require that the printf built-in work correctly regarding octal escapes; +# this eliminates /bin/sh on AIX 7.2. # We require non-surprising "local" semantics (this eliminates dash). # This takes the admittedly draconian step of eliminating dash, because the # assignment tab=$(printf '\t') works fine, yet preceding it with "local " @@ -173,6 +160,12 @@ fi # ? - not ok gl_shell_test_script_=' test $(echo y) = y || exit 1 +LC_ALL=en_US.UTF-8 printf "\\351" 2>/dev/null \ + | LC_ALL=C tr "\\351" x | LC_ALL=C grep "^x$" > /dev/null \ + || exit 1 +printf "\\351" 2>/dev/null \ + | LC_ALL=C tr "\\351" x | LC_ALL=C grep "^x$" > /dev/null \ + || exit 1 f_local_() { local v=1; }; f_local_ || exit 1 f_dash_local_fail_() { local t=$(printf " 1"); }; f_dash_local_fail_ score_=10 @@ -255,6 +248,9 @@ else fi fi +# ============================================================================= +# Ensure the shell behaves reasonably. + # If this is bash, turn off all aliases. test -n "$BASH_VERSION" && unalias -a @@ -265,99 +261,177 @@ test -n "$BASH_VERSION" && unalias -a # widespread than that for hyphen-containing function names. test -n "$EXEEXT" && test -n "$BASH_VERSION" && shopt -s expand_aliases -# Enable glibc's malloc-perturbing option. -# This is useful for exposing code that depends on the fact that -# malloc-related functions often return memory that is mostly zeroed. -# If you have the time and cycles, use valgrind to do an even better job. -: ${MALLOC_PERTURB_=87} -export MALLOC_PERTURB_ +# ============================================================================= +# Creating a temporary directory (needed by the core test framework) -# This is a stub function that is run upon trap (upon regular exit and -# interrupt). Override it with a per-test function, e.g., to unmount -# a partition, or to undo any other global state changes. -cleanup_ () { :; } +# Create a temporary directory, much like mktemp -d does. +# Written by Jim Meyering. +# +# Usage: mktempd_ /tmp phoey.XXXXXXXXXX +# +# First, try to use the mktemp program. +# Failing that, we'll roll our own mktemp-like function: +# - try to get random bytes from /dev/urandom +# - failing that, generate output from a combination of quickly-varying +# sources and gzip. Ignore non-varying gzip header, and extract +# "random" bits from there. +# - given those bits, map to file-name bytes using tr, and try to create +# the desired directory. +# - make only $MAX_TRIES_ attempts -# Emit a header similar to that from diff -u; Print the simulated "diff" -# command so that the order of arguments is clear. Don't bother with @@ lines. -emit_diff_u_header_ () +# Helper function. Print $N pseudo-random bytes from a-zA-Z0-9. +rand_bytes_ () { - printf '%s\n' "diff -u $*" \ - "--- $1 1970-01-01" \ - "+++ $2 1970-01-01" + n_=$1 + + # Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first? + # But if they have openssl, they probably have mktemp, too. + + chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 + dev_rand_=/dev/urandom + if test -r "$dev_rand_"; then + # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194. + dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \ + | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ + return + fi + + n_plus_50_=`expr $n_ + 50` + cmds_='date; date +%N; free; who -a; w; ps auxww; ps -ef' + data_=` (eval "$cmds_") 2>&1 | gzip ` + + # Ensure that $data_ has length at least 50+$n_ + while :; do + len_=`echo "$data_"|wc -c` + test $n_plus_50_ -le $len_ && break; + data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip ` + done + + echo "$data_" \ + | dd bs=1 skip=50 count=$n_ 2>/dev/null \ + | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ } -# Arrange not to let diff or cmp operate on /dev/null, -# since on some systems (at least OSF/1 5.1), that doesn't work. -# When there are not two arguments, or no argument is /dev/null, return 2. -# When one argument is /dev/null and the other is not empty, -# cat the nonempty file to stderr and return 1. -# Otherwise, return 0. -compare_dev_null_ () +mktempd_ () { - test $# = 2 || return 2 + case $# in + 2);; + *) fail_ "Usage: mktempd_ DIR TEMPLATE";; + esac - if test "x$1" = x/dev/null; then - test -s "$2" || return 0 - emit_diff_u_header_ "$@"; sed 's/^/+/' "$2" - return 1 - fi + destdir_=$1 + template_=$2 - if test "x$2" = x/dev/null; then - test -s "$1" || return 0 - emit_diff_u_header_ "$@"; sed 's/^/-/' "$1" - return 1 - fi + MAX_TRIES_=4 - return 2 + # Disallow any trailing slash on specified destdir: + # it would subvert the post-mktemp "case"-based destdir test. + case $destdir_ in + / | //) destdir_slash_=$destdir;; + */) fail_ "invalid destination dir: remove trailing slash(es)";; + *) destdir_slash_=$destdir_/;; + esac + + case $template_ in + *XXXX) ;; + *) fail_ \ + "invalid template: $template_ (must have a suffix of at least 4 X's)";; + esac + + # First, try to use mktemp. + d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` && + + # The resulting name must be in the specified directory. + case $d in "$destdir_slash_"*) :;; *) false;; esac && + + # It must have created the directory. + test -d "$d" && + + # It must have 0700 permissions. Handle sticky "S" bits. + perms=`ls -dgo "$d" 2>/dev/null` && + case $perms in drwx--[-S]---*) :;; *) false;; esac && { + echo "$d" + return + } + + # If we reach this point, we'll have to create a directory manually. + + # Get a copy of the template without its suffix of X's. + base_template_=`echo "$template_"|sed 's/XX*$//'` + + # Calculate how many X's we've just removed. + template_length_=`echo "$template_" | wc -c` + nx_=`echo "$base_template_" | wc -c` + nx_=`expr $template_length_ - $nx_` + + err_= + i_=1 + while :; do + X_=`rand_bytes_ $nx_` + candidate_dir_="$destdir_slash_$base_template_$X_" + err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \ + && { echo "$candidate_dir_"; return; } + test $MAX_TRIES_ -le $i_ && break; + i_=`expr $i_ + 1` + done + fail_ "$err_" } -for diff_opt_ in -u -U3 -c '' no; do - test "$diff_opt_" != no && - diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` && - break -done -if test "$diff_opt_" != no; then - if test -z "$diff_out_"; then - compare_ () { diff $diff_opt_ "$@"; } - else - compare_ () - { - # If no differences were found, AIX and HP-UX 'diff' produce output - # like "No differences encountered". Hide this output. - diff $diff_opt_ "$@" > diff.out - diff_status_=$? - test $diff_status_ -eq 0 || cat diff.out || diff_status_=2 - rm -f diff.out || diff_status_=2 - return $diff_status_ - } - fi -elif cmp -s /dev/null /dev/null 2>/dev/null; then - compare_ () { cmp -s "$@"; } -else - compare_ () { cmp "$@"; } -fi +# ============================================================================= +# Core test framework -# Usage: compare EXPECTED ACTUAL -# -# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more. -# Otherwise, propagate $? to caller: any diffs have already been printed. -compare () +# An arbitrary prefix to help distinguish test directories. +testdir_prefix_ () { printf gt; } + +# Set up the environment for the test to run in. +setup_ () { - # This looks like it can be factored to use a simple "case $?" - # after unchecked compare_dev_null_ invocation, but that would - # fail in a "set -e" environment. - if compare_dev_null_ "$@"; then - return 0 - else - case $? in - 1) return 1;; - *) compare_ "$@";; - esac + if test "$VERBOSE" = yes; then + # Test whether set -x may cause the selected shell to corrupt an + # application's stderr. Many do, including zsh-4.3.10 and the /bin/sh + # from SunOS 5.11, OpenBSD 4.7 and Irix 5.x and 6.5. + # If enabling verbose output this way would cause trouble, simply + # issue a warning and refrain. + if $gl_set_x_corrupts_stderr_; then + warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr" + else + set -x + fi fi + + initial_cwd_=$PWD + + # Create and enter the temporary directory. + pfx_=`testdir_prefix_` + test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ + || fail_ "failed to create temporary directory in $initial_cwd_" + cd "$test_dir_" || fail_ "failed to cd to temporary directory" + # Set variables srcdir, builddir, for the convenience of the test. + case $srcdir in + /* | ?:*) ;; + *) srcdir="../$srcdir" ;; + esac + builddir=".." + export srcdir builddir + + # As autoconf-generated configure scripts do, ensure that IFS + # is defined initially, so that saving and restoring $IFS works. + gl_init_sh_nl_=' +' + IFS=" "" $gl_init_sh_nl_" + + # This trap statement, along with a trap on 0 below, ensure that the + # temporary directory, $test_dir_, is removed upon exit as well as + # upon receipt of any of the listed signals. + for sig_ in 1 2 3 13 15; do + eval "trap 'Exit $(expr $sig_ + 128)' $sig_" + done } -# An arbitrary prefix to help distinguish test directories. -testdir_prefix_ () { printf gt; } +# This is a stub function that is run upon trap (upon regular exit and +# interrupt). Override it with a per-test function, e.g., to unmount +# a partition, or to undo any other global state changes. +cleanup_ () { :; } # Run the user-overridable cleanup_ function, remove the temporary # directory and exit with the incoming value of $?. @@ -377,6 +451,9 @@ remove_tmp_ () exit $__st } +# ============================================================================= +# Prepending directories to PATH + # Given a directory name, DIR, if every entry in it that matches *.exe # contains only the specified bytes (see the case stmt below), then print # a space-separated list of those names and return 0. Otherwise, don't @@ -458,160 +535,148 @@ path_prepend_ () export PATH } -setup_ () -{ - if test "$VERBOSE" = yes; then - # Test whether set -x may cause the selected shell to corrupt an - # application's stderr. Many do, including zsh-4.3.10 and the /bin/sh - # from SunOS 5.11, OpenBSD 4.7 and Irix 5.x and 6.5. - # If enabling verbose output this way would cause trouble, simply - # issue a warning and refrain. - if $gl_set_x_corrupts_stderr_; then - warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr" - else - set -x - fi - fi +# ============================================================================= +# Convenience environment variables for the tests - initial_cwd_=$PWD +# ----------------------------------------------------------------------------- - pfx_=`testdir_prefix_` - test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ - || fail_ "failed to create temporary directory in $initial_cwd_" - cd "$test_dir_" || fail_ "failed to cd to temporary directory" +# Enable glibc's malloc-perturbing option. +# This is useful for exposing code that depends on the fact that +# malloc-related functions often return memory that is mostly zeroed. +# If you have the time and cycles, use valgrind to do an even better job. +: ${MALLOC_PERTURB_=87} +export MALLOC_PERTURB_ - # As autoconf-generated configure scripts do, ensure that IFS - # is defined initially, so that saving and restoring $IFS works. - gl_init_sh_nl_=' -' - IFS=" "" $gl_init_sh_nl_" +# ----------------------------------------------------------------------------- - # This trap statement, along with a trap on 0 below, ensure that the - # temporary directory, $test_dir_, is removed upon exit as well as - # upon receipt of any of the listed signals. - for sig_ in 1 2 3 13 15; do - eval "trap 'Exit $(expr $sig_ + 128)' $sig_" - done -} +# The interpreter for Bourne-shell scripts. +# No special standards compatibility requirements. +# Some environments, such as Android, don't have /bin/sh. +if test -f /bin/sh$EXEEXT; then + BOURNE_SHELL=/bin/sh +else + BOURNE_SHELL=sh +fi -# Create a temporary directory, much like mktemp -d does. -# Written by Jim Meyering. -# -# Usage: mktempd_ /tmp phoey.XXXXXXXXXX -# -# First, try to use the mktemp program. -# Failing that, we'll roll our own mktemp-like function: -# - try to get random bytes from /dev/urandom -# - failing that, generate output from a combination of quickly-varying -# sources and gzip. Ignore non-varying gzip header, and extract -# "random" bits from there. -# - given those bits, map to file-name bytes using tr, and try to create -# the desired directory. -# - make only $MAX_TRIES_ attempts +# ============================================================================= +# Convenience functions for the tests -# Helper function. Print $N pseudo-random bytes from a-zA-Z0-9. -rand_bytes_ () -{ - n_=$1 +# ----------------------------------------------------------------------------- +# Return value checking - # Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first? - # But if they have openssl, they probably have mktemp, too. +# This is used to simplify checking of the return value +# which is useful when ensuring a command fails as desired. +# I.e., just doing `command ... &&fail=1` will not catch +# a segfault in command for example. With this helper you +# instead check an explicit exit code like +# returns_ 1 command ... || fail +returns_ () { + # Disable tracing so it doesn't interfere with stderr of the wrapped command + { set +x; } 2>/dev/null - chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 - dev_rand_=/dev/urandom - if test -r "$dev_rand_"; then - # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194. - dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \ - | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ - return - fi + local exp_exit="$1" + shift + "$@" + test $? -eq $exp_exit && ret_=0 || ret_=1 - n_plus_50_=`expr $n_ + 50` - cmds_='date; date +%N; free; who -a; w; ps auxww; ps -ef' - data_=` (eval "$cmds_") 2>&1 | gzip ` + if test "$VERBOSE" = yes && test "$gl_set_x_corrupts_stderr_" = false; then + set -x + fi + { return $ret_; } 2>/dev/null +} - # Ensure that $data_ has length at least 50+$n_ - while :; do - len_=`echo "$data_"|wc -c` - test $n_plus_50_ -le $len_ && break; - data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip ` - done +# ----------------------------------------------------------------------------- +# Text file comparison - echo "$data_" \ - | dd bs=1 skip=50 count=$n_ 2>/dev/null \ - | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ +# Emit a header similar to that from diff -u; Print the simulated "diff" +# command so that the order of arguments is clear. Don't bother with @@ lines. +emit_diff_u_header_ () +{ + printf '%s\n' "diff -u $*" \ + "--- $1 1970-01-01" \ + "+++ $2 1970-01-01" } -mktempd_ () +# Arrange not to let diff or cmp operate on /dev/null, +# since on some systems (at least OSF/1 5.1), that doesn't work. +# When there are not two arguments, or no argument is /dev/null, return 2. +# When one argument is /dev/null and the other is not empty, +# cat the nonempty file to stderr and return 1. +# Otherwise, return 0. +compare_dev_null_ () { - case $# in - 2);; - *) fail_ "Usage: mktempd_ DIR TEMPLATE";; - esac - - destdir_=$1 - template_=$2 - - MAX_TRIES_=4 - - # Disallow any trailing slash on specified destdir: - # it would subvert the post-mktemp "case"-based destdir test. - case $destdir_ in - / | //) destdir_slash_=$destdir;; - */) fail_ "invalid destination dir: remove trailing slash(es)";; - *) destdir_slash_=$destdir_/;; - esac - - case $template_ in - *XXXX) ;; - *) fail_ \ - "invalid template: $template_ (must have a suffix of at least 4 X's)";; - esac - - # First, try to use mktemp. - d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` && - - # The resulting name must be in the specified directory. - case $d in "$destdir_slash_"*) :;; *) false;; esac && - - # It must have created the directory. - test -d "$d" && + test $# = 2 || return 2 - # It must have 0700 permissions. Handle sticky "S" bits. - perms=`ls -dgo "$d" 2>/dev/null` && - case $perms in drwx--[-S]---*) :;; *) false;; esac && { - echo "$d" - return - } + if test "x$1" = x/dev/null; then + test -s "$2" || return 0 + emit_diff_u_header_ "$@"; sed 's/^/+/' "$2" + return 1 + fi - # If we reach this point, we'll have to create a directory manually. + if test "x$2" = x/dev/null; then + test -s "$1" || return 0 + emit_diff_u_header_ "$@"; sed 's/^/-/' "$1" + return 1 + fi - # Get a copy of the template without its suffix of X's. - base_template_=`echo "$template_"|sed 's/XX*$//'` + return 2 +} - # Calculate how many X's we've just removed. - template_length_=`echo "$template_" | wc -c` - nx_=`echo "$base_template_" | wc -c` - nx_=`expr $template_length_ - $nx_` +for diff_opt_ in -u -U3 -c '' no; do + test "$diff_opt_" != no && + diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` && + break +done +if test "$diff_opt_" != no; then + if test -z "$diff_out_"; then + compare_ () { diff $diff_opt_ "$@"; } + else + compare_ () + { + # If no differences were found, AIX and HP-UX 'diff' produce output + # like "No differences encountered". Hide this output. + diff $diff_opt_ "$@" > diff.out + diff_status_=$? + test $diff_status_ -eq 0 || cat diff.out || diff_status_=2 + rm -f diff.out || diff_status_=2 + return $diff_status_ + } + fi +elif cmp -s /dev/null /dev/null 2>/dev/null; then + compare_ () { cmp -s "$@"; } +else + compare_ () { cmp "$@"; } +fi - err_= - i_=1 - while :; do - X_=`rand_bytes_ $nx_` - candidate_dir_="$destdir_slash_$base_template_$X_" - err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \ - && { echo "$candidate_dir_"; return; } - test $MAX_TRIES_ -le $i_ && break; - i_=`expr $i_ + 1` - done - fail_ "$err_" +# Usage: compare EXPECTED ACTUAL +# +# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more. +# Otherwise, propagate $? to caller: any diffs have already been printed. +compare () +{ + # This looks like it can be factored to use a simple "case $?" + # after unchecked compare_dev_null_ invocation, but that would + # fail in a "set -e" environment. + if compare_dev_null_ "$@"; then + return 0 + else + case $? in + 1) return 1;; + *) compare_ "$@";; + esac + fi } +# ----------------------------------------------------------------------------- + # If you want to override the testdir_prefix_ function, # or to add more utility functions, use this file. test -f "$srcdir/init.cfg" \ && . "$srcdir/init.cfg" +# ============================================================================= +# Set up the environment for the test to run in. + setup_ "$@" # This trap is here, rather than in the setup_ function, because some # shells run the exit trap at shell function exit, rather than script exit. diff --git a/gnulib-tests/inttypes.in.h b/gnulib-tests/inttypes.in.h deleted file mode 100644 index c7d7968..0000000 --- a/gnulib-tests/inttypes.in.h +++ /dev/null @@ -1,1146 +0,0 @@ -/* Copyright (C) 2006-2018 Free Software Foundation, Inc. - Written by Paul Eggert, Bruno Haible, Derek Price. - This file is part of gnulib. - - 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 3 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, see <https://www.gnu.org/licenses/>. */ - -/* - * ISO C 99 <inttypes.h> for platforms that lack it. - * <http://www.opengroup.org/susv3xbd/inttypes.h.html> - */ - -#if __GNUC__ >= 3 -@PRAGMA_SYSTEM_HEADER@ -#endif -@PRAGMA_COLUMNS@ - -/* Include the original <inttypes.h> if it exists, and if this file - has not been included yet or if this file includes gnulib stdint.h - which in turn includes this file. - The include_next requires a split double-inclusion guard. */ -#if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H -# if @HAVE_INTTYPES_H@ - - /* Some pre-C++11 <stdint.h> implementations need this. */ -# if defined __cplusplus && ! defined __STDC_FORMAT_MACROS -# define __STDC_FORMAT_MACROS 1 -# endif - -# @INCLUDE_NEXT@ @NEXT_INTTYPES_H@ -# endif -#endif - -#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H -#define INTTYPES_H - -/* Include <stdint.h> or the gnulib replacement. - But avoid namespace pollution on glibc systems. */ -#ifndef __GLIBC__ -# include <stdint.h> -#endif -/* Get CHAR_BIT. */ -#include <limits.h> -/* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */ -#if defined _WIN32 && ! defined __CYGWIN__ -# include <stdio.h> -#endif - -#if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX) -# error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to <bug-gnulib@gnu.org>." -#endif - -/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ - -/* The definition of _GL_ARG_NONNULL is copied here. */ - -/* The definition of _GL_WARN_ON_USE is copied here. */ - -/* 7.8.1 Macros for format specifiers */ - -#if defined _TNS_R_TARGET - /* Tandem NonStop R series and compatible platforms released before - July 2005 support %Ld but not %lld. */ -# define _LONG_LONG_FORMAT_PREFIX "L" -#else -# define _LONG_LONG_FORMAT_PREFIX "ll" -#endif - -#if !defined PRId8 || @PRI_MACROS_BROKEN@ -# undef PRId8 -# ifdef INT8_MAX -# define PRId8 "d" -# endif -#endif -#if !defined PRIi8 || @PRI_MACROS_BROKEN@ -# undef PRIi8 -# ifdef INT8_MAX -# define PRIi8 "i" -# endif -#endif -#if !defined PRIo8 || @PRI_MACROS_BROKEN@ -# undef PRIo8 -# ifdef UINT8_MAX -# define PRIo8 "o" -# endif -#endif -#if !defined PRIu8 || @PRI_MACROS_BROKEN@ -# undef PRIu8 -# ifdef UINT8_MAX -# define PRIu8 "u" -# endif -#endif -#if !defined PRIx8 || @PRI_MACROS_BROKEN@ -# undef PRIx8 -# ifdef UINT8_MAX -# define PRIx8 "x" -# endif -#endif -#if !defined PRIX8 || @PRI_MACROS_BROKEN@ -# undef PRIX8 -# ifdef UINT8_MAX -# define PRIX8 "X" -# endif -#endif -#if !defined PRId16 || @PRI_MACROS_BROKEN@ -# undef PRId16 -# ifdef INT16_MAX -# define PRId16 "d" -# endif -#endif -#if !defined PRIi16 || @PRI_MACROS_BROKEN@ -# undef PRIi16 -# ifdef INT16_MAX -# define PRIi16 "i" -# endif -#endif -#if !defined PRIo16 || @PRI_MACROS_BROKEN@ -# undef PRIo16 -# ifdef UINT16_MAX -# define PRIo16 "o" -# endif -#endif -#if !defined PRIu16 || @PRI_MACROS_BROKEN@ -# undef PRIu16 -# ifdef UINT16_MAX -# define PRIu16 "u" -# endif -#endif -#if !defined PRIx16 || @PRI_MACROS_BROKEN@ -# undef PRIx16 -# ifdef UINT16_MAX -# define PRIx16 "x" -# endif -#endif -#if !defined PRIX16 || @PRI_MACROS_BROKEN@ -# undef PRIX16 -# ifdef UINT16_MAX -# define PRIX16 "X" -# endif -#endif -#if !defined PRId32 || @PRI_MACROS_BROKEN@ -# undef PRId32 -# ifdef INT32_MAX -# define PRId32 "d" -# endif -#endif -#if !defined PRIi32 || @PRI_MACROS_BROKEN@ -# undef PRIi32 -# ifdef INT32_MAX -# define PRIi32 "i" -# endif -#endif -#if !defined PRIo32 || @PRI_MACROS_BROKEN@ -# undef PRIo32 -# ifdef UINT32_MAX -# define PRIo32 "o" -# endif -#endif -#if !defined PRIu32 || @PRI_MACROS_BROKEN@ -# undef PRIu32 -# ifdef UINT32_MAX -# define PRIu32 "u" -# endif -#endif -#if !defined PRIx32 || @PRI_MACROS_BROKEN@ -# undef PRIx32 -# ifdef UINT32_MAX -# define PRIx32 "x" -# endif -#endif -#if !defined PRIX32 || @PRI_MACROS_BROKEN@ -# undef PRIX32 -# ifdef UINT32_MAX -# define PRIX32 "X" -# endif -#endif -#ifdef INT64_MAX -# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@) -# define _PRI64_PREFIX "l" -# elif defined _MSC_VER || defined __MINGW32__ -# define _PRI64_PREFIX "I64" -# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX -# endif -# if !defined PRId64 || @PRI_MACROS_BROKEN@ -# undef PRId64 -# define PRId64 _PRI64_PREFIX "d" -# endif -# if !defined PRIi64 || @PRI_MACROS_BROKEN@ -# undef PRIi64 -# define PRIi64 _PRI64_PREFIX "i" -# endif -#endif -#ifdef UINT64_MAX -# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@) -# define _PRIu64_PREFIX "l" -# elif defined _MSC_VER || defined __MINGW32__ -# define _PRIu64_PREFIX "I64" -# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -# define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX -# endif -# if !defined PRIo64 || @PRI_MACROS_BROKEN@ -# undef PRIo64 -# define PRIo64 _PRIu64_PREFIX "o" -# endif -# if !defined PRIu64 || @PRI_MACROS_BROKEN@ -# undef PRIu64 -# define PRIu64 _PRIu64_PREFIX "u" -# endif -# if !defined PRIx64 || @PRI_MACROS_BROKEN@ -# undef PRIx64 -# define PRIx64 _PRIu64_PREFIX "x" -# endif -# if !defined PRIX64 || @PRI_MACROS_BROKEN@ -# undef PRIX64 -# define PRIX64 _PRIu64_PREFIX "X" -# endif -#endif - -#if !defined PRIdLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIdLEAST8 -# define PRIdLEAST8 "d" -#endif -#if !defined PRIiLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIiLEAST8 -# define PRIiLEAST8 "i" -#endif -#if !defined PRIoLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIoLEAST8 -# define PRIoLEAST8 "o" -#endif -#if !defined PRIuLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIuLEAST8 -# define PRIuLEAST8 "u" -#endif -#if !defined PRIxLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIxLEAST8 -# define PRIxLEAST8 "x" -#endif -#if !defined PRIXLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIXLEAST8 -# define PRIXLEAST8 "X" -#endif -#if !defined PRIdLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIdLEAST16 -# define PRIdLEAST16 "d" -#endif -#if !defined PRIiLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIiLEAST16 -# define PRIiLEAST16 "i" -#endif -#if !defined PRIoLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIoLEAST16 -# define PRIoLEAST16 "o" -#endif -#if !defined PRIuLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIuLEAST16 -# define PRIuLEAST16 "u" -#endif -#if !defined PRIxLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIxLEAST16 -# define PRIxLEAST16 "x" -#endif -#if !defined PRIXLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIXLEAST16 -# define PRIXLEAST16 "X" -#endif -#if !defined PRIdLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIdLEAST32 -# define PRIdLEAST32 "d" -#endif -#if !defined PRIiLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIiLEAST32 -# define PRIiLEAST32 "i" -#endif -#if !defined PRIoLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIoLEAST32 -# define PRIoLEAST32 "o" -#endif -#if !defined PRIuLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIuLEAST32 -# define PRIuLEAST32 "u" -#endif -#if !defined PRIxLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIxLEAST32 -# define PRIxLEAST32 "x" -#endif -#if !defined PRIXLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIXLEAST32 -# define PRIXLEAST32 "X" -#endif -#ifdef INT64_MAX -# if !defined PRIdLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIdLEAST64 -# define PRIdLEAST64 PRId64 -# endif -# if !defined PRIiLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIiLEAST64 -# define PRIiLEAST64 PRIi64 -# endif -#endif -#ifdef UINT64_MAX -# if !defined PRIoLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIoLEAST64 -# define PRIoLEAST64 PRIo64 -# endif -# if !defined PRIuLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIuLEAST64 -# define PRIuLEAST64 PRIu64 -# endif -# if !defined PRIxLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIxLEAST64 -# define PRIxLEAST64 PRIx64 -# endif -# if !defined PRIXLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIXLEAST64 -# define PRIXLEAST64 PRIX64 -# endif -#endif - -#if !defined PRIdFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIdFAST8 -# if INT_FAST8_MAX > INT32_MAX -# define PRIdFAST8 PRId64 -# else -# define PRIdFAST8 "d" -# endif -#endif -#if !defined PRIiFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIiFAST8 -# if INT_FAST8_MAX > INT32_MAX -# define PRIiFAST8 PRIi64 -# else -# define PRIiFAST8 "i" -# endif -#endif -#if !defined PRIoFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIoFAST8 -# if UINT_FAST8_MAX > UINT32_MAX -# define PRIoFAST8 PRIo64 -# else -# define PRIoFAST8 "o" -# endif -#endif -#if !defined PRIuFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIuFAST8 -# if UINT_FAST8_MAX > UINT32_MAX -# define PRIuFAST8 PRIu64 -# else -# define PRIuFAST8 "u" -# endif -#endif -#if !defined PRIxFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIxFAST8 -# if UINT_FAST8_MAX > UINT32_MAX -# define PRIxFAST8 PRIx64 -# else -# define PRIxFAST8 "x" -# endif -#endif -#if !defined PRIXFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIXFAST8 -# if UINT_FAST8_MAX > UINT32_MAX -# define PRIXFAST8 PRIX64 -# else -# define PRIXFAST8 "X" -# endif -#endif -#if !defined PRIdFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIdFAST16 -# if INT_FAST16_MAX > INT32_MAX -# define PRIdFAST16 PRId64 -# else -# define PRIdFAST16 "d" -# endif -#endif -#if !defined PRIiFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIiFAST16 -# if INT_FAST16_MAX > INT32_MAX -# define PRIiFAST16 PRIi64 -# else -# define PRIiFAST16 "i" -# endif -#endif -#if !defined PRIoFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIoFAST16 -# if UINT_FAST16_MAX > UINT32_MAX -# define PRIoFAST16 PRIo64 -# else -# define PRIoFAST16 "o" -# endif -#endif -#if !defined PRIuFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIuFAST16 -# if UINT_FAST16_MAX > UINT32_MAX -# define PRIuFAST16 PRIu64 -# else -# define PRIuFAST16 "u" -# endif -#endif -#if !defined PRIxFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIxFAST16 -# if UINT_FAST16_MAX > UINT32_MAX -# define PRIxFAST16 PRIx64 -# else -# define PRIxFAST16 "x" -# endif -#endif -#if !defined PRIXFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIXFAST16 -# if UINT_FAST16_MAX > UINT32_MAX -# define PRIXFAST16 PRIX64 -# else -# define PRIXFAST16 "X" -# endif -#endif -#if !defined PRIdFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIdFAST32 -# if INT_FAST32_MAX > INT32_MAX -# define PRIdFAST32 PRId64 -# else -# define PRIdFAST32 "d" -# endif -#endif -#if !defined PRIiFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIiFAST32 -# if INT_FAST32_MAX > INT32_MAX -# define PRIiFAST32 PRIi64 -# else -# define PRIiFAST32 "i" -# endif -#endif -#if !defined PRIoFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIoFAST32 -# if UINT_FAST32_MAX > UINT32_MAX -# define PRIoFAST32 PRIo64 -# else -# define PRIoFAST32 "o" -# endif -#endif -#if !defined PRIuFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIuFAST32 -# if UINT_FAST32_MAX > UINT32_MAX -# define PRIuFAST32 PRIu64 -# else -# define PRIuFAST32 "u" -# endif -#endif -#if !defined PRIxFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIxFAST32 -# if UINT_FAST32_MAX > UINT32_MAX -# define PRIxFAST32 PRIx64 -# else -# define PRIxFAST32 "x" -# endif -#endif -#if !defined PRIXFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIXFAST32 -# if UINT_FAST32_MAX > UINT32_MAX -# define PRIXFAST32 PRIX64 -# else -# define PRIXFAST32 "X" -# endif -#endif -#ifdef INT64_MAX -# if !defined PRIdFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIdFAST64 -# define PRIdFAST64 PRId64 -# endif -# if !defined PRIiFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIiFAST64 -# define PRIiFAST64 PRIi64 -# endif -#endif -#ifdef UINT64_MAX -# if !defined PRIoFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIoFAST64 -# define PRIoFAST64 PRIo64 -# endif -# if !defined PRIuFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIuFAST64 -# define PRIuFAST64 PRIu64 -# endif -# if !defined PRIxFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIxFAST64 -# define PRIxFAST64 PRIx64 -# endif -# if !defined PRIXFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIXFAST64 -# define PRIXFAST64 PRIX64 -# endif -#endif - -#if !defined PRIdMAX || @PRI_MACROS_BROKEN@ -# undef PRIdMAX -# if @INT32_MAX_LT_INTMAX_MAX@ -# define PRIdMAX PRId64 -# else -# define PRIdMAX "ld" -# endif -#endif -#if !defined PRIiMAX || @PRI_MACROS_BROKEN@ -# undef PRIiMAX -# if @INT32_MAX_LT_INTMAX_MAX@ -# define PRIiMAX PRIi64 -# else -# define PRIiMAX "li" -# endif -#endif -#if !defined PRIoMAX || @PRI_MACROS_BROKEN@ -# undef PRIoMAX -# if @UINT32_MAX_LT_UINTMAX_MAX@ -# define PRIoMAX PRIo64 -# else -# define PRIoMAX "lo" -# endif -#endif -#if !defined PRIuMAX || @PRI_MACROS_BROKEN@ -# undef PRIuMAX -# if @UINT32_MAX_LT_UINTMAX_MAX@ -# define PRIuMAX PRIu64 -# else -# define PRIuMAX "lu" -# endif -#endif -#if !defined PRIxMAX || @PRI_MACROS_BROKEN@ -# undef PRIxMAX -# if @UINT32_MAX_LT_UINTMAX_MAX@ -# define PRIxMAX PRIx64 -# else -# define PRIxMAX "lx" -# endif -#endif -#if !defined PRIXMAX || @PRI_MACROS_BROKEN@ -# undef PRIXMAX -# if @UINT32_MAX_LT_UINTMAX_MAX@ -# define PRIXMAX PRIX64 -# else -# define PRIXMAX "lX" -# endif -#endif - -#if !defined PRIdPTR || @PRI_MACROS_BROKEN@ -# undef PRIdPTR -# ifdef INTPTR_MAX -# define PRIdPTR @PRIPTR_PREFIX@ "d" -# endif -#endif -#if !defined PRIiPTR || @PRI_MACROS_BROKEN@ -# undef PRIiPTR -# ifdef INTPTR_MAX -# define PRIiPTR @PRIPTR_PREFIX@ "i" -# endif -#endif -#if !defined PRIoPTR || @PRI_MACROS_BROKEN@ -# undef PRIoPTR -# ifdef UINTPTR_MAX -# define PRIoPTR @PRIPTR_PREFIX@ "o" -# endif -#endif -#if !defined PRIuPTR || @PRI_MACROS_BROKEN@ -# undef PRIuPTR -# ifdef UINTPTR_MAX -# define PRIuPTR @PRIPTR_PREFIX@ "u" -# endif -#endif -#if !defined PRIxPTR || @PRI_MACROS_BROKEN@ -# undef PRIxPTR -# ifdef UINTPTR_MAX -# define PRIxPTR @PRIPTR_PREFIX@ "x" -# endif -#endif -#if !defined PRIXPTR || @PRI_MACROS_BROKEN@ -# undef PRIXPTR -# ifdef UINTPTR_MAX -# define PRIXPTR @PRIPTR_PREFIX@ "X" -# endif -#endif - -#if !defined SCNd8 || @PRI_MACROS_BROKEN@ -# undef SCNd8 -# ifdef INT8_MAX -# define SCNd8 "hhd" -# endif -#endif -#if !defined SCNi8 || @PRI_MACROS_BROKEN@ -# undef SCNi8 -# ifdef INT8_MAX -# define SCNi8 "hhi" -# endif -#endif -#if !defined SCNo8 || @PRI_MACROS_BROKEN@ -# undef SCNo8 -# ifdef UINT8_MAX -# define SCNo8 "hho" -# endif -#endif -#if !defined SCNu8 || @PRI_MACROS_BROKEN@ -# undef SCNu8 -# ifdef UINT8_MAX -# define SCNu8 "hhu" -# endif -#endif -#if !defined SCNx8 || @PRI_MACROS_BROKEN@ -# undef SCNx8 -# ifdef UINT8_MAX -# define SCNx8 "hhx" -# endif -#endif -#if !defined SCNd16 || @PRI_MACROS_BROKEN@ -# undef SCNd16 -# ifdef INT16_MAX -# define SCNd16 "hd" -# endif -#endif -#if !defined SCNi16 || @PRI_MACROS_BROKEN@ -# undef SCNi16 -# ifdef INT16_MAX -# define SCNi16 "hi" -# endif -#endif -#if !defined SCNo16 || @PRI_MACROS_BROKEN@ -# undef SCNo16 -# ifdef UINT16_MAX -# define SCNo16 "ho" -# endif -#endif -#if !defined SCNu16 || @PRI_MACROS_BROKEN@ -# undef SCNu16 -# ifdef UINT16_MAX -# define SCNu16 "hu" -# endif -#endif -#if !defined SCNx16 || @PRI_MACROS_BROKEN@ -# undef SCNx16 -# ifdef UINT16_MAX -# define SCNx16 "hx" -# endif -#endif -#if !defined SCNd32 || @PRI_MACROS_BROKEN@ -# undef SCNd32 -# ifdef INT32_MAX -# define SCNd32 "d" -# endif -#endif -#if !defined SCNi32 || @PRI_MACROS_BROKEN@ -# undef SCNi32 -# ifdef INT32_MAX -# define SCNi32 "i" -# endif -#endif -#if !defined SCNo32 || @PRI_MACROS_BROKEN@ -# undef SCNo32 -# ifdef UINT32_MAX -# define SCNo32 "o" -# endif -#endif -#if !defined SCNu32 || @PRI_MACROS_BROKEN@ -# undef SCNu32 -# ifdef UINT32_MAX -# define SCNu32 "u" -# endif -#endif -#if !defined SCNx32 || @PRI_MACROS_BROKEN@ -# undef SCNx32 -# ifdef UINT32_MAX -# define SCNx32 "x" -# endif -#endif -#ifdef INT64_MAX -# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@) -# define _SCN64_PREFIX "l" -# elif defined _MSC_VER || defined __MINGW32__ -# define _SCN64_PREFIX "I64" -# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX -# endif -# if !defined SCNd64 || @PRI_MACROS_BROKEN@ -# undef SCNd64 -# define SCNd64 _SCN64_PREFIX "d" -# endif -# if !defined SCNi64 || @PRI_MACROS_BROKEN@ -# undef SCNi64 -# define SCNi64 _SCN64_PREFIX "i" -# endif -#endif -#ifdef UINT64_MAX -# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@) -# define _SCNu64_PREFIX "l" -# elif defined _MSC_VER || defined __MINGW32__ -# define _SCNu64_PREFIX "I64" -# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -# define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX -# endif -# if !defined SCNo64 || @PRI_MACROS_BROKEN@ -# undef SCNo64 -# define SCNo64 _SCNu64_PREFIX "o" -# endif -# if !defined SCNu64 || @PRI_MACROS_BROKEN@ -# undef SCNu64 -# define SCNu64 _SCNu64_PREFIX "u" -# endif -# if !defined SCNx64 || @PRI_MACROS_BROKEN@ -# undef SCNx64 -# define SCNx64 _SCNu64_PREFIX "x" -# endif -#endif - -#if !defined SCNdLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNdLEAST8 -# define SCNdLEAST8 "hhd" -#endif -#if !defined SCNiLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNiLEAST8 -# define SCNiLEAST8 "hhi" -#endif -#if !defined SCNoLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNoLEAST8 -# define SCNoLEAST8 "hho" -#endif -#if !defined SCNuLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNuLEAST8 -# define SCNuLEAST8 "hhu" -#endif -#if !defined SCNxLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNxLEAST8 -# define SCNxLEAST8 "hhx" -#endif -#if !defined SCNdLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNdLEAST16 -# define SCNdLEAST16 "hd" -#endif -#if !defined SCNiLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNiLEAST16 -# define SCNiLEAST16 "hi" -#endif -#if !defined SCNoLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNoLEAST16 -# define SCNoLEAST16 "ho" -#endif -#if !defined SCNuLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNuLEAST16 -# define SCNuLEAST16 "hu" -#endif -#if !defined SCNxLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNxLEAST16 -# define SCNxLEAST16 "hx" -#endif -#if !defined SCNdLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNdLEAST32 -# define SCNdLEAST32 "d" -#endif -#if !defined SCNiLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNiLEAST32 -# define SCNiLEAST32 "i" -#endif -#if !defined SCNoLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNoLEAST32 -# define SCNoLEAST32 "o" -#endif -#if !defined SCNuLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNuLEAST32 -# define SCNuLEAST32 "u" -#endif -#if !defined SCNxLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNxLEAST32 -# define SCNxLEAST32 "x" -#endif -#ifdef INT64_MAX -# if !defined SCNdLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNdLEAST64 -# define SCNdLEAST64 SCNd64 -# endif -# if !defined SCNiLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNiLEAST64 -# define SCNiLEAST64 SCNi64 -# endif -#endif -#ifdef UINT64_MAX -# if !defined SCNoLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNoLEAST64 -# define SCNoLEAST64 SCNo64 -# endif -# if !defined SCNuLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNuLEAST64 -# define SCNuLEAST64 SCNu64 -# endif -# if !defined SCNxLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNxLEAST64 -# define SCNxLEAST64 SCNx64 -# endif -#endif - -#if !defined SCNdFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNdFAST8 -# if INT_FAST8_MAX > INT32_MAX -# define SCNdFAST8 SCNd64 -# elif INT_FAST8_MAX == 0x7fff -# define SCNdFAST8 "hd" -# elif INT_FAST8_MAX == 0x7f -# define SCNdFAST8 "hhd" -# else -# define SCNdFAST8 "d" -# endif -#endif -#if !defined SCNiFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNiFAST8 -# if INT_FAST8_MAX > INT32_MAX -# define SCNiFAST8 SCNi64 -# elif INT_FAST8_MAX == 0x7fff -# define SCNiFAST8 "hi" -# elif INT_FAST8_MAX == 0x7f -# define SCNiFAST8 "hhi" -# else -# define SCNiFAST8 "i" -# endif -#endif -#if !defined SCNoFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNoFAST8 -# if UINT_FAST8_MAX > UINT32_MAX -# define SCNoFAST8 SCNo64 -# elif UINT_FAST8_MAX == 0xffff -# define SCNoFAST8 "ho" -# elif UINT_FAST8_MAX == 0xff -# define SCNoFAST8 "hho" -# else -# define SCNoFAST8 "o" -# endif -#endif -#if !defined SCNuFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNuFAST8 -# if UINT_FAST8_MAX > UINT32_MAX -# define SCNuFAST8 SCNu64 -# elif UINT_FAST8_MAX == 0xffff -# define SCNuFAST8 "hu" -# elif UINT_FAST8_MAX == 0xff -# define SCNuFAST8 "hhu" -# else -# define SCNuFAST8 "u" -# endif -#endif -#if !defined SCNxFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNxFAST8 -# if UINT_FAST8_MAX > UINT32_MAX -# define SCNxFAST8 SCNx64 -# elif UINT_FAST8_MAX == 0xffff -# define SCNxFAST8 "hx" -# elif UINT_FAST8_MAX == 0xff -# define SCNxFAST8 "hhx" -# else -# define SCNxFAST8 "x" -# endif -#endif -#if !defined SCNdFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNdFAST16 -# if INT_FAST16_MAX > INT32_MAX -# define SCNdFAST16 SCNd64 -# elif INT_FAST16_MAX == 0x7fff -# define SCNdFAST16 "hd" -# else -# define SCNdFAST16 "d" -# endif -#endif -#if !defined SCNiFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNiFAST16 -# if INT_FAST16_MAX > INT32_MAX -# define SCNiFAST16 SCNi64 -# elif INT_FAST16_MAX == 0x7fff -# define SCNiFAST16 "hi" -# else -# define SCNiFAST16 "i" -# endif -#endif -#if !defined SCNoFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNoFAST16 -# if UINT_FAST16_MAX > UINT32_MAX -# define SCNoFAST16 SCNo64 -# elif UINT_FAST16_MAX == 0xffff -# define SCNoFAST16 "ho" -# else -# define SCNoFAST16 "o" -# endif -#endif -#if !defined SCNuFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNuFAST16 -# if UINT_FAST16_MAX > UINT32_MAX -# define SCNuFAST16 SCNu64 -# elif UINT_FAST16_MAX == 0xffff -# define SCNuFAST16 "hu" -# else -# define SCNuFAST16 "u" -# endif -#endif -#if !defined SCNxFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNxFAST16 -# if UINT_FAST16_MAX > UINT32_MAX -# define SCNxFAST16 SCNx64 -# elif UINT_FAST16_MAX == 0xffff -# define SCNxFAST16 "hx" -# else -# define SCNxFAST16 "x" -# endif -#endif -#if !defined SCNdFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNdFAST32 -# if INT_FAST32_MAX > INT32_MAX -# define SCNdFAST32 SCNd64 -# else -# define SCNdFAST32 "d" -# endif -#endif -#if !defined SCNiFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNiFAST32 -# if INT_FAST32_MAX > INT32_MAX -# define SCNiFAST32 SCNi64 -# else -# define SCNiFAST32 "i" -# endif -#endif -#if !defined SCNoFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNoFAST32 -# if UINT_FAST32_MAX > UINT32_MAX -# define SCNoFAST32 SCNo64 -# else -# define SCNoFAST32 "o" -# endif -#endif -#if !defined SCNuFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNuFAST32 -# if UINT_FAST32_MAX > UINT32_MAX -# define SCNuFAST32 SCNu64 -# else -# define SCNuFAST32 "u" -# endif -#endif -#if !defined SCNxFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNxFAST32 -# if UINT_FAST32_MAX > UINT32_MAX -# define SCNxFAST32 SCNx64 -# else -# define SCNxFAST32 "x" -# endif -#endif -#ifdef INT64_MAX -# if !defined SCNdFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNdFAST64 -# define SCNdFAST64 SCNd64 -# endif -# if !defined SCNiFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNiFAST64 -# define SCNiFAST64 SCNi64 -# endif -#endif -#ifdef UINT64_MAX -# if !defined SCNoFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNoFAST64 -# define SCNoFAST64 SCNo64 -# endif -# if !defined SCNuFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNuFAST64 -# define SCNuFAST64 SCNu64 -# endif -# if !defined SCNxFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNxFAST64 -# define SCNxFAST64 SCNx64 -# endif -#endif - -#if !defined SCNdMAX || @PRI_MACROS_BROKEN@ -# undef SCNdMAX -# if @INT32_MAX_LT_INTMAX_MAX@ -# define SCNdMAX SCNd64 -# else -# define SCNdMAX "ld" -# endif -#endif -#if !defined SCNiMAX || @PRI_MACROS_BROKEN@ -# undef SCNiMAX -# if @INT32_MAX_LT_INTMAX_MAX@ -# define SCNiMAX SCNi64 -# else -# define SCNiMAX "li" -# endif -#endif -#if !defined SCNoMAX || @PRI_MACROS_BROKEN@ -# undef SCNoMAX -# if @UINT32_MAX_LT_UINTMAX_MAX@ -# define SCNoMAX SCNo64 -# else -# define SCNoMAX "lo" -# endif -#endif -#if !defined SCNuMAX || @PRI_MACROS_BROKEN@ -# undef SCNuMAX -# if @UINT32_MAX_LT_UINTMAX_MAX@ -# define SCNuMAX SCNu64 -# else -# define SCNuMAX "lu" -# endif -#endif -#if !defined SCNxMAX || @PRI_MACROS_BROKEN@ -# undef SCNxMAX -# if @UINT32_MAX_LT_UINTMAX_MAX@ -# define SCNxMAX SCNx64 -# else -# define SCNxMAX "lx" -# endif -#endif - -#if !defined SCNdPTR || @PRI_MACROS_BROKEN@ -# undef SCNdPTR -# ifdef INTPTR_MAX -# define SCNdPTR @PRIPTR_PREFIX@ "d" -# endif -#endif -#if !defined SCNiPTR || @PRI_MACROS_BROKEN@ -# undef SCNiPTR -# ifdef INTPTR_MAX -# define SCNiPTR @PRIPTR_PREFIX@ "i" -# endif -#endif -#if !defined SCNoPTR || @PRI_MACROS_BROKEN@ -# undef SCNoPTR -# ifdef UINTPTR_MAX -# define SCNoPTR @PRIPTR_PREFIX@ "o" -# endif -#endif -#if !defined SCNuPTR || @PRI_MACROS_BROKEN@ -# undef SCNuPTR -# ifdef UINTPTR_MAX -# define SCNuPTR @PRIPTR_PREFIX@ "u" -# endif -#endif -#if !defined SCNxPTR || @PRI_MACROS_BROKEN@ -# undef SCNxPTR -# ifdef UINTPTR_MAX -# define SCNxPTR @PRIPTR_PREFIX@ "x" -# endif -#endif - -/* 7.8.2 Functions for greatest-width integer types */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if @GNULIB_IMAXABS@ -# if !@HAVE_DECL_IMAXABS@ -extern intmax_t imaxabs (intmax_t); -# endif -#elif defined GNULIB_POSIXCHECK -# undef imaxabs -# if HAVE_RAW_DECL_IMAXABS -_GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - " - "use gnulib module imaxabs for portability"); -# endif -#endif - -#if @GNULIB_IMAXDIV@ -# if !@HAVE_IMAXDIV_T@ -# if !GNULIB_defined_imaxdiv_t -typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; -# define GNULIB_defined_imaxdiv_t 1 -# endif -# endif -# if !@HAVE_DECL_IMAXDIV@ -extern imaxdiv_t imaxdiv (intmax_t, intmax_t); -# endif -#elif defined GNULIB_POSIXCHECK -# undef imaxdiv -# if HAVE_RAW_DECL_IMAXDIV -_GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - " - "use gnulib module imaxdiv for portability"); -# endif -#endif - -#if @GNULIB_STRTOIMAX@ -# if @REPLACE_STRTOIMAX@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef strtoimax -# define strtoimax rpl_strtoimax -# endif -_GL_FUNCDECL_RPL (strtoimax, intmax_t, - (const char *, char **, int) _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (strtoimax, intmax_t, (const char *, char **, int)); -# else -# if !@HAVE_DECL_STRTOIMAX@ -# undef strtoimax -_GL_FUNCDECL_SYS (strtoimax, intmax_t, - (const char *, char **, int) _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (strtoimax, intmax_t, (const char *, char **, int)); -# endif -_GL_CXXALIASWARN (strtoimax); -#elif defined GNULIB_POSIXCHECK -# undef strtoimax -# if HAVE_RAW_DECL_STRTOIMAX -_GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - " - "use gnulib module strtoimax for portability"); -# endif -#endif - -#if @GNULIB_STRTOUMAX@ -# if @REPLACE_STRTOUMAX@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef strtoumax -# define strtoumax rpl_strtoumax -# endif -_GL_FUNCDECL_RPL (strtoumax, uintmax_t, - (const char *, char **, int) _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (strtoumax, uintmax_t, (const char *, char **, int)); -# else -# if !@HAVE_DECL_STRTOUMAX@ -# undef strtoumax -_GL_FUNCDECL_SYS (strtoumax, uintmax_t, - (const char *, char **, int) _GL_ARG_NONNULL ((1))); -# endif -_GL_CXXALIAS_SYS (strtoumax, uintmax_t, (const char *, char **, int)); -# endif -_GL_CXXALIASWARN (strtoumax); -#elif defined GNULIB_POSIXCHECK -# undef strtoumax -# if HAVE_RAW_DECL_STRTOUMAX -_GL_WARN_ON_USE (strtoumax, "strtoumax is unportable - " - "use gnulib module strtoumax for portability"); -# endif -#endif - -/* Don't bother defining or declaring wcstoimax and wcstoumax, since - wide-character functions like this are hardly ever useful. */ - -#ifdef __cplusplus -} -#endif - -#endif /* !defined INTTYPES_H && !defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H */ diff --git a/gnulib-tests/ioctl.c b/gnulib-tests/ioctl.c index 140c7b6..eb2e825 100644 --- a/gnulib-tests/ioctl.c +++ b/gnulib-tests/ioctl.c @@ -1,6 +1,6 @@ /* ioctl.c --- wrappers for Windows ioctl function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/link.c b/gnulib-tests/link.c index c1cca7a..22f7c82 100644 --- a/gnulib-tests/link.c +++ b/gnulib-tests/link.c @@ -1,6 +1,6 @@ /* Emulate link on platforms that lack it, namely native Windows platforms. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/listen.c b/gnulib-tests/listen.c index 00627f6..c1db145 100644 --- a/gnulib-tests/listen.c +++ b/gnulib-tests/listen.c @@ -1,6 +1,6 @@ /* listen.c --- wrappers for Windows listen function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/locale.c b/gnulib-tests/locale.c new file mode 100644 index 0000000..323040c --- /dev/null +++ b/gnulib-tests/locale.c @@ -0,0 +1,85 @@ +/* Program that prints the names of the categories of the current locale. + Copyright (C) 2019-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2019. */ + +#include <config.h> + +#include <locale.h> +#include <stdio.h> +#include <stdlib.h> + +/* We want to use the system's setlocale() function here, not the gnulib + override. */ +#undef setlocale + +/* Specification: + <https://pubs.opengroup.org/onlinepubs/9699919799/utilities/locale.html> + Here we implement only the invocation without any command-line options. */ + +static const char * +defaulted_getenv (const char *variable) +{ + const char *value = getenv (variable); + return (value != NULL ? value : ""); +} + +static void +print_category (int category, const char *variable) +{ + const char *value = defaulted_getenv (variable); + if (value[0] != '\0' && defaulted_getenv ("LC_ALL")[0] == '\0') + /* The variable is set in the environment and not overridden by LC_ALL. */ + printf ("%s=%s\n", variable, value); + else + printf ("%s=\"%s\"\n", variable, setlocale (category, NULL)); +} + +int +main () +{ + setlocale (LC_ALL, ""); + + printf ("LANG=%s\n", defaulted_getenv ("LANG")); + print_category (LC_CTYPE, "LC_CTYPE"); + print_category (LC_NUMERIC, "LC_NUMERIC"); + print_category (LC_TIME, "LC_TIME"); + print_category (LC_COLLATE, "LC_COLLATE"); + print_category (LC_MONETARY, "LC_MONETARY"); + print_category (LC_MESSAGES, "LC_MESSAGES"); +#ifdef LC_PAPER + print_category (LC_PAPER, "LC_PAPER"); +#endif +#ifdef LC_NAME + print_category (LC_NAME, "LC_NAME"); +#endif +#ifdef LC_ADDRESS + print_category (LC_ADDRESS, "LC_ADDRESS"); +#endif +#ifdef LC_TELEPHONE + print_category (LC_TELEPHONE, "LC_TELEPHONE"); +#endif +#ifdef LC_MEASUREMENT + print_category (LC_MEASUREMENT, "LC_MEASUREMENT"); +#endif +#ifdef LC_IDENTIFICATION + print_category (LC_IDENTIFICATION, "LC_IDENTIFICATION"); +#endif + + printf ("LC_ALL=%s\n", defaulted_getenv ("LC_ALL")); + + return 0; +} diff --git a/gnulib-tests/localename-table.c b/gnulib-tests/localename-table.c index 40f0709..89db245 100644 --- a/gnulib-tests/localename-table.c +++ b/gnulib-tests/localename-table.c @@ -1,5 +1,5 @@ /* Table that maps a locale object to the names of the locale categories. - Copyright (C) 2018 Free Software Foundation, Inc. + Copyright (C) 2018-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/localename-table.h b/gnulib-tests/localename-table.h index e1a7181..d9b8128 100644 --- a/gnulib-tests/localename-table.h +++ b/gnulib-tests/localename-table.h @@ -1,5 +1,5 @@ /* Table that maps a locale object to the names of the locale categories. - Copyright (C) 2018 Free Software Foundation, Inc. + Copyright (C) 2018-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/localename.c b/gnulib-tests/localename.c index 96f4a20..20be646 100644 --- a/gnulib-tests/localename.c +++ b/gnulib-tests/localename.c @@ -1,5 +1,5 @@ /* Determine name of the currently selected locale. - Copyright (C) 1995-2018 Free Software Foundation, Inc. + Copyright (C) 1995-2020 Free Software Foundation, Inc. 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 @@ -34,6 +34,7 @@ #include <string.h> #include "flexmember.h" +#include "setlocale_null.h" /* We cannot support uselocale() on platforms where the locale_t type is fake. See intl-thread-locale.m4 for details. */ @@ -66,13 +67,9 @@ extern char * getlocalename_l(int, locale_t); # endif #endif -#if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE +#if HAVE_CFPREFERENCESCOPYAPPVALUE # include <CoreFoundation/CFString.h> -# if HAVE_CFLOCALECOPYCURRENT -# include <CoreFoundation/CFLocale.h> -# elif HAVE_CFPREFERENCESCOPYAPPVALUE -# include <CoreFoundation/CFPreferences.h> -# endif +# include <CoreFoundation/CFPreferences.h> #endif #if defined _WIN32 && !defined __CYGWIN__ @@ -1155,8 +1152,12 @@ extern char * getlocalename_l(int, locale_t); # endif #endif +/* We want to use the system's setlocale() function here, not the gnulib + override. */ +#undef setlocale + -#if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE +#if HAVE_CFPREFERENCESCOPYAPPVALUE /* Mac OS X 10.4 or newer */ /* Canonicalize a Mac OS X locale name to a Unix locale name. @@ -2296,8 +2297,8 @@ gl_locale_name_from_win32_LANGID (LANGID langid) } return "wen"; case LANG_SOTHO: - /* <https://msdn.microsoft.com/en-us/library/dd318693.aspx> calls - it "Sesotho sa Leboa"; according to + /* <https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings> + calls it "Sesotho sa Leboa"; according to <https://www.ethnologue.com/show_language.asp?code=nso> <https://www.ethnologue.com/show_language.asp?code=sot> it's the same as Northern Sotho. */ @@ -2729,7 +2730,7 @@ get_locale_t_name (int category, locale_t locale) if (locale == LC_GLOBAL_LOCALE) { /* Query the global locale. */ - const char *name = setlocale (category, NULL); + const char *name = setlocale_null (category); if (name != NULL) return struniq (name); else @@ -3191,6 +3192,8 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname) return ""; } # endif +# elif defined _AIX && HAVE_NAMELESS_LOCALES + return get_locale_t_name (category, thread_locale); # elif defined __CYGWIN__ /* Cygwin < 2.6 lacks uselocale and thread-local locales altogether. Cygwin <= 2.6.1 lacks NL_LOCALE_NAME, requiring peeking inside @@ -3245,20 +3248,15 @@ gl_locale_name_posix (int category, const char *categoryname) #if defined WINDOWS_NATIVE if (LC_MIN <= category && category <= LC_MAX) { - const char *locname = setlocale (category, NULL); - LCID lcid; - - /* If CATEGORY is LC_ALL, the result might be a semi-colon - separated list of locales. We need only one, so we take the - one corresponding to LC_CTYPE, as the most important for - character translations. */ - if (category == LC_ALL && strchr (locname, ';')) - locname = setlocale (LC_CTYPE, NULL); + const char *locname = + /* setlocale_null (category) is identical to setlocale (category, NULL) + on this platform. */ + setlocale (category, NULL); /* Convert locale name to LCID. We don't want to use LocaleNameToLCID because (a) it is only available since Vista, and (b) it doesn't accept locale names returned by 'setlocale'. */ - lcid = get_lcid (locname); + LCID lcid = get_lcid (locname); if (lcid > 0) return gl_locale_name_from_win32_LCID (lcid); @@ -3269,8 +3267,8 @@ gl_locale_name_posix (int category, const char *categoryname) /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'. On some systems this can be done by the 'setlocale' function itself. */ -#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL - locname = setlocale (category, NULL); +#if defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL + locname = setlocale_null (category); #else /* On other systems we ignore what setlocale reports and instead look at the environment variables directly. This is necessary @@ -3294,15 +3292,16 @@ gl_locale_name_posix (int category, const char *categoryname) /* Convert the locale name from the format returned by setlocale() or found in the environment variables to the XPG syntax. */ #if defined WINDOWS_NATIVE - { - /* Convert locale name to LCID. We don't want to use - LocaleNameToLCID because (a) it is only available since Vista, - and (b) it doesn't accept locale names returned by 'setlocale'. */ - LCID lcid = get_lcid (locname); + if (locname != NULL) + { + /* Convert locale name to LCID. We don't want to use + LocaleNameToLCID because (a) it is only available since Vista, + and (b) it doesn't accept locale names returned by 'setlocale'. */ + LCID lcid = get_lcid (locname); - if (lcid > 0) - return gl_locale_name_from_win32_LCID (lcid); - } + if (lcid > 0) + return gl_locale_name_from_win32_LCID (lcid); + } #endif return locname; } @@ -3325,7 +3324,7 @@ gl_locale_name_environ (int category, const char *categoryname) retval = getenv ("LANG"); if (retval != NULL && retval[0] != '\0') { -#if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE +#if HAVE_CFPREFERENCESCOPYAPPVALUE /* Mac OS X 10.2 or newer. Ignore invalid LANG value set by the Terminal application. */ if (strcmp (retval, "UTF-8") != 0) @@ -3372,7 +3371,7 @@ gl_locale_name_default (void) "C.UTF-8" locale, which operates in the same way as the "C" locale. */ -#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined WINDOWS_NATIVE || defined __CYGWIN__) +#if !(HAVE_CFPREFERENCESCOPYAPPVALUE || defined WINDOWS_NATIVE || defined __CYGWIN__) /* The system does not have a way of setting the locale, other than the POSIX specified environment variables. We use C as default locale. */ @@ -3385,8 +3384,17 @@ gl_locale_name_default (void) context, because message catalogs are not specific to a single codeset. */ -# if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE +# if HAVE_CFPREFERENCESCOPYAPPVALUE /* Mac OS X 10.4 or newer */ + /* Don't use the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent, + because in macOS 10.13.4 it has the following behaviour: + When two or more languages are specified in the + "System Preferences > Language & Region > Preferred Languages" panel, + it returns en_CC where CC is the territory (even when English is not among + the preferred languages!). What we want instead is what + CFLocaleCopyCurrent returned in earlier macOS releases and what + CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the + first among the preferred languages and CC is the territory. */ { /* Cache the locale name, since CoreFoundation calls are expensive. */ static const char *cached_localename; @@ -3394,17 +3402,12 @@ gl_locale_name_default (void) if (cached_localename == NULL) { char namebuf[256]; -# if HAVE_CFLOCALECOPYCURRENT /* Mac OS X 10.5 or newer */ - CFLocaleRef locale = CFLocaleCopyCurrent (); - CFStringRef name = CFLocaleGetIdentifier (locale); -# elif HAVE_CFPREFERENCESCOPYAPPVALUE /* Mac OS X 10.4 or newer */ CFTypeRef value = CFPreferencesCopyAppValue (CFSTR ("AppleLocale"), kCFPreferencesCurrentApplication); if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ()) { CFStringRef name = (CFStringRef)value; -# endif if (CFStringGetCString (name, namebuf, sizeof (namebuf), kCFStringEncodingASCII)) @@ -3412,12 +3415,7 @@ gl_locale_name_default (void) gl_locale_name_canonicalize (namebuf); cached_localename = strdup (namebuf); } - -# if HAVE_CFLOCALECOPYCURRENT /* Mac OS X 10.5 or newer */ - CFRelease (locale); -# elif HAVE_CFPREFERENCESCOPYAPPVALUE /* Mac OS X 10.4 or newer */ } -# endif if (cached_localename == NULL) cached_localename = "C"; } diff --git a/gnulib-tests/localename.h b/gnulib-tests/localename.h index ab17e81..b67f306 100644 --- a/gnulib-tests/localename.h +++ b/gnulib-tests/localename.h @@ -1,5 +1,5 @@ /* Determine name of the currently selected locale. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 @@ -86,8 +86,7 @@ extern const char * gl_locale_name_environ (int category, const char *categoryna The result must not be freed; it is statically allocated. */ extern const char * gl_locale_name_default (void) -#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE \ - || defined _WIN32 || defined __CYGWIN__) +#if !(HAVE_CFPREFERENCESCOPYAPPVALUE || defined _WIN32 || defined __CYGWIN__) _GL_ATTRIBUTE_CONST #endif ; diff --git a/gnulib-tests/lseek.c b/gnulib-tests/lseek.c index 9125b98..3ed6bdb 100644 --- a/gnulib-tests/lseek.c +++ b/gnulib-tests/lseek.c @@ -1,5 +1,5 @@ /* An lseek() function that detects pipes. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/macros.h b/gnulib-tests/macros.h index dd6357a..c72cc92 100644 --- a/gnulib-tests/macros.h +++ b/gnulib-tests/macros.h @@ -1,5 +1,5 @@ /* Common macros used by gnulib tests. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/nanosleep.c b/gnulib-tests/nanosleep.c index 2cc3909..123c66b 100644 --- a/gnulib-tests/nanosleep.c +++ b/gnulib-tests/nanosleep.c @@ -1,6 +1,6 @@ /* Provide a replacement for the POSIX nanosleep function. - Copyright (C) 1999-2000, 2002, 2004-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2000, 2002, 2004-2020 Free Software Foundation, Inc. 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 @@ -194,7 +194,7 @@ static sig_atomic_t volatile suspended; /* Handle SIGCONT. */ -static void +static _GL_ASYNC_SAFE void sighandler (int sig) { suspended = 1; diff --git a/gnulib-tests/nap.h b/gnulib-tests/nap.h index c4f45d8..5dd264f 100644 --- a/gnulib-tests/nap.h +++ b/gnulib-tests/nap.h @@ -1,5 +1,5 @@ /* Assist in file system timestamp tests. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 @@ -67,7 +67,7 @@ nap_get_stat (struct stat *st, int do_write) #if defined _WIN32 || defined __CYGWIN__ /* On Windows, the modification times are not changed until NAP_FD is closed. See - https://msdn.microsoft.com/en-us/library/windows/desktop/aa365747(v=vs.85).aspx */ + <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-writefile> */ close (nap_fd); nap_fd = open (TEMPFILE, O_RDWR, 0600); ASSERT (nap_fd != -1); diff --git a/gnulib-tests/netinet_in.in.h b/gnulib-tests/netinet_in.in.h index 0f26cf5..84ad215 100644 --- a/gnulib-tests/netinet_in.in.h +++ b/gnulib-tests/netinet_in.in.h @@ -1,5 +1,5 @@ /* Substitute for <netinet/in.h>. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/null-ptr.h b/gnulib-tests/null-ptr.h index 1ba0755..b978418 100644 --- a/gnulib-tests/null-ptr.h +++ b/gnulib-tests/null-ptr.h @@ -1,5 +1,5 @@ /* Return a NULL pointer, without letting the compiler know it. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/open.c b/gnulib-tests/open.c index 792e258..487194f 100644 --- a/gnulib-tests/open.c +++ b/gnulib-tests/open.c @@ -1,5 +1,5 @@ /* Open a descriptor to a file. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 @@ -92,22 +92,19 @@ open (const char *filename, int flags, ...) #endif #if OPEN_TRAILING_SLASH_BUG - /* If the filename ends in a slash and one of O_CREAT, O_WRONLY, O_RDWR - is specified, then fail. - Rationale: POSIX <http://www.opengroup.org/susv3/basedefs/xbd_chap04.html> - says that - "A pathname that contains at least one non-slash character and that - ends with one or more trailing slashes shall be resolved as if a - single dot character ( '.' ) were appended to the pathname." - and - "The special filename dot shall refer to the directory specified by - its predecessor." + /* Fail if one of O_CREAT, O_WRONLY, O_RDWR is specified and the filename + ends in a slash, as POSIX says such a filename must name a directory + <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>: + "A pathname that contains at least one non-<slash> character and that + ends with one or more trailing <slash> characters shall not be resolved + successfully unless the last pathname component before the trailing + <slash> characters names an existing directory" If the named file already exists as a directory, then - if O_CREAT is specified, open() must fail because of the semantics of O_CREAT, - if O_WRONLY or O_RDWR is specified, open() must fail because POSIX - <http://www.opengroup.org/susv3/functions/open.html> says that it - fails with errno = EISDIR in this case. + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html> + says that it fails with errno = EISDIR in this case. If the named file does not exist or does not name a directory, then - if O_CREAT is specified, open() must fail since open() cannot create directories, @@ -171,14 +168,12 @@ open (const char *filename, int flags, ...) #if OPEN_TRAILING_SLASH_BUG /* If the filename ends in a slash and fd does not refer to a directory, then fail. - Rationale: POSIX <http://www.opengroup.org/susv3/basedefs/xbd_chap04.html> - says that - "A pathname that contains at least one non-slash character and that - ends with one or more trailing slashes shall be resolved as if a - single dot character ( '.' ) were appended to the pathname." - and - "The special filename dot shall refer to the directory specified by - its predecessor." + Rationale: POSIX says such a filename must name a directory + <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>: + "A pathname that contains at least one non-<slash> character and that + ends with one or more trailing <slash> characters shall not be resolved + successfully unless the last pathname component before the trailing + <slash> characters names an existing directory" If the named file without the slash is not a directory, open() must fail with ENOTDIR. */ if (fd >= 0) diff --git a/gnulib-tests/opendir.c b/gnulib-tests/opendir.c index b77f540..162ae4a 100644 --- a/gnulib-tests/opendir.c +++ b/gnulib-tests/opendir.c @@ -1,5 +1,5 @@ /* Start reading the entries of a directory. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/perror.c b/gnulib-tests/perror.c index 827a37c..6eb83ee 100644 --- a/gnulib-tests/perror.c +++ b/gnulib-tests/perror.c @@ -1,5 +1,5 @@ /* Print a message describing error code. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. Written by Bruno Haible and Simon Josefsson. This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/pipe.c b/gnulib-tests/pipe.c index 9f0edae..fd554fe 100644 --- a/gnulib-tests/pipe.c +++ b/gnulib-tests/pipe.c @@ -1,5 +1,5 @@ /* Create a pipe. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/pthread-thread.c b/gnulib-tests/pthread-thread.c new file mode 100644 index 0000000..13fda18 --- /dev/null +++ b/gnulib-tests/pthread-thread.c @@ -0,0 +1,178 @@ +/* Creating and controlling POSIX threads. + Copyright (C) 2010-2020 Free Software Foundation, Inc. + + 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 3, 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert, 2010, and Bruno Haible <bruno@clisp.org>, 2019. */ + +#include <config.h> + +/* Specification. */ +#include <pthread.h> + +#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS +# include "windows-thread.h" +#else +# include <stdlib.h> +#endif + +typedef void * (* pthread_main_function_t) (void *); + +#if ((defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS) || !HAVE_PTHREAD_H + +int +pthread_attr_init (pthread_attr_t *attr) +{ + *attr = PTHREAD_CREATE_JOINABLE; + return 0; +} + +int +pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstatep) +{ + *detachstatep = *attr & (PTHREAD_CREATE_JOINABLE | PTHREAD_CREATE_DETACHED); + return 0; +} + +int +pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate) +{ + if (!(detachstate == PTHREAD_CREATE_JOINABLE + || detachstate == PTHREAD_CREATE_DETACHED)) + return EINVAL; + *attr ^= (*attr ^ detachstate) + & (PTHREAD_CREATE_JOINABLE | PTHREAD_CREATE_DETACHED); + return 0; +} + +int +pthread_attr_destroy (pthread_attr_t *attr _GL_UNUSED) +{ + return 0; +} + +#endif + +#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS +/* Use Windows threads. */ + +int +pthread_create (pthread_t *threadp, const pthread_attr_t *attr, + pthread_main_function_t mainfunc, void *arg) +{ + unsigned int glwthread_attr = + (attr != NULL + && (*attr & (PTHREAD_CREATE_JOINABLE | PTHREAD_CREATE_DETACHED)) + != PTHREAD_CREATE_JOINABLE + ? GLWTHREAD_ATTR_DETACHED + : 0); + return glwthread_thread_create (threadp, glwthread_attr, mainfunc, arg); +} + +pthread_t +pthread_self (void) +{ + return glwthread_thread_self (); +} + +int +pthread_equal (pthread_t thread1, pthread_t thread2) +{ + return thread1 == thread2; +} + +int +pthread_detach (pthread_t thread) +{ + return glwthread_thread_detach (thread); +} + +int +pthread_join (pthread_t thread, void **valuep) +{ + return glwthread_thread_join (thread, valuep); +} + +void +pthread_exit (void *value) +{ + glwthread_thread_exit (value); +} + +#elif HAVE_PTHREAD_H +/* Provide workarounds for POSIX threads. */ + +# if PTHREAD_CREATE_IS_INLINE +int +pthread_create (pthread_t *threadp, const pthread_attr_t *attr, + pthread_main_function_t mainfunc, void *arg) +# undef pthread_create +{ + return pthread_create (threadp, attr, mainfunc, arg); +} + +int +pthread_attr_init (pthread_attr_t *attr) +# undef pthread_attr_init +{ + return pthread_attr_init (attr); +} + +# endif + +#else +/* Provide a dummy implementation for single-threaded applications. */ + +int +pthread_create (pthread_t *threadp, const pthread_attr_t *attr, + pthread_main_function_t mainfunc, void *arg) +{ + /* The maximum number of threads is reached. Do not create a thread. */ + return EAGAIN; +} + +pthread_t +pthread_self (void) +{ + return 42; +} + +int +pthread_equal (pthread_t thread1, pthread_t thread2) +{ + return thread1 == thread2; +} + +int +pthread_detach (pthread_t thread) +{ + /* There are no joinable threads. */ + return EINVAL; +} + +int +pthread_join (pthread_t thread, void **valuep) +{ + /* There are no joinable threads. */ + return EINVAL; +} + +void +pthread_exit (void *value) +{ + /* There is just one thread, so the process exits. */ + exit (0); +} + +#endif diff --git a/gnulib-tests/pthread.in.h b/gnulib-tests/pthread.in.h new file mode 100644 index 0000000..7cf1930 --- /dev/null +++ b/gnulib-tests/pthread.in.h @@ -0,0 +1,1831 @@ +/* Implement the most essential subset of POSIX 1003.1-2008 pthread.h. + + Copyright (C) 2009-2020 Free Software Foundation, Inc. + + 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 3, 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert, Glen Lenker, and Bruno Haible. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if defined _GL_ALREADY_INCLUDING_PTHREAD_H +/* Special invocation convention: + On Android, we have a sequence of nested includes + <pthread.h> -> <time.h> -> <sys/time.h> -> <sys/select.h> -> + <signal.h> -> <pthread.h>. + In this situation, PTHREAD_COND_INITIALIZER is not yet defined, + therefore we should not attempt to define PTHREAD_MUTEX_NORMAL etc. */ + +#@INCLUDE_NEXT@ @NEXT_PTHREAD_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_PTHREAD_H_ + +#if @HAVE_PTHREAD_H@ + +# define _GL_ALREADY_INCLUDING_PTHREAD_H + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_PTHREAD_H@ + +# undef _GL_ALREADY_INCLUDING_PTHREAD_H + +#endif + +#ifndef _@GUARD_PREFIX@_PTHREAD_H_ +#define _@GUARD_PREFIX@_PTHREAD_H_ + +#define __need_system_stdlib_h +#include <stdlib.h> +#undef __need_system_stdlib_h + + +/* The pthreads-win32 <pthread.h> defines a couple of broken macros. */ +#undef asctime_r +#undef ctime_r +#undef gmtime_r +#undef localtime_r +#undef rand_r +#undef strtok_r + +#include <errno.h> +#include <sched.h> +#include <sys/types.h> +#include <time.h> + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _Noreturn is copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +/* =========== Thread types and macros =========== */ + +#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS +# if @GNULIB_PTHREAD_THREAD@ +# include "windows-thread.h" +# if @HAVE_PTHREAD_T@ +# define pthread_t rpl_pthread_t +# define pthread_attr_t rpl_pthread_attr_t +# endif +# if !GNULIB_defined_pthread_thread_types +typedef glwthread_thread_t pthread_t; +typedef unsigned int pthread_attr_t; +# define GNULIB_defined_pthread_thread_types 1 +# endif +# else +# if @HAVE_PTHREAD_T@ +# define pthread_t rpl_pthread_t +# define pthread_attr_t rpl_pthread_attr_t +# endif +# if !GNULIB_defined_pthread_thread_types +typedef int pthread_t; +typedef unsigned int pthread_attr_t; +# define GNULIB_defined_pthread_thread_types 1 +# endif +# endif +# undef PTHREAD_CREATE_JOINABLE +# undef PTHREAD_CREATE_DETACHED +# define PTHREAD_CREATE_JOINABLE 0 +# define PTHREAD_CREATE_DETACHED 1 +#else +# if !@HAVE_PTHREAD_T@ +# if !GNULIB_defined_pthread_thread_types +typedef int pthread_t; +typedef unsigned int pthread_attr_t; +# define GNULIB_defined_pthread_thread_types 1 +# endif +# endif +# if !@HAVE_PTHREAD_CREATE_DETACHED@ +# define PTHREAD_CREATE_JOINABLE 0 +# define PTHREAD_CREATE_DETACHED 1 +# endif +#endif + +/* =========== Once-only control (initialization) types and macros ========== */ + +#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS +# if @GNULIB_PTHREAD_ONCE@ +# include "windows-once.h" +# if @HAVE_PTHREAD_T@ +# define pthread_once_t rpl_pthread_once_t +# endif +# if !GNULIB_defined_pthread_once_types +typedef glwthread_once_t pthread_once_t; +# define GNULIB_defined_pthread_once_types 1 +# endif +# undef PTHREAD_ONCE_INIT +# define PTHREAD_ONCE_INIT GLWTHREAD_ONCE_INIT +# else +# if @HAVE_PTHREAD_T@ +# define pthread_once_t rpl_pthread_once_t +# endif +# if !GNULIB_defined_pthread_once_types +typedef int pthread_once_t; +# define GNULIB_defined_pthread_once_types 1 +# endif +# undef PTHREAD_ONCE_INIT +# define PTHREAD_ONCE_INIT { 0 } +# endif +#else +# if !@HAVE_PTHREAD_T@ +# if !GNULIB_defined_pthread_once_types +typedef int pthread_once_t; +# define GNULIB_defined_pthread_once_types 1 +# endif +# undef PTHREAD_ONCE_INIT +# define PTHREAD_ONCE_INIT { 0 } +# endif +#endif + +/* =========== Mutex types and macros =========== */ + +#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS +# if @GNULIB_PTHREAD_MUTEX@ +# include "windows-timedmutex.h" +# include "windows-timedrecmutex.h" +# if @HAVE_PTHREAD_T@ +# define pthread_mutex_t rpl_pthread_mutex_t +# define pthread_mutexattr_t rpl_pthread_mutexattr_t +# endif +# if !GNULIB_defined_pthread_mutex_types +typedef struct + { + int type; + union + { + glwthread_timedmutex_t u_timedmutex; + glwthread_timedrecmutex_t u_timedrecmutex; + } + u; + } + pthread_mutex_t; +typedef unsigned int pthread_mutexattr_t; +# define GNULIB_defined_pthread_mutex_types 1 +# endif +# undef PTHREAD_MUTEX_INITIALIZER +# define PTHREAD_MUTEX_INITIALIZER { 1, { GLWTHREAD_TIMEDMUTEX_INIT } } +# else +# if @HAVE_PTHREAD_T@ +# define pthread_mutex_t rpl_pthread_mutex_t +# define pthread_mutexattr_t rpl_pthread_mutexattr_t +# endif +# if !GNULIB_defined_pthread_mutex_types +typedef int pthread_mutex_t; +typedef unsigned int pthread_mutexattr_t; +# define GNULIB_defined_pthread_mutex_types 1 +# endif +# undef PTHREAD_MUTEX_INITIALIZER +# define PTHREAD_MUTEX_INITIALIZER { 0 } +# endif +# undef PTHREAD_MUTEX_DEFAULT +# undef PTHREAD_MUTEX_NORMAL +# undef PTHREAD_MUTEX_ERRORCHECK +# undef PTHREAD_MUTEX_RECURSIVE +# define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL +# define PTHREAD_MUTEX_NORMAL 0 +# define PTHREAD_MUTEX_ERRORCHECK 1 +# define PTHREAD_MUTEX_RECURSIVE 2 +# undef PTHREAD_MUTEX_STALLED +# undef PTHREAD_MUTEX_ROBUST +# define PTHREAD_MUTEX_STALLED 0 +# define PTHREAD_MUTEX_ROBUST 1 +#else +# if !@HAVE_PTHREAD_T@ +# if !GNULIB_defined_pthread_mutex_types +typedef int pthread_mutex_t; +typedef unsigned int pthread_mutexattr_t; +# define GNULIB_defined_pthread_mutex_types 1 +# endif +# undef PTHREAD_MUTEX_INITIALIZER +# define PTHREAD_MUTEX_INITIALIZER { 0 } +# endif +# if !@HAVE_PTHREAD_MUTEX_RECURSIVE@ +# define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL +# define PTHREAD_MUTEX_NORMAL 0 +# define PTHREAD_MUTEX_ERRORCHECK 1 +# define PTHREAD_MUTEX_RECURSIVE 2 +# endif +# if !@HAVE_PTHREAD_MUTEX_ROBUST@ +# define PTHREAD_MUTEX_STALLED 0 +# define PTHREAD_MUTEX_ROBUST 1 +# endif +#endif + +/* =========== Read-write lock types and macros =========== */ + +#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS +# if @GNULIB_PTHREAD_RWLOCK@ +# include "windows-timedrwlock.h" +# if @HAVE_PTHREAD_T@ +# define pthread_rwlock_t rpl_pthread_rwlock_t +# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t +# endif +# if !GNULIB_defined_pthread_rwlock_types +typedef glwthread_timedrwlock_t pthread_rwlock_t; +typedef unsigned int pthread_rwlockattr_t; +# define GNULIB_defined_pthread_rwlock_types 1 +# endif +# undef PTHREAD_RWLOCK_INITIALIZER +# define PTHREAD_RWLOCK_INITIALIZER GLWTHREAD_TIMEDRWLOCK_INIT +# else +# if @HAVE_PTHREAD_T@ +# define pthread_rwlock_t rpl_pthread_rwlock_t +# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t +# endif +# if !GNULIB_defined_pthread_rwlock_types +typedef int pthread_rwlock_t; +typedef unsigned int pthread_rwlockattr_t; +# define GNULIB_defined_pthread_rwlock_types 1 +# endif +# undef PTHREAD_RWLOCK_INITIALIZER +# define PTHREAD_RWLOCK_INITIALIZER { 0 } +# endif +#elif @GNULIB_PTHREAD_RWLOCK@ && @REPLACE_PTHREAD_RWLOCK_INIT@ /* i.e. PTHREAD_RWLOCK_UNIMPLEMENTED */ +# if @HAVE_PTHREAD_T@ +# define pthread_rwlock_t rpl_pthread_rwlock_t +# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t +# endif +# if !GNULIB_defined_pthread_rwlock_types +typedef struct + { + pthread_mutex_t lock; /* protects the remaining fields */ + pthread_cond_t waiting_readers; /* waiting readers */ + pthread_cond_t waiting_writers; /* waiting writers */ + unsigned int waiting_writers_count; /* number of waiting writers */ + int runcount; /* number of readers running, or -1 when a writer runs */ + } + pthread_rwlock_t; +typedef unsigned int pthread_rwlockattr_t; +# define GNULIB_defined_pthread_rwlock_types 1 +# endif +# undef PTHREAD_RWLOCK_INITIALIZER +# define PTHREAD_RWLOCK_INITIALIZER \ + { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 } +#else +# if @HAVE_PTHREAD_T@ +# if !defined PTHREAD_RWLOCK_INITIALIZER && defined PTHREAD_RWLOCK_INITIALIZER_NP /* z/OS */ +# define PTHREAD_RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER_NP +# endif +# else +# if !GNULIB_defined_pthread_rwlock_types +typedef int pthread_rwlock_t; +typedef unsigned int pthread_rwlockattr_t; +# define GNULIB_defined_pthread_rwlock_types 1 +# endif +# undef PTHREAD_RWLOCK_INITIALIZER +# define PTHREAD_RWLOCK_INITIALIZER { 0 } +# endif +#endif + +/* =========== Condition variable types and macros =========== */ + +#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS +# if @GNULIB_PTHREAD_COND@ +# include "windows-cond.h" +# if @HAVE_PTHREAD_T@ +# define pthread_cond_t rpl_pthread_cond_t +# define pthread_condattr_t rpl_pthread_condattr_t +# endif +# if !GNULIB_defined_pthread_cond_types +typedef glwthread_cond_t pthread_cond_t; +typedef unsigned int pthread_condattr_t; +# define GNULIB_defined_pthread_cond_types 1 +# endif +# undef PTHREAD_COND_INITIALIZER +# define PTHREAD_COND_INITIALIZER GLWTHREAD_COND_INIT +# else +# if @HAVE_PTHREAD_T@ +# define pthread_cond_t rpl_pthread_cond_t +# define pthread_condattr_t rpl_pthread_condattr_t +# endif +# if !GNULIB_defined_pthread_cond_types +typedef int pthread_cond_t; +typedef unsigned int pthread_condattr_t; +# define GNULIB_defined_pthread_cond_types 1 +# endif +# undef PTHREAD_COND_INITIALIZER +# define PTHREAD_COND_INITIALIZER { 0 } +# endif +#else +# if !@HAVE_PTHREAD_T@ +# if !GNULIB_defined_pthread_cond_types +typedef int pthread_cond_t; +typedef unsigned int pthread_condattr_t; +# define GNULIB_defined_pthread_cond_types 1 +# endif +# undef PTHREAD_COND_INITIALIZER +# define PTHREAD_COND_INITIALIZER { 0 } +# endif +#endif + +/* =========== Thread-specific storage types and macros =========== */ + +#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS +# if @GNULIB_PTHREAD_TSS@ +# include "windows-tls.h" +# if @HAVE_PTHREAD_T@ +# define pthread_key_t rpl_pthread_key_t +# endif +# if !GNULIB_defined_pthread_tss_types +typedef glwthread_tls_key_t pthread_key_t; +# define GNULIB_defined_pthread_tss_types 1 +# endif +# undef PTHREAD_DESTRUCTOR_ITERATIONS +# define PTHREAD_DESTRUCTOR_ITERATIONS GLWTHREAD_DESTRUCTOR_ITERATIONS +# else +# if @HAVE_PTHREAD_T@ +# define pthread_key_t rpl_pthread_key_t +# endif +# if !GNULIB_defined_pthread_tss_types +typedef void ** pthread_key_t; +# define GNULIB_defined_pthread_tss_types 1 +# endif +# undef PTHREAD_DESTRUCTOR_ITERATIONS +# define PTHREAD_DESTRUCTOR_ITERATIONS 0 +# endif +#else +# if !@HAVE_PTHREAD_T@ +# if !GNULIB_defined_pthread_tss_types +typedef void ** pthread_key_t; +# define GNULIB_defined_pthread_tss_types 1 +# endif +# undef PTHREAD_DESTRUCTOR_ITERATIONS +# define PTHREAD_DESTRUCTOR_ITERATIONS 0 +# endif +#endif + +/* =========== Spinlock types and macros =========== */ + +#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS +# if @GNULIB_PTHREAD_SPIN@ +# include "windows-spin.h" +# if @HAVE_PTHREAD_T@ +# define pthread_spinlock_t rpl_pthread_spinlock_t +# endif +# if !GNULIB_defined_pthread_spin_types +typedef glwthread_spinlock_t pthread_spinlock_t; +# define GNULIB_defined_pthread_spin_types 1 +# endif +# else +# if @HAVE_PTHREAD_T@ +# define pthread_spinlock_t rpl_pthread_spinlock_t +# endif +# if !GNULIB_defined_pthread_spin_types +typedef pthread_mutex_t pthread_spinlock_t; +# define GNULIB_defined_pthread_spin_types 1 +# endif +# endif +# undef PTHREAD_PROCESS_PRIVATE +# undef PTHREAD_PROCESS_SHARED +# define PTHREAD_PROCESS_PRIVATE 0 +# define PTHREAD_PROCESS_SHARED 1 +#else +# if !@HAVE_PTHREAD_SPINLOCK_T@ +/* Approximate spinlocks with mutexes. */ +# if !GNULIB_defined_pthread_spin_types +typedef pthread_mutex_t pthread_spinlock_t; +# define GNULIB_defined_pthread_spin_types 1 +# endif +# endif +# if !@HAVE_PTHREAD_PROCESS_SHARED@ +# define PTHREAD_PROCESS_PRIVATE 0 +# define PTHREAD_PROCESS_SHARED 1 +# endif +#endif + +/* =========== Other types and macros =========== */ + +#if !@HAVE_PTHREAD_T@ +# if !GNULIB_defined_other_pthread_types +typedef int pthread_barrier_t; +typedef unsigned int pthread_barrierattr_t; +# define GNULIB_defined_other_pthread_types 1 +# endif +#endif + +#if !defined PTHREAD_CANCELED + +# define PTHREAD_BARRIER_SERIAL_THREAD (-1) + +# define PTHREAD_CANCEL_DEFERRED 0 +# define PTHREAD_CANCEL_ASYNCHRONOUS 1 + +# define PTHREAD_CANCEL_ENABLE 0 +# define PTHREAD_CANCEL_DISABLE 1 + +# define PTHREAD_CANCELED ((void *) -1) + +# define PTHREAD_INHERIT_SCHED 0 +# define PTHREAD_EXPLICIT_SCHED 1 + +# define PTHREAD_PRIO_NONE 0 +# define PTHREAD_PRIO_INHERIT 1 +# define PTHREAD_PRIO_PROTECT 2 + +# define PTHREAD_SCOPE_SYSTEM 0 +# define PTHREAD_SCOPE_PROCESS 1 + +#endif + +/* =========== Thread functions =========== */ + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_CREATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_create +# define pthread_create rpl_pthread_create +# endif +_GL_FUNCDECL_RPL (pthread_create, int, + (pthread_t *threadp, const pthread_attr_t *attr, + void * (*mainfunc) (void *), void *arg) + _GL_ARG_NONNULL ((1, 3))); +_GL_CXXALIAS_RPL (pthread_create, int, + (pthread_t *threadp, const pthread_attr_t *attr, + void * (*mainfunc) (void *), void *arg)); +# else +# if !@HAVE_PTHREAD_CREATE@ +_GL_FUNCDECL_SYS (pthread_create, int, + (pthread_t *threadp, const pthread_attr_t *attr, + void * (*mainfunc) (void *), void *arg) + _GL_ARG_NONNULL ((1, 3))); +# endif +_GL_CXXALIAS_SYS_CAST (pthread_create, int, + (pthread_t *threadp, const pthread_attr_t *attr, + void * (*mainfunc) (void *), void *arg)); +# endif +_GL_CXXALIASWARN (pthread_create); +#elif defined GNULIB_POSIXCHECK +# undef pthread_create +# if HAVE_RAW_DECL_PTHREAD_CREATE +_GL_WARN_ON_USE (pthread_create, "pthread_create is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_ATTR_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_attr_init +# define pthread_attr_init rpl_pthread_attr_init +# endif +_GL_FUNCDECL_RPL (pthread_attr_init, int, (pthread_attr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_attr_init, int, (pthread_attr_t *attr)); +# else +# if !@HAVE_PTHREAD_ATTR_INIT@ +_GL_FUNCDECL_SYS (pthread_attr_init, int, (pthread_attr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_attr_init, int, (pthread_attr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_attr_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_attr_init +# if HAVE_RAW_DECL_PTHREAD_ATTR_INIT +_GL_WARN_ON_USE (pthread_attr_init, "pthread_attr_init is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_ATTR_GETDETACHSTATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_attr_getdetachstate +# define pthread_attr_getdetachstate rpl_pthread_attr_getdetachstate +# endif +_GL_FUNCDECL_RPL (pthread_attr_getdetachstate, int, + (const pthread_attr_t *attr, int *detachstatep) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_attr_getdetachstate, int, + (const pthread_attr_t *attr, int *detachstatep)); +# else +# if !@HAVE_PTHREAD_ATTR_GETDETACHSTATE@ +_GL_FUNCDECL_SYS (pthread_attr_getdetachstate, int, + (const pthread_attr_t *attr, int *detachstatep) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (pthread_attr_getdetachstate, int, + (const pthread_attr_t *attr, int *detachstatep)); +# endif +_GL_CXXALIASWARN (pthread_attr_getdetachstate); +#elif defined GNULIB_POSIXCHECK +# undef pthread_attr_getdetachstate +# if HAVE_RAW_DECL_PTHREAD_ATTR_GETDETACHSTATE +_GL_WARN_ON_USE (pthread_attr_getdetachstate, "pthread_attr_getdetachstate is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_ATTR_SETDETACHSTATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_attr_setdetachstate +# define pthread_attr_setdetachstate rpl_pthread_attr_setdetachstate +# endif +_GL_FUNCDECL_RPL (pthread_attr_setdetachstate, int, + (pthread_attr_t *attr, int detachstate) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_attr_setdetachstate, int, + (pthread_attr_t *attr, int detachstate)); +# else +# if !@HAVE_PTHREAD_ATTR_SETDETACHSTATE@ +_GL_FUNCDECL_SYS (pthread_attr_setdetachstate, int, + (pthread_attr_t *attr, int detachstate) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_attr_setdetachstate, int, + (pthread_attr_t *attr, int detachstate)); +# endif +_GL_CXXALIASWARN (pthread_attr_setdetachstate); +#elif defined GNULIB_POSIXCHECK +# undef pthread_attr_setdetachstate +# if HAVE_RAW_DECL_PTHREAD_ATTR_SETDETACHSTATE +_GL_WARN_ON_USE (pthread_attr_setdetachstate, "pthread_attr_setdetachstate is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_ATTR_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_attr_destroy +# define pthread_attr_destroy rpl_pthread_attr_destroy +# endif +_GL_FUNCDECL_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr)); +# else +# if !@HAVE_PTHREAD_ATTR_DESTROY@ +_GL_FUNCDECL_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_attr_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_attr_destroy +# if HAVE_RAW_DECL_PTHREAD_ATTR_DESTROY +_GL_WARN_ON_USE (pthread_attr_destroy, "pthread_attr_destroy is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_SELF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_self +# define pthread_self rpl_pthread_self +# endif +_GL_FUNCDECL_RPL (pthread_self, pthread_t, (void) _GL_ATTRIBUTE_PURE); +_GL_CXXALIAS_RPL (pthread_self, pthread_t, (void)); +# else +# if !@HAVE_PTHREAD_SELF@ +_GL_FUNCDECL_SYS (pthread_self, pthread_t, (void) _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (pthread_self, pthread_t, (void)); +# endif +_GL_CXXALIASWARN (pthread_self); +#elif defined GNULIB_POSIXCHECK +# undef pthread_self +# if HAVE_RAW_DECL_PTHREAD_SELF +_GL_WARN_ON_USE (pthread_self, "pthread_self is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_EQUAL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_equal +# define pthread_equal rpl_pthread_equal +# endif +_GL_FUNCDECL_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2)); +_GL_CXXALIAS_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2)); +# else +# if !@HAVE_PTHREAD_EQUAL@ +_GL_FUNCDECL_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2)); +# endif +_GL_CXXALIAS_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2)); +# endif +_GL_CXXALIASWARN (pthread_equal); +#elif defined GNULIB_POSIXCHECK +# undef pthread_equal +# if HAVE_RAW_DECL_PTHREAD_EQUAL +_GL_WARN_ON_USE (pthread_equal, "pthread_equal is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_DETACH@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_detach +# define pthread_detach rpl_pthread_detach +# endif +_GL_FUNCDECL_RPL (pthread_detach, int, (pthread_t thread)); +_GL_CXXALIAS_RPL (pthread_detach, int, (pthread_t thread)); +# else +# if !@HAVE_PTHREAD_DETACH@ +_GL_FUNCDECL_SYS (pthread_detach, int, (pthread_t thread)); +# endif +_GL_CXXALIAS_SYS (pthread_detach, int, (pthread_t thread)); +# endif +_GL_CXXALIASWARN (pthread_detach); +#elif defined GNULIB_POSIXCHECK +# undef pthread_detach +# if HAVE_RAW_DECL_PTHREAD_DETACH +_GL_WARN_ON_USE (pthread_detach, "pthread_detach is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_JOIN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_join +# define pthread_join rpl_pthread_join +# endif +_GL_FUNCDECL_RPL (pthread_join, int, (pthread_t thread, void **valuep)); +_GL_CXXALIAS_RPL (pthread_join, int, (pthread_t thread, void **valuep)); +# else +# if !@HAVE_PTHREAD_JOIN@ +_GL_FUNCDECL_SYS (pthread_join, int, (pthread_t thread, void **valuep)); +# endif +_GL_CXXALIAS_SYS (pthread_join, int, (pthread_t thread, void **valuep)); +# endif +_GL_CXXALIASWARN (pthread_join); +#elif defined GNULIB_POSIXCHECK +# undef pthread_join +# if HAVE_RAW_DECL_PTHREAD_JOIN +_GL_WARN_ON_USE (pthread_join, "pthread_join is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_EXIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_exit +# define pthread_exit rpl_pthread_exit +# endif +_GL_FUNCDECL_RPL (pthread_exit, _Noreturn void, (void *value)); +_GL_CXXALIAS_RPL (pthread_exit, void, (void *value)); +# else +# if !@HAVE_PTHREAD_EXIT@ +_GL_FUNCDECL_SYS (pthread_exit, _Noreturn void, (void *value)); +# endif +/* Need to cast because of AIX with xlclang++. */ +_GL_CXXALIAS_SYS_CAST (pthread_exit, void, (void *value)); +# endif +_GL_CXXALIASWARN (pthread_exit); +#elif defined GNULIB_POSIXCHECK +# undef pthread_exit +# if HAVE_RAW_DECL_PTHREAD_EXIT +_GL_WARN_ON_USE (pthread_exit, "pthread_exit is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +/* =========== Once-only control (initialization) functions =========== */ + +#if @GNULIB_PTHREAD_ONCE@ +# if @REPLACE_PTHREAD_ONCE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_once +# define pthread_once rpl_pthread_once +# endif +_GL_FUNCDECL_RPL (pthread_once, int, + (pthread_once_t *once_control, void (*initfunction) (void)) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_once, int, + (pthread_once_t *once_control, void (*initfunction) (void))); +# else +# if !@HAVE_PTHREAD_ONCE@ +_GL_FUNCDECL_SYS (pthread_once, int, + (pthread_once_t *once_control, void (*initfunction) (void)) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS_CAST (pthread_once, int, + (pthread_once_t *once_control, + void (*initfunction) (void))); +# endif +_GL_CXXALIASWARN (pthread_once); +#elif defined GNULIB_POSIXCHECK +# undef pthread_once +# if HAVE_RAW_DECL_PTHREAD_ONCE +_GL_WARN_ON_USE (pthread_once, "pthread_once is not portable - " + "use gnulib module pthread-once for portability"); +# endif +#endif + +/* =========== Mutex functions =========== */ + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEX_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutex_init +# define pthread_mutex_init rpl_pthread_mutex_init +# endif +_GL_FUNCDECL_RPL (pthread_mutex_init, int, + (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutex_init, int, + (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)); +# else +# if !@HAVE_PTHREAD_MUTEX_INIT@ +_GL_FUNCDECL_SYS (pthread_mutex_init, int, + (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutex_init, int, + (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_mutex_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutex_init +# if HAVE_RAW_DECL_PTHREAD_MUTEX_INIT +_GL_WARN_ON_USE (pthread_mutex_init, "pthread_mutex_init is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEXATTR_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutexattr_init +# define pthread_mutexattr_init rpl_pthread_mutexattr_init +# endif +_GL_FUNCDECL_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr)); +# else +# if !@HAVE_PTHREAD_MUTEXATTR_INIT@ +_GL_FUNCDECL_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_mutexattr_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutexattr_init +# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_INIT +_GL_WARN_ON_USE (pthread_mutexattr_init, "pthread_mutexattr_init is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEXATTR_GETTYPE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutexattr_gettype +# define pthread_mutexattr_gettype rpl_pthread_mutexattr_gettype +# endif +_GL_FUNCDECL_RPL (pthread_mutexattr_gettype, int, + (const pthread_mutexattr_t *attr, int *typep) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_mutexattr_gettype, int, + (const pthread_mutexattr_t *attr, int *typep)); +# else +# if !@HAVE_PTHREAD_MUTEXATTR_GETTYPE@ +_GL_FUNCDECL_SYS (pthread_mutexattr_gettype, int, + (const pthread_mutexattr_t *attr, int *typep) + _GL_ARG_NONNULL ((1, 2))); +# endif +/* Need to cast, because on FreeBSD the first parameter is + pthread_mutexattr_t *attr. */ +_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_gettype, int, + (const pthread_mutexattr_t *attr, int *typep)); +# endif +_GL_CXXALIASWARN (pthread_mutexattr_gettype); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutexattr_gettype +# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETTYPE +_GL_WARN_ON_USE (pthread_mutexattr_gettype, "pthread_mutexattr_gettype is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEXATTR_SETTYPE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutexattr_settype +# define pthread_mutexattr_settype rpl_pthread_mutexattr_settype +# endif +_GL_FUNCDECL_RPL (pthread_mutexattr_settype, int, + (pthread_mutexattr_t *attr, int type) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutexattr_settype, int, + (pthread_mutexattr_t *attr, int type)); +# else +# if !@HAVE_PTHREAD_MUTEXATTR_SETTYPE@ +_GL_FUNCDECL_SYS (pthread_mutexattr_settype, int, + (pthread_mutexattr_t *attr, int type) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutexattr_settype, int, + (pthread_mutexattr_t *attr, int type)); +# endif +_GL_CXXALIASWARN (pthread_mutexattr_settype); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutexattr_settype +# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETTYPE +_GL_WARN_ON_USE (pthread_mutexattr_settype, "pthread_mutexattr_settype is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEXATTR_GETROBUST@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutexattr_getrobust +# define pthread_mutexattr_getrobust rpl_pthread_mutexattr_getrobust +# endif +_GL_FUNCDECL_RPL (pthread_mutexattr_getrobust, int, + (const pthread_mutexattr_t *attr, int *robustp) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_mutexattr_getrobust, int, + (const pthread_mutexattr_t *attr, int *robustp)); +# else +# if !@HAVE_PTHREAD_MUTEXATTR_GETROBUST@ +_GL_FUNCDECL_SYS (pthread_mutexattr_getrobust, int, + (const pthread_mutexattr_t *attr, int *robustp) + _GL_ARG_NONNULL ((1, 2))); +# endif +/* Need to cast, because on FreeBSD the first parameter is + pthread_mutexattr_t *attr. */ +_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_getrobust, int, + (const pthread_mutexattr_t *attr, int *robustp)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (pthread_mutexattr_getrobust); +# endif +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutexattr_getrobust +# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETROBUST +_GL_WARN_ON_USE (pthread_mutexattr_getrobust, "pthread_mutexattr_getrobust is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEXATTR_SETROBUST@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutexattr_setrobust +# define pthread_mutexattr_setrobust rpl_pthread_mutexattr_setrobust +# endif +_GL_FUNCDECL_RPL (pthread_mutexattr_setrobust, int, + (pthread_mutexattr_t *attr, int robust) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutexattr_setrobust, int, + (pthread_mutexattr_t *attr, int robust)); +# else +# if !@HAVE_PTHREAD_MUTEXATTR_SETROBUST@ +_GL_FUNCDECL_SYS (pthread_mutexattr_setrobust, int, + (pthread_mutexattr_t *attr, int robust) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutexattr_setrobust, int, + (pthread_mutexattr_t *attr, int robust)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (pthread_mutexattr_setrobust); +# endif +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutexattr_setrobust +# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETROBUST +_GL_WARN_ON_USE (pthread_mutexattr_setrobust, "pthread_mutexattr_setrobust is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEXATTR_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutexattr_destroy +# define pthread_mutexattr_destroy rpl_pthread_mutexattr_destroy +# endif +_GL_FUNCDECL_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr)); +# else +# if !@HAVE_PTHREAD_MUTEXATTR_DESTROY@ +_GL_FUNCDECL_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_mutexattr_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutexattr_destroy +# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_DESTROY +_GL_WARN_ON_USE (pthread_mutexattr_destroy, "pthread_mutexattr_destroy is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEX_LOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutex_lock +# define pthread_mutex_lock rpl_pthread_mutex_lock +# endif +_GL_FUNCDECL_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex)); +# else +# if !@HAVE_PTHREAD_MUTEX_LOCK@ +_GL_FUNCDECL_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (pthread_mutex_lock); +# endif +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutex_lock +# if HAVE_RAW_DECL_PTHREAD_MUTEX_LOCK +_GL_WARN_ON_USE (pthread_mutex_lock, "pthread_mutex_lock is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEX_TRYLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutex_trylock +# define pthread_mutex_trylock rpl_pthread_mutex_trylock +# endif +_GL_FUNCDECL_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex)); +# else +# if !@HAVE_PTHREAD_MUTEX_TRYLOCK@ +_GL_FUNCDECL_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex)); +# endif +_GL_CXXALIASWARN (pthread_mutex_trylock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutex_trylock +# if HAVE_RAW_DECL_PTHREAD_MUTEX_TRYLOCK +_GL_WARN_ON_USE (pthread_mutex_trylock, "pthread_mutex_trylock is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX_TIMEDLOCK@ +# if @REPLACE_PTHREAD_MUTEX_TIMEDLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutex_timedlock +# define pthread_mutex_timedlock rpl_pthread_mutex_timedlock +# endif +_GL_FUNCDECL_RPL (pthread_mutex_timedlock, int, + (pthread_mutex_t *mutex, const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_mutex_timedlock, int, + (pthread_mutex_t *mutex, const struct timespec *abstime)); +# else +# if !@HAVE_PTHREAD_MUTEX_TIMEDLOCK@ +_GL_FUNCDECL_SYS (pthread_mutex_timedlock, int, + (pthread_mutex_t *mutex, const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (pthread_mutex_timedlock, int, + (pthread_mutex_t *mutex, const struct timespec *abstime)); +# endif +_GL_CXXALIASWARN (pthread_mutex_timedlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutex_timedlock +# if HAVE_RAW_DECL_PTHREAD_MUTEX_TIMEDLOCK +_GL_WARN_ON_USE (pthread_mutex_timedlock, "pthread_mutex_timedlock is not portable - " + "use gnulib module pthread_mutex_timedlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEX_UNLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutex_unlock +# define pthread_mutex_unlock rpl_pthread_mutex_unlock +# endif +_GL_FUNCDECL_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex)); +# else +# if !@HAVE_PTHREAD_MUTEX_UNLOCK@ +_GL_FUNCDECL_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex)); +# endif +_GL_CXXALIASWARN (pthread_mutex_unlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutex_unlock +# if HAVE_RAW_DECL_PTHREAD_MUTEX_UNLOCK +_GL_WARN_ON_USE (pthread_mutex_unlock, "pthread_mutex_unlock is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEX_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutex_destroy +# define pthread_mutex_destroy rpl_pthread_mutex_destroy +# endif +_GL_FUNCDECL_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex)); +# else +# if !@HAVE_PTHREAD_MUTEX_DESTROY@ +_GL_FUNCDECL_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex)); +# endif +_GL_CXXALIASWARN (pthread_mutex_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutex_destroy +# if HAVE_RAW_DECL_PTHREAD_MUTEX_DESTROY +_GL_WARN_ON_USE (pthread_mutex_destroy, "pthread_mutex_destroy is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +/* =========== Read-write lock functions =========== */ + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_init +# define pthread_rwlock_init rpl_pthread_rwlock_init +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_init, int, + (pthread_rwlock_t *lock, const pthread_rwlockattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_init, int, + (pthread_rwlock_t *lock, const pthread_rwlockattr_t *attr)); +# else +# if !@HAVE_PTHREAD_RWLOCK_INIT@ +_GL_FUNCDECL_SYS (pthread_rwlock_init, int, + (pthread_rwlock_t *lock, const pthread_rwlockattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_init, int, + (pthread_rwlock_t *lock, const pthread_rwlockattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_init +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_INIT +_GL_WARN_ON_USE (pthread_rwlock_init, "pthread_rwlock_init is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCKATTR_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlockattr_init +# define pthread_rwlockattr_init rpl_pthread_rwlockattr_init +# endif +_GL_FUNCDECL_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr)); +# else +# if !@HAVE_PTHREAD_RWLOCKATTR_INIT@ +_GL_FUNCDECL_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_rwlockattr_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlockattr_init +# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_INIT +_GL_WARN_ON_USE (pthread_rwlockattr_init, "pthread_rwlockattr_init is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCKATTR_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlockattr_destroy +# define pthread_rwlockattr_destroy rpl_pthread_rwlockattr_destroy +# endif +_GL_FUNCDECL_RPL (pthread_rwlockattr_destroy, int, + (pthread_rwlockattr_t *attr) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlockattr_destroy, int, + (pthread_rwlockattr_t *attr)); +# else +# if !@HAVE_PTHREAD_RWLOCKATTR_DESTROY@ +_GL_FUNCDECL_SYS (pthread_rwlockattr_destroy, int, + (pthread_rwlockattr_t *attr) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlockattr_destroy, int, + (pthread_rwlockattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_rwlockattr_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlockattr_destroy +# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_DESTROY +_GL_WARN_ON_USE (pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_RDLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_rdlock +# define pthread_rwlock_rdlock rpl_pthread_rwlock_rdlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock)); +# else +# if !@HAVE_PTHREAD_RWLOCK_RDLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_rdlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_rdlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_RDLOCK +_GL_WARN_ON_USE (pthread_rwlock_rdlock, "pthread_rwlock_rdlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_WRLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_wrlock +# define pthread_rwlock_wrlock rpl_pthread_rwlock_wrlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock)); +# else +# if !@HAVE_PTHREAD_RWLOCK_WRLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_wrlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_wrlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_WRLOCK +_GL_WARN_ON_USE (pthread_rwlock_wrlock, "pthread_rwlock_wrlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_TRYRDLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_tryrdlock +# define pthread_rwlock_tryrdlock rpl_pthread_rwlock_tryrdlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock)); +# else +# if !@HAVE_PTHREAD_RWLOCK_TRYRDLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_tryrdlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_tryrdlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYRDLOCK +_GL_WARN_ON_USE (pthread_rwlock_tryrdlock, "pthread_rwlock_tryrdlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_TRYWRLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_trywrlock +# define pthread_rwlock_trywrlock rpl_pthread_rwlock_trywrlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock)); +# else +# if !@HAVE_PTHREAD_RWLOCK_TRYWRLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_trywrlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_trywrlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYWRLOCK +_GL_WARN_ON_USE (pthread_rwlock_trywrlock, "pthread_rwlock_trywrlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_timedrdlock +# define pthread_rwlock_timedrdlock rpl_pthread_rwlock_timedrdlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_timedrdlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_rwlock_timedrdlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime)); +# else +# if !@HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_timedrdlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_timedrdlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_timedrdlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_timedrdlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDRDLOCK +_GL_WARN_ON_USE (pthread_rwlock_timedrdlock, "pthread_rwlock_timedrdlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_timedwrlock +# define pthread_rwlock_timedwrlock rpl_pthread_rwlock_timedwrlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_timedwrlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_rwlock_timedwrlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime)); +# else +# if !@HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_timedwrlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_timedwrlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_timedwrlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_timedwrlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDWRLOCK +_GL_WARN_ON_USE (pthread_rwlock_timedwrlock, "pthread_rwlock_timedwrlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_UNLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_unlock +# define pthread_rwlock_unlock rpl_pthread_rwlock_unlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock)); +# else +# if !@HAVE_PTHREAD_RWLOCK_UNLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_unlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_unlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_UNLOCK +_GL_WARN_ON_USE (pthread_rwlock_unlock, "pthread_rwlock_unlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_destroy +# define pthread_rwlock_destroy rpl_pthread_rwlock_destroy +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock)); +# else +# if !@HAVE_PTHREAD_RWLOCK_DESTROY@ +_GL_FUNCDECL_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_destroy +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_DESTROY +_GL_WARN_ON_USE (pthread_rwlock_destroy, "pthread_rwlock_destroy is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +/* =========== Condition variable functions =========== */ + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_COND_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_cond_init +# define pthread_cond_init rpl_pthread_cond_init +# endif +_GL_FUNCDECL_RPL (pthread_cond_init, int, + (pthread_cond_t *cond, const pthread_condattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_cond_init, int, + (pthread_cond_t *cond, const pthread_condattr_t *attr)); +# else +# if !@HAVE_PTHREAD_COND_INIT@ +_GL_FUNCDECL_SYS (pthread_cond_init, int, + (pthread_cond_t *cond, const pthread_condattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_cond_init, int, + (pthread_cond_t *cond, const pthread_condattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_cond_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_cond_init +# if HAVE_RAW_DECL_PTHREAD_COND_INIT +_GL_WARN_ON_USE (pthread_cond_init, "pthread_cond_init is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_CONDATTR_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_condattr_init +# define pthread_condattr_init rpl_pthread_condattr_init +# endif +_GL_FUNCDECL_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr)); +# else +# if !@HAVE_PTHREAD_CONDATTR_INIT@ +_GL_FUNCDECL_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_condattr_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_condattr_init +# if HAVE_RAW_DECL_PTHREAD_CONDATTR_INIT +_GL_WARN_ON_USE (pthread_condattr_init, "pthread_condattr_init is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_CONDATTR_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_condattr_destroy +# define pthread_condattr_destroy rpl_pthread_condattr_destroy +# endif +_GL_FUNCDECL_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr)); +# else +# if !@HAVE_PTHREAD_CONDATTR_DESTROY@ +_GL_FUNCDECL_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_condattr_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_condattr_destroy +# if HAVE_RAW_DECL_PTHREAD_CONDATTR_DESTROY +_GL_WARN_ON_USE (pthread_condattr_destroy, "pthread_condattr_destroy is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_COND_WAIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_cond_wait +# define pthread_cond_wait rpl_pthread_cond_wait +# endif +_GL_FUNCDECL_RPL (pthread_cond_wait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_cond_wait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex)); +# else +# if !@HAVE_PTHREAD_COND_WAIT@ +_GL_FUNCDECL_SYS (pthread_cond_wait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (pthread_cond_wait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex)); +# endif +_GL_CXXALIASWARN (pthread_cond_wait); +#elif defined GNULIB_POSIXCHECK +# undef pthread_cond_wait +# if HAVE_RAW_DECL_PTHREAD_COND_WAIT +_GL_WARN_ON_USE (pthread_cond_wait, "pthread_cond_wait is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_COND_TIMEDWAIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_cond_timedwait +# define pthread_cond_timedwait rpl_pthread_cond_timedwait +# endif +_GL_FUNCDECL_RPL (pthread_cond_timedwait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2, 3))); +_GL_CXXALIAS_RPL (pthread_cond_timedwait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime)); +# else +# if !@HAVE_PTHREAD_COND_TIMEDWAIT@ +_GL_FUNCDECL_SYS (pthread_cond_timedwait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2, 3))); +# endif +_GL_CXXALIAS_SYS (pthread_cond_timedwait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime)); +# endif +_GL_CXXALIASWARN (pthread_cond_timedwait); +#elif defined GNULIB_POSIXCHECK +# undef pthread_cond_timedwait +# if HAVE_RAW_DECL_PTHREAD_COND_TIMEDWAIT +_GL_WARN_ON_USE (pthread_cond_timedwait, "pthread_cond_timedwait is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_COND_SIGNAL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_cond_signal +# define pthread_cond_signal rpl_pthread_cond_signal +# endif +_GL_FUNCDECL_RPL (pthread_cond_signal, int, (pthread_cond_t *cond) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_cond_signal, int, (pthread_cond_t *cond)); +# else +# if !@HAVE_PTHREAD_COND_SIGNAL@ +_GL_FUNCDECL_SYS (pthread_cond_signal, int, (pthread_cond_t *cond) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_cond_signal, int, (pthread_cond_t *cond)); +# endif +_GL_CXXALIASWARN (pthread_cond_signal); +#elif defined GNULIB_POSIXCHECK +# undef pthread_cond_signal +# if HAVE_RAW_DECL_PTHREAD_COND_SIGNAL +_GL_WARN_ON_USE (pthread_cond_signal, "pthread_cond_signal is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_COND_BROADCAST@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_cond_broadcast +# define pthread_cond_broadcast rpl_pthread_cond_broadcast +# endif +_GL_FUNCDECL_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond)); +# else +# if !@HAVE_PTHREAD_COND_BROADCAST@ +_GL_FUNCDECL_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond)); +# endif +_GL_CXXALIASWARN (pthread_cond_broadcast); +#elif defined GNULIB_POSIXCHECK +# undef pthread_cond_broadcast +# if HAVE_RAW_DECL_PTHREAD_COND_BROADCAST +_GL_WARN_ON_USE (pthread_cond_broadcast, "pthread_cond_broadcast is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_COND_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_cond_destroy +# define pthread_cond_destroy rpl_pthread_cond_destroy +# endif +_GL_FUNCDECL_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond)); +# else +# if !@HAVE_PTHREAD_COND_DESTROY@ +_GL_FUNCDECL_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond)); +# endif +_GL_CXXALIASWARN (pthread_cond_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_cond_destroy +# if HAVE_RAW_DECL_PTHREAD_COND_DESTROY +_GL_WARN_ON_USE (pthread_cond_destroy, "pthread_cond_destroy is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +/* =========== Thread-specific storage functions =========== */ + +#if @GNULIB_PTHREAD_TSS@ +# if @REPLACE_PTHREAD_KEY_CREATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_key_create +# define pthread_key_create rpl_pthread_key_create +# endif +_GL_FUNCDECL_RPL (pthread_key_create, int, + (pthread_key_t *keyp, void (*destructor) (void *)) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_key_create, int, + (pthread_key_t *keyp, void (*destructor) (void *))); +# else +# if !@HAVE_PTHREAD_KEY_CREATE@ +_GL_FUNCDECL_SYS (pthread_key_create, int, + (pthread_key_t *keyp, void (*destructor) (void *)) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS_CAST (pthread_key_create, int, + (pthread_key_t *keyp, void (*destructor) (void *))); +# endif +_GL_CXXALIASWARN (pthread_key_create); +#elif defined GNULIB_POSIXCHECK +# undef pthread_key_create +# if HAVE_RAW_DECL_PTHREAD_KEY_CREATE +_GL_WARN_ON_USE (pthread_key_create, "pthread_key_create is not portable - " + "use gnulib module pthread-tss for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_TSS@ +# if @REPLACE_PTHREAD_SETSPECIFIC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_setspecific +# define pthread_setspecific rpl_pthread_setspecific +# endif +_GL_FUNCDECL_RPL (pthread_setspecific, int, + (pthread_key_t key, const void *value)); +_GL_CXXALIAS_RPL (pthread_setspecific, int, + (pthread_key_t key, const void *value)); +# else +# if !@HAVE_PTHREAD_SETSPECIFIC@ +_GL_FUNCDECL_SYS (pthread_setspecific, int, + (pthread_key_t key, const void *value)); +# endif +_GL_CXXALIAS_SYS (pthread_setspecific, int, + (pthread_key_t key, const void *value)); +# endif +_GL_CXXALIASWARN (pthread_setspecific); +#elif defined GNULIB_POSIXCHECK +# undef pthread_setspecific +# if HAVE_RAW_DECL_PTHREAD_SETSPECIFIC +_GL_WARN_ON_USE (pthread_setspecific, "pthread_setspecific is not portable - " + "use gnulib module pthread-tss for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_TSS@ +# if @REPLACE_PTHREAD_GETSPECIFIC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_getspecific +# define pthread_getspecific rpl_pthread_getspecific +# endif +_GL_FUNCDECL_RPL (pthread_getspecific, void *, (pthread_key_t key)); +_GL_CXXALIAS_RPL (pthread_getspecific, void *, (pthread_key_t key)); +# else +# if !@HAVE_PTHREAD_GETSPECIFIC@ +_GL_FUNCDECL_SYS (pthread_getspecific, void *, (pthread_key_t key)); +# endif +_GL_CXXALIAS_SYS (pthread_getspecific, void *, (pthread_key_t key)); +# endif +_GL_CXXALIASWARN (pthread_getspecific); +#elif defined GNULIB_POSIXCHECK +# undef pthread_getspecific +# if HAVE_RAW_DECL_PTHREAD_GETSPECIFIC +_GL_WARN_ON_USE (pthread_getspecific, "pthread_getspecific is not portable - " + "use gnulib module pthread-tss for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_TSS@ +# if @REPLACE_PTHREAD_KEY_DELETE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_key_delete +# define pthread_key_delete rpl_pthread_key_delete +# endif +_GL_FUNCDECL_RPL (pthread_key_delete, int, (pthread_key_t key)); +_GL_CXXALIAS_RPL (pthread_key_delete, int, (pthread_key_t key)); +# else +# if !@HAVE_PTHREAD_KEY_DELETE@ +_GL_FUNCDECL_SYS (pthread_key_delete, int, (pthread_key_t key)); +# endif +_GL_CXXALIAS_SYS (pthread_key_delete, int, (pthread_key_t key)); +# endif +_GL_CXXALIASWARN (pthread_key_delete); +#elif defined GNULIB_POSIXCHECK +# undef pthread_key_delete +# if HAVE_RAW_DECL_PTHREAD_KEY_DELETE +_GL_WARN_ON_USE (pthread_key_delete, "pthread_key_delete is not portable - " + "use gnulib module pthread-tss for portability"); +# endif +#endif + +/* =========== Spinlock functions =========== */ + +#if @GNULIB_PTHREAD_SPIN@ +# if @REPLACE_PTHREAD_SPIN_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_spin_init +# define pthread_spin_init rpl_pthread_spin_init +# endif +_GL_FUNCDECL_RPL (pthread_spin_init, int, + (pthread_spinlock_t *lock, int shared_across_processes) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_spin_init, int, + (pthread_spinlock_t *lock, int shared_across_processes)); +# else +# if !@HAVE_PTHREAD_SPIN_INIT@ +_GL_FUNCDECL_SYS (pthread_spin_init, int, + (pthread_spinlock_t *lock, int shared_across_processes) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_spin_init, int, + (pthread_spinlock_t *lock, int shared_across_processes)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (pthread_spin_init); +# endif +#elif defined GNULIB_POSIXCHECK +# undef pthread_spin_init +# if HAVE_RAW_DECL_PTHREAD_SPIN_INIT +_GL_WARN_ON_USE (pthread_spin_init, "pthread_spin_init is not portable - " + "use gnulib module pthread-spin for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_SPIN@ +# if @REPLACE_PTHREAD_SPIN_LOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_spin_lock +# define pthread_spin_lock rpl_pthread_spin_lock +# endif +_GL_FUNCDECL_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock)); +# else +# if !@HAVE_PTHREAD_SPIN_LOCK@ +_GL_FUNCDECL_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (pthread_spin_lock); +# endif +#elif defined GNULIB_POSIXCHECK +# undef pthread_spin_lock +# if HAVE_RAW_DECL_PTHREAD_SPIN_LOCK +_GL_WARN_ON_USE (pthread_spin_lock, "pthread_spin_lock is not portable - " + "use gnulib module pthread-spin for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_SPIN@ +# if @REPLACE_PTHREAD_SPIN_TRYLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_spin_trylock +# define pthread_spin_trylock rpl_pthread_spin_trylock +# endif +_GL_FUNCDECL_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock)); +# else +# if !@HAVE_PTHREAD_SPIN_TRYLOCK@ +_GL_FUNCDECL_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (pthread_spin_trylock); +# endif +#elif defined GNULIB_POSIXCHECK +# undef pthread_spin_trylock +# if HAVE_RAW_DECL_PTHREAD_SPIN_TRYLOCK +_GL_WARN_ON_USE (pthread_spin_trylock, "pthread_spin_trylock is not portable - " + "use gnulib module pthread-spin for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_SPIN@ +# if @REPLACE_PTHREAD_SPIN_UNLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_spin_unlock +# define pthread_spin_unlock rpl_pthread_spin_unlock +# endif +_GL_FUNCDECL_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock)); +# else +# if !@HAVE_PTHREAD_SPIN_UNLOCK@ +_GL_FUNCDECL_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (pthread_spin_unlock); +# endif +#elif defined GNULIB_POSIXCHECK +# undef pthread_spin_unlock +# if HAVE_RAW_DECL_PTHREAD_SPIN_UNLOCK +_GL_WARN_ON_USE (pthread_spin_unlock, "pthread_spin_unlock is not portable - " + "use gnulib module pthread-spin for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_SPIN@ +# if @REPLACE_PTHREAD_SPIN_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_spin_destroy +# define pthread_spin_destroy rpl_pthread_spin_destroy +# endif +_GL_FUNCDECL_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock)); +# else +# if !@HAVE_PTHREAD_SPIN_DESTROY@ +_GL_FUNCDECL_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (pthread_spin_destroy); +# endif +#elif defined GNULIB_POSIXCHECK +# undef pthread_spin_destroy +# if HAVE_RAW_DECL_PTHREAD_SPIN_DESTROY +_GL_WARN_ON_USE (pthread_spin_destroy, "pthread_spin_destroy is not portable - " + "use gnulib module pthread-spin for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */ +#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */ +#endif diff --git a/gnulib-tests/pthread_sigmask.c b/gnulib-tests/pthread_sigmask.c new file mode 100644 index 0000000..3eb74f2 --- /dev/null +++ b/gnulib-tests/pthread_sigmask.c @@ -0,0 +1,92 @@ +/* POSIX compatible signal blocking for threads. + Copyright (C) 2011-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <signal.h> + +#include <errno.h> +#include <stddef.h> + +#if PTHREAD_SIGMASK_INEFFECTIVE +# include <string.h> +#endif + +#if PTHREAD_SIGMASK_UNBLOCK_BUG +# include <unistd.h> +#endif + +int +pthread_sigmask (int how, const sigset_t *new_mask, sigset_t *old_mask) +#undef pthread_sigmask +{ +#if HAVE_PTHREAD_SIGMASK + int ret; + +# if PTHREAD_SIGMASK_INEFFECTIVE + sigset_t omask, omask_copy; + sigset_t *old_mask_ptr = &omask; + sigemptyset (&omask); + /* Add a signal unlikely to be blocked, so that OMASK_COPY + is unlikely to match the actual mask. */ + sigaddset (&omask, SIGILL); + memcpy (&omask_copy, &omask, sizeof omask); +# else + sigset_t *old_mask_ptr = old_mask; +# endif + + ret = pthread_sigmask (how, new_mask, old_mask_ptr); + +# if PTHREAD_SIGMASK_INEFFECTIVE + if (ret == 0) + { + /* Detect whether pthread_sigmask is currently ineffective. + Don't cache the information: libpthread.so could be dynamically + loaded after the program started and after pthread_sigmask was + called for the first time. */ + if (memcmp (&omask_copy, &omask, sizeof omask) == 0 + && pthread_sigmask (1729, &omask_copy, NULL) == 0) + { + /* pthread_sigmask is currently ineffective. The program is not + linked to -lpthread. So use sigprocmask instead. */ + return (sigprocmask (how, new_mask, old_mask) < 0 ? errno : 0); + } + + if (old_mask) + memcpy (old_mask, &omask, sizeof omask); + } +# endif +# if PTHREAD_SIGMASK_FAILS_WITH_ERRNO + if (ret == -1) + return errno; +# endif +# if PTHREAD_SIGMASK_UNBLOCK_BUG + if (ret == 0 + && new_mask != NULL + && (how == SIG_UNBLOCK || how == SIG_SETMASK)) + { + /* Give the OS the opportunity to raise signals that were pending before + the pthread_sigmask call and have now been unblocked. */ + usleep (1); + } +# endif + return ret; +#else + int ret = sigprocmask (how, new_mask, old_mask); + return (ret < 0 ? errno : 0); +#endif +} diff --git a/gnulib-tests/putenv.c b/gnulib-tests/putenv.c index 801e372..9e862e6 100644 --- a/gnulib-tests/putenv.c +++ b/gnulib-tests/putenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2018 Free Software +/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2020 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C diff --git a/gnulib-tests/raise.c b/gnulib-tests/raise.c index 8a93bea..1b93e52 100644 --- a/gnulib-tests/raise.c +++ b/gnulib-tests/raise.c @@ -1,6 +1,6 @@ /* Provide a non-threads replacement for the POSIX raise function. - Copyright (C) 2002-2003, 2005-2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2006, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/read-file.c b/gnulib-tests/read-file.c index af1ab8b..cf68e9b 100644 --- a/gnulib-tests/read-file.c +++ b/gnulib-tests/read-file.c @@ -1,5 +1,5 @@ /* read-file.c -- read file contents into a string - Copyright (C) 2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. Written by Simon Josefsson and Bruno Haible. This program is free software; you can redistribute it and/or modify diff --git a/gnulib-tests/read-file.h b/gnulib-tests/read-file.h index bddeab3..ffe7a0d 100644 --- a/gnulib-tests/read-file.h +++ b/gnulib-tests/read-file.h @@ -1,5 +1,5 @@ /* read-file.h -- read file contents into a string - Copyright (C) 2006, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify diff --git a/gnulib-tests/readdir.c b/gnulib-tests/readdir.c index c1c564d..1a02ce4 100644 --- a/gnulib-tests/readdir.c +++ b/gnulib-tests/readdir.c @@ -1,5 +1,5 @@ /* Read the next entry of a directory. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 @@ -32,7 +32,7 @@ readdir (DIR *dirp) /* There is no need to add code to produce entries for "." and "..". According to the POSIX:2008 section "4.12 Pathname Resolution" - <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html> + <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html> "." and ".." are syntactic entities. POSIX also says: "If entries for dot or dot-dot exist, one entry shall be returned diff --git a/gnulib-tests/realloc.c b/gnulib-tests/realloc.c index 7620b6a..a24054d 100644 --- a/gnulib-tests/realloc.c +++ b/gnulib-tests/realloc.c @@ -1,6 +1,6 @@ /* realloc() function that is glibc compatible. - Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2018 Free Software + Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/sched.in.h b/gnulib-tests/sched.in.h new file mode 100644 index 0000000..7146b50 --- /dev/null +++ b/gnulib-tests/sched.in.h @@ -0,0 +1,97 @@ +/* A GNU-like <sched.h>. + Copyright (C) 2008-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_SCHED_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_SCHED_H@ +# if @HAVE_SYS_CDEFS_H@ +# include <sys/cdefs.h> +# endif +# @INCLUDE_NEXT@ @NEXT_SCHED_H@ +#endif + +#ifndef _@GUARD_PREFIX@_SCHED_H +#define _@GUARD_PREFIX@_SCHED_H + +/* Get pid_t. + This is needed on glibc 2.11 (see + glibc bug <https://sourceware.org/bugzilla/show_bug.cgi?id=13198>) + and Mac OS X 10.5. */ +#include <sys/types.h> + +#ifdef __KLIBC__ +/* On OS/2 kLIBC, struct sched_param is in spawn.h. */ +# include <spawn.h> +#endif + +#ifdef __VMS +/* On OpenVMS, struct sched_param is in <pthread.h>. */ +# include <pthread.h> +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +#if !@HAVE_STRUCT_SCHED_PARAM@ + +# if !GNULIB_defined_struct_sched_param +struct sched_param +{ + int sched_priority; +}; +# define GNULIB_defined_struct_sched_param 1 +# endif + +#endif + +#if !(defined SCHED_FIFO && defined SCHED_RR && defined SCHED_OTHER) +# define SCHED_FIFO 1 +# define SCHED_RR 2 +# define SCHED_OTHER 0 +#endif + +#if @GNULIB_SCHED_YIELD@ +# if @REPLACE_SCHED_YIELD@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef sched_yield +# define sched_yield rpl_sched_yield +# endif +_GL_FUNCDECL_RPL (sched_yield, int, (void)); +_GL_CXXALIAS_RPL (sched_yield, int, (void)); +# else +# if !@HAVE_SCHED_YIELD@ +_GL_FUNCDECL_SYS (sched_yield, int, (void)); +# endif +_GL_CXXALIAS_SYS (sched_yield, int, (void)); +# endif +_GL_CXXALIASWARN (sched_yield); +#elif defined GNULIB_POSIXCHECK +# undef sched_yield +# if HAVE_RAW_DECL_SCHED_YIELD +_GL_WARN_ON_USE (sched_yield, "sched_yield is not portable - " + "use gnulib module sched_yield for portability"); +# endif +#endif + +#endif /* _@GUARD_PREFIX@_SCHED_H */ +#endif /* _@GUARD_PREFIX@_SCHED_H */ diff --git a/gnulib-tests/select.c b/gnulib-tests/select.c index 670a3e1..6748c21 100644 --- a/gnulib-tests/select.c +++ b/gnulib-tests/select.c @@ -1,7 +1,7 @@ /* Emulation for select(2) Contributed by Paolo Bonzini. - Copyright 2008-2018 Free Software Foundation, Inc. + Copyright 2008-2020 Free Software Foundation, Inc. This file is part of gnulib. diff --git a/gnulib-tests/setenv.c b/gnulib-tests/setenv.c index 439e1ff..d03bc5a 100644 --- a/gnulib-tests/setenv.c +++ b/gnulib-tests/setenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995-2003, 2005-2018 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995-2003, 2005-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/setlocale.c b/gnulib-tests/setlocale.c index 63f870f..f4141be 100644 --- a/gnulib-tests/setlocale.c +++ b/gnulib-tests/setlocale.c @@ -1,5 +1,5 @@ /* Set the current locale. -*- coding: utf-8 -*- - Copyright (C) 2009, 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2009, 2011-2020 Free Software Foundation, Inc. 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 @@ -51,6 +51,37 @@ extern void gl_locale_name_canonicalize (char *name); # undef setlocale +/* Which of the replacements to activate? */ +# if NEED_SETLOCALE_IMPROVED +# define setlocale_improved rpl_setlocale +# elif NEED_SETLOCALE_MTSAFE +# define setlocale_mtsafe rpl_setlocale +# else +# error "This file should only be compiled if NEED_SETLOCALE_IMPROVED || NEED_SETLOCALE_MTSAFE." +# endif + +/* Like setlocale, but guaranteed to be multithread-safe if LOCALE == NULL. */ +# if !SETLOCALE_NULL_ALL_MTSAFE || !SETLOCALE_NULL_ONE_MTSAFE /* i.e. if NEED_SETLOCALE_MTSAFE */ + +# if NEED_SETLOCALE_IMPROVED +static +# endif +char * +setlocale_mtsafe (int category, const char *locale) +{ + if (locale == NULL) + return (char *) setlocale_null (category); + else + return setlocale (category, locale); +} +# else /* !NEED_SETLOCALE_MTSAFE */ + +# define setlocale_mtsafe setlocale + +# endif /* NEED_SETLOCALE_MTSAFE */ + +# if NEED_SETLOCALE_IMPROVED + /* Return string representation of locale category CATEGORY. */ static const char * category_to_name (int category) @@ -85,7 +116,7 @@ category_to_name (int category) return retval; } -# if defined _WIN32 && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ /* The native Windows setlocale() function expects locale names of the form "German" or "German_Germany" or "DEU", but not "de" or "de_DE". We need @@ -617,7 +648,7 @@ search (const struct table_entry *table, size_t table_size, const char *string, { size_t i; - for (i = mid; i < hi; i++) + for (i = mid + 1; i < hi; i++) { if (strcmp (table[i].code, string) > 0) { @@ -652,7 +683,7 @@ setlocale_unixlike (int category, const char *locale) locale = "C"; /* First, try setlocale with the original argument unchanged. */ - result = setlocale (category, locale); + result = setlocale_mtsafe (category, locale); if (result != NULL) return result; @@ -794,11 +825,44 @@ setlocale_unixlike (int category, const char *locale) return NULL; } -# else -# define setlocale_unixlike setlocale -# endif +# elif defined __ANDROID__ -# if LC_MESSAGES == 1729 +/* Like setlocale, but accept also the locale names "C" and "POSIX". */ +static char * +setlocale_unixlike (int category, const char *locale) +{ + char *result = setlocale_mtsafe (category, locale); + if (result == NULL) + switch (category) + { + case LC_CTYPE: + case LC_NUMERIC: + case LC_TIME: + case LC_COLLATE: + case LC_MONETARY: + case LC_MESSAGES: + case LC_ALL: + case LC_PAPER: + case LC_NAME: + case LC_ADDRESS: + case LC_TELEPHONE: + case LC_MEASUREMENT: + if (locale == NULL + || strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0) + result = (char *) "C"; + break; + default: + break; + } + return result; +} +# define setlocale setlocale_unixlike + +# else +# define setlocale_unixlike setlocale_mtsafe +# endif + +# if LC_MESSAGES == 1729 /* The system does not store an LC_MESSAGES locale category. Do it here. */ static char lc_messages_name[64] = "C"; @@ -820,12 +884,533 @@ setlocale_single (int category, const char *locale) return setlocale_unixlike (category, locale); } -# else -# define setlocale_single setlocale_unixlike -# endif +# else +# define setlocale_single setlocale_unixlike +# endif + +# if defined __APPLE__ && defined __MACH__ + +/* Mapping from language to main territory where that language is spoken. */ +static char const locales_with_principal_territory[][6 + 1] = + { + /* Language Main territory */ + "ace_ID", /* Achinese Indonesia */ + "af_ZA", /* Afrikaans South Africa */ + "ak_GH", /* Akan Ghana */ + "am_ET", /* Amharic Ethiopia */ + "an_ES", /* Aragonese Spain */ + "ang_GB", /* Old English Britain */ + "arn_CL", /* Mapudungun Chile */ + "as_IN", /* Assamese India */ + "ast_ES", /* Asturian Spain */ + "av_RU", /* Avaric Russia */ + "awa_IN", /* Awadhi India */ + "az_AZ", /* Azerbaijani Azerbaijan */ + "ban_ID", /* Balinese Indonesia */ + "be_BY", /* Belarusian Belarus */ + "bej_SD", /* Beja Sudan */ + "bem_ZM", /* Bemba Zambia */ + "bg_BG", /* Bulgarian Bulgaria */ + "bho_IN", /* Bhojpuri India */ + "bi_VU", /* Bislama Vanuatu */ + "bik_PH", /* Bikol Philippines */ + "bin_NG", /* Bini Nigeria */ + "bm_ML", /* Bambara Mali */ + "bn_IN", /* Bengali India */ + "bo_CN", /* Tibetan China */ + "br_FR", /* Breton France */ + "bs_BA", /* Bosnian Bosnia */ + "bug_ID", /* Buginese Indonesia */ + "ca_ES", /* Catalan Spain */ + "ce_RU", /* Chechen Russia */ + "ceb_PH", /* Cebuano Philippines */ + "co_FR", /* Corsican France */ + "cr_CA", /* Cree Canada */ + /* Don't put "crh_UZ" or "crh_UA" here. That would be asking for fruitless + political discussion. */ + "cs_CZ", /* Czech Czech Republic */ + "csb_PL", /* Kashubian Poland */ + "cy_GB", /* Welsh Britain */ + "da_DK", /* Danish Denmark */ + "de_DE", /* German Germany */ + "din_SD", /* Dinka Sudan */ + "doi_IN", /* Dogri India */ + "dsb_DE", /* Lower Sorbian Germany */ + "dv_MV", /* Divehi Maldives */ + "dz_BT", /* Dzongkha Bhutan */ + "ee_GH", /* Éwé Ghana */ + "el_GR", /* Greek Greece */ + /* Don't put "en_GB" or "en_US" here. That would be asking for fruitless + political discussion. */ + "es_ES", /* Spanish Spain */ + "et_EE", /* Estonian Estonia */ + "fa_IR", /* Persian Iran */ + "fi_FI", /* Finnish Finland */ + "fil_PH", /* Filipino Philippines */ + "fj_FJ", /* Fijian Fiji */ + "fo_FO", /* Faroese Faeroe Islands */ + "fon_BJ", /* Fon Benin */ + "fr_FR", /* French France */ + "fur_IT", /* Friulian Italy */ + "fy_NL", /* Western Frisian Netherlands */ + "ga_IE", /* Irish Ireland */ + "gd_GB", /* Scottish Gaelic Britain */ + "gon_IN", /* Gondi India */ + "gsw_CH", /* Swiss German Switzerland */ + "gu_IN", /* Gujarati India */ + "he_IL", /* Hebrew Israel */ + "hi_IN", /* Hindi India */ + "hil_PH", /* Hiligaynon Philippines */ + "hr_HR", /* Croatian Croatia */ + "hsb_DE", /* Upper Sorbian Germany */ + "ht_HT", /* Haitian Haiti */ + "hu_HU", /* Hungarian Hungary */ + "hy_AM", /* Armenian Armenia */ + "id_ID", /* Indonesian Indonesia */ + "ig_NG", /* Igbo Nigeria */ + "ii_CN", /* Sichuan Yi China */ + "ilo_PH", /* Iloko Philippines */ + "is_IS", /* Icelandic Iceland */ + "it_IT", /* Italian Italy */ + "ja_JP", /* Japanese Japan */ + "jab_NG", /* Hyam Nigeria */ + "jv_ID", /* Javanese Indonesia */ + "ka_GE", /* Georgian Georgia */ + "kab_DZ", /* Kabyle Algeria */ + "kaj_NG", /* Jju Nigeria */ + "kam_KE", /* Kamba Kenya */ + "kmb_AO", /* Kimbundu Angola */ + "kcg_NG", /* Tyap Nigeria */ + "kdm_NG", /* Kagoma Nigeria */ + "kg_CD", /* Kongo Democratic Republic of Congo */ + "kk_KZ", /* Kazakh Kazakhstan */ + "kl_GL", /* Kalaallisut Greenland */ + "km_KH", /* Central Khmer Cambodia */ + "kn_IN", /* Kannada India */ + "ko_KR", /* Korean Korea (South) */ + "kok_IN", /* Konkani India */ + "kr_NG", /* Kanuri Nigeria */ + "kru_IN", /* Kurukh India */ + "ky_KG", /* Kyrgyz Kyrgyzstan */ + "lg_UG", /* Ganda Uganda */ + "li_BE", /* Limburgish Belgium */ + "lo_LA", /* Laotian Laos */ + "lt_LT", /* Lithuanian Lithuania */ + "lu_CD", /* Luba-Katanga Democratic Republic of Congo */ + "lua_CD", /* Luba-Lulua Democratic Republic of Congo */ + "luo_KE", /* Luo Kenya */ + "lv_LV", /* Latvian Latvia */ + "mad_ID", /* Madurese Indonesia */ + "mag_IN", /* Magahi India */ + "mai_IN", /* Maithili India */ + "mak_ID", /* Makasar Indonesia */ + "man_ML", /* Mandingo Mali */ + "men_SL", /* Mende Sierra Leone */ + "mfe_MU", /* Mauritian Creole Mauritius */ + "mg_MG", /* Malagasy Madagascar */ + "mi_NZ", /* Maori New Zealand */ + "min_ID", /* Minangkabau Indonesia */ + "mk_MK", /* Macedonian North Macedonia */ + "ml_IN", /* Malayalam India */ + "mn_MN", /* Mongolian Mongolia */ + "mni_IN", /* Manipuri India */ + "mos_BF", /* Mossi Burkina Faso */ + "mr_IN", /* Marathi India */ + "ms_MY", /* Malay Malaysia */ + "mt_MT", /* Maltese Malta */ + "mwr_IN", /* Marwari India */ + "my_MM", /* Burmese Myanmar */ + "na_NR", /* Nauru Nauru */ + "nah_MX", /* Nahuatl Mexico */ + "nap_IT", /* Neapolitan Italy */ + "nb_NO", /* Norwegian Bokmål Norway */ + "nds_DE", /* Low Saxon Germany */ + "ne_NP", /* Nepali Nepal */ + "nl_NL", /* Dutch Netherlands */ + "nn_NO", /* Norwegian Nynorsk Norway */ + "no_NO", /* Norwegian Norway */ + "nr_ZA", /* South Ndebele South Africa */ + "nso_ZA", /* Northern Sotho South Africa */ + "ny_MW", /* Chichewa Malawi */ + "nym_TZ", /* Nyamwezi Tanzania */ + "nyn_UG", /* Nyankole Uganda */ + "oc_FR", /* Occitan France */ + "oj_CA", /* Ojibwa Canada */ + "or_IN", /* Oriya India */ + "pa_IN", /* Punjabi India */ + "pag_PH", /* Pangasinan Philippines */ + "pam_PH", /* Pampanga Philippines */ + "pap_AN", /* Papiamento Netherlands Antilles - this line can be removed in 2018 */ + "pbb_CO", /* Páez Colombia */ + "pl_PL", /* Polish Poland */ + "ps_AF", /* Pashto Afghanistan */ + "pt_PT", /* Portuguese Portugal */ + "raj_IN", /* Rajasthani India */ + "rm_CH", /* Romansh Switzerland */ + "rn_BI", /* Kirundi Burundi */ + "ro_RO", /* Romanian Romania */ + "ru_RU", /* Russian Russia */ + "rw_RW", /* Kinyarwanda Rwanda */ + "sa_IN", /* Sanskrit India */ + "sah_RU", /* Yakut Russia */ + "sas_ID", /* Sasak Indonesia */ + "sat_IN", /* Santali India */ + "sc_IT", /* Sardinian Italy */ + "scn_IT", /* Sicilian Italy */ + "sg_CF", /* Sango Central African Republic */ + "shn_MM", /* Shan Myanmar */ + "si_LK", /* Sinhala Sri Lanka */ + "sid_ET", /* Sidamo Ethiopia */ + "sk_SK", /* Slovak Slovakia */ + "sl_SI", /* Slovenian Slovenia */ + "sm_WS", /* Samoan Samoa */ + "smn_FI", /* Inari Sami Finland */ + "sms_FI", /* Skolt Sami Finland */ + "so_SO", /* Somali Somalia */ + "sq_AL", /* Albanian Albania */ + "sr_RS", /* Serbian Serbia */ + "srr_SN", /* Serer Senegal */ + "suk_TZ", /* Sukuma Tanzania */ + "sus_GN", /* Susu Guinea */ + "sv_SE", /* Swedish Sweden */ + "te_IN", /* Telugu India */ + "tem_SL", /* Timne Sierra Leone */ + "tet_ID", /* Tetum Indonesia */ + "tg_TJ", /* Tajik Tajikistan */ + "th_TH", /* Thai Thailand */ + "ti_ER", /* Tigrinya Eritrea */ + "tiv_NG", /* Tiv Nigeria */ + "tk_TM", /* Turkmen Turkmenistan */ + "tl_PH", /* Tagalog Philippines */ + "to_TO", /* Tonga Tonga */ + "tpi_PG", /* Tok Pisin Papua New Guinea */ + "tr_TR", /* Turkish Turkey */ + "tum_MW", /* Tumbuka Malawi */ + "ug_CN", /* Uighur China */ + "uk_UA", /* Ukrainian Ukraine */ + "umb_AO", /* Umbundu Angola */ + "ur_PK", /* Urdu Pakistan */ + "uz_UZ", /* Uzbek Uzbekistan */ + "ve_ZA", /* Venda South Africa */ + "vi_VN", /* Vietnamese Vietnam */ + "wa_BE", /* Walloon Belgium */ + "wal_ET", /* Walamo Ethiopia */ + "war_PH", /* Waray Philippines */ + "wen_DE", /* Sorbian Germany */ + "yao_MW", /* Yao Malawi */ + "zap_MX" /* Zapotec Mexico */ + }; + +/* Compare just the language part of two locale names. */ +static int +langcmp (const char *locale1, const char *locale2) +{ + size_t locale1_len; + size_t locale2_len; + int cmp; + + { + const char *locale1_end = strchr (locale1, '_'); + if (locale1_end != NULL) + locale1_len = locale1_end - locale1; + else + locale1_len = strlen (locale1); + } + { + const char *locale2_end = strchr (locale2, '_'); + if (locale2_end != NULL) + locale2_len = locale2_end - locale2; + else + locale2_len = strlen (locale2); + } + + if (locale1_len < locale2_len) + { + cmp = memcmp (locale1, locale2, locale1_len); + if (cmp == 0) + cmp = -1; + } + else + { + cmp = memcmp (locale1, locale2, locale2_len); + if (locale1_len > locale2_len && cmp == 0) + cmp = 1; + } + + return cmp; +} + +/* Given a locale name, return the main locale with the same language, + or NULL if not found. + For example: "fr_DE" -> "fr_FR". */ +static const char * +get_main_locale_with_same_language (const char *locale) +{ +# define table locales_with_principal_territory + /* The table is sorted. Perform a binary search. */ + size_t hi = sizeof (table) / sizeof (table[0]); + size_t lo = 0; + while (lo < hi) + { + /* Invariant: + for i < lo, langcmp (table[i], locale) < 0, + for i >= hi, langcmp (table[i], locale) > 0. */ + size_t mid = (hi + lo) >> 1; /* >= lo, < hi */ + int cmp = langcmp (table[mid], locale); + if (cmp < 0) + lo = mid + 1; + else if (cmp > 0) + hi = mid; + else + { + /* Found an i with + langcmp (language_table[i], locale) == 0. + Verify that it is the only such i. */ + if (mid > lo && langcmp (table[mid - 1], locale) >= 0) + abort (); + if (mid + 1 < hi && langcmp (table[mid + 1], locale) <= 0) + abort (); + return table[mid]; + } + } +# undef table + return NULL; +} + +/* Mapping from territory to main language that is spoken in that territory. */ +static char const locales_with_principal_language[][6 + 1] = + { + /* This is based on the set of existing locales in glibc, with duplicates + removed, and on the Wikipedia pages named "Languages of <territory>". + If in doubt, use the locale that exists in macOS. For example, the only + "*_IN" locale in macOS 10.13 is "hi_IN", so use that. */ + /* A useful shell function for producing a line of this table is: + func_line () + { + # Usage: func_line ll_CC + ll=`echo "$1" | sed -e 's|_.*||'` + cc=`echo "$1" | sed -e 's|^.*_||'` + llx=`sed -n -e "s|^${ll} ||p" < gettext-tools/doc/ISO_639` + ccx=`expand gettext-tools/doc/ISO_3166 | sed -n -e "s|^${cc} *||p"` + echo " \"$1\", /$X* ${llx} ${ccx} *$X/" + } + */ + /* Main language Territory */ + "ca_AD", /* Catalan Andorra */ + "ar_AE", /* Arabic United Arab Emirates */ + "ps_AF", /* Pashto Afghanistan */ + "en_AG", /* English Antigua and Barbuda */ + "sq_AL", /* Albanian Albania */ + "hy_AM", /* Armenian Armenia */ + "pap_AN", /* Papiamento Netherlands Antilles - this line can be removed in 2018 */ + "pt_AO", /* Portuguese Angola */ + "es_AR", /* Spanish Argentina */ + "de_AT", /* German Austria */ + "en_AU", /* English Australia */ + /* Aruba has two official languages: "nl_AW", "pap_AW". */ + "az_AZ", /* Azerbaijani Azerbaijan */ + "bs_BA", /* Bosnian Bosnia */ + "bn_BD", /* Bengali Bangladesh */ + "nl_BE", /* Dutch Belgium */ + "fr_BF", /* French Burkina Faso */ + "bg_BG", /* Bulgarian Bulgaria */ + "ar_BH", /* Arabic Bahrain */ + "rn_BI", /* Kirundi Burundi */ + "fr_BJ", /* French Benin */ + "es_BO", /* Spanish Bolivia */ + "pt_BR", /* Portuguese Brazil */ + "dz_BT", /* Dzongkha Bhutan */ + "en_BW", /* English Botswana */ + "be_BY", /* Belarusian Belarus */ + "en_CA", /* English Canada */ + "fr_CD", /* French Democratic Republic of Congo */ + "sg_CF", /* Sango Central African Republic */ + "de_CH", /* German Switzerland */ + "es_CL", /* Spanish Chile */ + "zh_CN", /* Chinese China */ + "es_CO", /* Spanish Colombia */ + "es_CR", /* Spanish Costa Rica */ + "es_CU", /* Spanish Cuba */ + /* Curaçao has three official languages: "nl_CW", "pap_CW", "en_CW". */ + "el_CY", /* Greek Cyprus */ + "cs_CZ", /* Czech Czech Republic */ + "de_DE", /* German Germany */ + /* Djibouti has two official languages: "ar_DJ" and "fr_DJ". */ + "da_DK", /* Danish Denmark */ + "es_DO", /* Spanish Dominican Republic */ + "ar_DZ", /* Arabic Algeria */ + "es_EC", /* Spanish Ecuador */ + "et_EE", /* Estonian Estonia */ + "ar_EG", /* Arabic Egypt */ + "ti_ER", /* Tigrinya Eritrea */ + "es_ES", /* Spanish Spain */ + "am_ET", /* Amharic Ethiopia */ + "fi_FI", /* Finnish Finland */ + /* Fiji has three official languages: "en_FJ", "fj_FJ", "hif_FJ". */ + "fo_FO", /* Faroese Faeroe Islands */ + "fr_FR", /* French France */ + "en_GB", /* English Britain */ + "ka_GE", /* Georgian Georgia */ + "en_GH", /* English Ghana */ + "kl_GL", /* Kalaallisut Greenland */ + "fr_GN", /* French Guinea */ + "el_GR", /* Greek Greece */ + "es_GT", /* Spanish Guatemala */ + "zh_HK", /* Chinese Hong Kong */ + "es_HN", /* Spanish Honduras */ + "hr_HR", /* Croatian Croatia */ + "ht_HT", /* Haitian Haiti */ + "hu_HU", /* Hungarian Hungary */ + "id_ID", /* Indonesian Indonesia */ + "en_IE", /* English Ireland */ + "he_IL", /* Hebrew Israel */ + "hi_IN", /* Hindi India */ + "ar_IQ", /* Arabic Iraq */ + "fa_IR", /* Persian Iran */ + "is_IS", /* Icelandic Iceland */ + "it_IT", /* Italian Italy */ + "ar_JO", /* Arabic Jordan */ + "ja_JP", /* Japanese Japan */ + "sw_KE", /* Swahili Kenya */ + "ky_KG", /* Kyrgyz Kyrgyzstan */ + "km_KH", /* Central Khmer Cambodia */ + "ko_KR", /* Korean Korea (South) */ + "ar_KW", /* Arabic Kuwait */ + "kk_KZ", /* Kazakh Kazakhstan */ + "lo_LA", /* Laotian Laos */ + "ar_LB", /* Arabic Lebanon */ + "de_LI", /* German Liechtenstein */ + "si_LK", /* Sinhala Sri Lanka */ + "lt_LT", /* Lithuanian Lithuania */ + /* Luxembourg has three official languages: "lb_LU", "fr_LU", "de_LU". */ + "lv_LV", /* Latvian Latvia */ + "ar_LY", /* Arabic Libya */ + "ar_MA", /* Arabic Morocco */ + "sr_ME", /* Serbian Montenegro */ + "mg_MG", /* Malagasy Madagascar */ + "mk_MK", /* Macedonian North Macedonia */ + "fr_ML", /* French Mali */ + "my_MM", /* Burmese Myanmar */ + "mn_MN", /* Mongolian Mongolia */ + "mt_MT", /* Maltese Malta */ + "mfe_MU", /* Mauritian Creole Mauritius */ + "dv_MV", /* Divehi Maldives */ + "ny_MW", /* Chichewa Malawi */ + "es_MX", /* Spanish Mexico */ + "ms_MY", /* Malay Malaysia */ + "en_NG", /* English Nigeria */ + "es_NI", /* Spanish Nicaragua */ + "nl_NL", /* Dutch Netherlands */ + "no_NO", /* Norwegian Norway */ + "ne_NP", /* Nepali Nepal */ + "na_NR", /* Nauru Nauru */ + "niu_NU", /* Niuean Niue */ + "en_NZ", /* English New Zealand */ + "ar_OM", /* Arabic Oman */ + "es_PA", /* Spanish Panama */ + "es_PE", /* Spanish Peru */ + "tpi_PG", /* Tok Pisin Papua New Guinea */ + "fil_PH", /* Filipino Philippines */ + "pa_PK", /* Punjabi Pakistan */ + "pl_PL", /* Polish Poland */ + "es_PR", /* Spanish Puerto Rico */ + "pt_PT", /* Portuguese Portugal */ + "es_PY", /* Spanish Paraguay */ + "ar_QA", /* Arabic Qatar */ + "ro_RO", /* Romanian Romania */ + "sr_RS", /* Serbian Serbia */ + "ru_RU", /* Russian Russia */ + "rw_RW", /* Kinyarwanda Rwanda */ + "ar_SA", /* Arabic Saudi Arabia */ + "en_SC", /* English Seychelles */ + "ar_SD", /* Arabic Sudan */ + "sv_SE", /* Swedish Sweden */ + "en_SG", /* English Singapore */ + "sl_SI", /* Slovenian Slovenia */ + "sk_SK", /* Slovak Slovakia */ + "en_SL", /* English Sierra Leone */ + "fr_SN", /* French Senegal */ + "so_SO", /* Somali Somalia */ + "ar_SS", /* Arabic South Sudan */ + "es_SV", /* Spanish El Salvador */ + "ar_SY", /* Arabic Syria */ + "th_TH", /* Thai Thailand */ + "tg_TJ", /* Tajik Tajikistan */ + "tk_TM", /* Turkmen Turkmenistan */ + "ar_TN", /* Arabic Tunisia */ + "to_TO", /* Tonga Tonga */ + "tr_TR", /* Turkish Turkey */ + "zh_TW", /* Chinese Taiwan */ + "sw_TZ", /* Swahili Tanzania */ + "uk_UA", /* Ukrainian Ukraine */ + "lg_UG", /* Ganda Uganda */ + "en_US", /* English United States of America */ + "es_UY", /* Spanish Uruguay */ + "uz_UZ", /* Uzbek Uzbekistan */ + "es_VE", /* Spanish Venezuela */ + "vi_VN", /* Vietnamese Vietnam */ + "bi_VU", /* Bislama Vanuatu */ + "sm_WS", /* Samoan Samoa */ + "ar_YE", /* Arabic Yemen */ + "en_ZA", /* English South Africa */ + "en_ZM", /* English Zambia */ + "en_ZW" /* English Zimbabwe */ + }; + +/* Compare just the territory part of two locale names. */ +static int +terrcmp (const char *locale1, const char *locale2) +{ + const char *territory1 = strrchr (locale1, '_') + 1; + const char *territory2 = strrchr (locale2, '_') + 1; + + return strcmp (territory1, territory2); +} + +/* Given a locale name, return the locale corresponding to the main language + with the same territory, or NULL if not found. + For example: "fr_DE" -> "de_DE". */ +static const char * +get_main_locale_with_same_territory (const char *locale) +{ + if (strrchr (locale, '_') != NULL) + { +# define table locales_with_principal_language + /* The table is sorted. Perform a binary search. */ + size_t hi = sizeof (table) / sizeof (table[0]); + size_t lo = 0; + while (lo < hi) + { + /* Invariant: + for i < lo, terrcmp (table[i], locale) < 0, + for i >= hi, terrcmp (table[i], locale) > 0. */ + size_t mid = (hi + lo) >> 1; /* >= lo, < hi */ + int cmp = terrcmp (table[mid], locale); + if (cmp < 0) + lo = mid + 1; + else if (cmp > 0) + hi = mid; + else + { + /* Found an i with + terrcmp (language_table[i], locale) == 0. + Verify that it is the only such i. */ + if (mid > lo && terrcmp (table[mid - 1], locale) >= 0) + abort (); + if (mid + 1 < hi && terrcmp (table[mid + 1], locale) <= 0) + abort (); + return table[mid]; + } + } +# undef table + } + return NULL; +} + +# endif char * -rpl_setlocale (int category, const char *locale) +setlocale_improved (int category, const char *locale) { if (locale != NULL && locale[0] == '\0') { @@ -877,14 +1462,14 @@ rpl_setlocale (int category, const char *locale) goto fail; i = 0; } -# if defined _WIN32 && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ /* On native Windows, setlocale(LC_ALL,...) may succeed but set the LC_CTYPE category to an invalid value ("C") when it does not support the specified encoding. Report a failure instead. */ if (strchr (base_name, '.') != NULL && strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) goto fail; -# endif +# endif for (; i < sizeof (categories) / sizeof (categories[0]); i++) { @@ -898,30 +1483,32 @@ rpl_setlocale (int category, const char *locale) /* If name is the same as base_name, it has already been set through the setlocale call before the loop. */ if (strcmp (name, base_name) != 0 -# if LC_MESSAGES == 1729 +# if LC_MESSAGES == 1729 || cat == LC_MESSAGES -# endif +# endif ) if (setlocale_single (cat, name) == NULL) -# if defined __APPLE__ && defined __MACH__ +# if defined __APPLE__ && defined __MACH__ { /* On Mac OS X 10.13, some locales can be set through System Preferences > Language & Region, that are not supported by libc. The system's setlocale() falls - back to "C" for these locale categories. We can possibly - do better. If we can't, print a warning, to limit user + back to "C" for these locale categories. We can do + better, by trying an existing locale with the same + language or an existing locale with the same territory. + If we can't, print a warning, to limit user expectations. */ - int warn = 1; + int warn = 0; if (cat == LC_CTYPE) warn = (setlocale_single (cat, "UTF-8") == NULL); -# if HAVE_CFLOCALECOPYPREFERREDLANGUAGES || HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.4 or newer */ else if (cat == LC_MESSAGES) { +# if HAVE_CFLOCALECOPYPREFERREDLANGUAGES || HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.4 or newer */ /* Take the primary language preference. */ -# if HAVE_CFLOCALECOPYPREFERREDLANGUAGES /* MacOS X 10.5 or newer */ +# if HAVE_CFLOCALECOPYPREFERREDLANGUAGES /* MacOS X 10.5 or newer */ CFArrayRef prefArray = CFLocaleCopyPreferredLanguages (); -# elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.4 or newer */ +# elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.4 or newer */ CFTypeRef preferences = CFPreferencesCopyAppValue (CFSTR ("AppleLanguages"), kCFPreferencesCurrentApplication); @@ -929,7 +1516,7 @@ rpl_setlocale (int category, const char *locale) && CFGetTypeID (preferences) == CFArrayGetTypeID ()) { CFArrayRef prefArray = (CFArrayRef)preferences; -# endif +# endif int n = CFArrayGetCount (prefArray); if (n > 0) { @@ -952,36 +1539,71 @@ rpl_setlocale (int category, const char *locale) gl_locale_name_canonicalize (buf); /* Try setlocale with this value. */ - warn = (setlocale_single (cat, buf) == NULL); + if (setlocale_single (cat, buf) == NULL) + { + const char *last_try = + get_main_locale_with_same_language (buf); + + if (last_try == NULL + || setlocale_single (cat, last_try) == NULL) + warn = 1; + } } } -# if HAVE_CFLOCALECOPYPREFERREDLANGUAGES /* MacOS X 10.5 or newer */ +# if HAVE_CFLOCALECOPYPREFERREDLANGUAGES /* MacOS X 10.5 or newer */ CFRelease (prefArray); -# elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.4 or newer */ +# elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.4 or newer */ } +# endif +# else + const char *last_try = + get_main_locale_with_same_language (name); + + if (last_try == NULL + || setlocale_single (cat, last_try) == NULL) + warn = 1; # endif } -# endif - /* No fallback possible for LC_NUMERIC. The application - should use the locale properties - kCFLocaleDecimalSeparator, kCFLocaleGroupingSeparator. - No fallback possible for LC_TIME. The application should - use the locale property kCFLocaleCalendarIdentifier. - No fallback possible for LC_COLLATE. The application - should use the locale properties - kCFLocaleCollationIdentifier, kCFLocaleCollatorIdentifier. - No fallback possible for LC_MONETARY. The application - should use the locale properties - kCFLocaleCurrencySymbol, kCFLocaleCurrencyCode. */ + else + { + /* For LC_NUMERIC, the application should use the locale + properties kCFLocaleDecimalSeparator, + kCFLocaleGroupingSeparator. + For LC_TIME, the application should use the locale + property kCFLocaleCalendarIdentifier. + For LC_COLLATE, the application should use the locale + properties kCFLocaleCollationIdentifier, + kCFLocaleCollatorIdentifier. + For LC_MONETARY, the applicationshould use the locale + properties kCFLocaleCurrencySymbol, + kCFLocaleCurrencyCode. + But since most applications don't have macOS specific + code like this, try an existing locale with the same + territory. */ + const char *last_try = + get_main_locale_with_same_territory (name); + + if (last_try == NULL + || setlocale_single (cat, last_try) == NULL) + warn = 1; + } if (warn) - fprintf (stderr, - "Warning: Failed to set locale category %s to %s.\n", - category_to_name (cat), name); + { + /* Warn only if the environment variable + SETLOCALE_VERBOSE is set. Otherwise these warnings + are just annoyances, since normal users won't invoke + 'localedef'. */ + const char *verbose = getenv ("SETLOCALE_VERBOSE"); + if (verbose != NULL && verbose[0] != '\0') + fprintf (stderr, + "Warning: Failed to set locale category %s to %s.\n", + category_to_name (cat), name); + } } -# else +# else goto fail; -# endif +# endif } /* All steps were successful. */ @@ -1006,7 +1628,7 @@ rpl_setlocale (int category, const char *locale) } else { -# if defined _WIN32 && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ if (category == LC_ALL && locale != NULL && strchr (locale, '.') != NULL) { char *saved_locale; @@ -1041,9 +1663,11 @@ rpl_setlocale (int category, const char *locale) return setlocale (LC_ALL, NULL); } else -# endif +# endif return setlocale_single (category, locale); } } +# endif /* NEED_SETLOCALE_IMPROVED */ + #endif diff --git a/gnulib-tests/setsockopt.c b/gnulib-tests/setsockopt.c index 1a7b583..ce0f9dd 100644 --- a/gnulib-tests/setsockopt.c +++ b/gnulib-tests/setsockopt.c @@ -1,6 +1,6 @@ /* setsockopt.c --- wrappers for Windows setsockopt function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/sig-handler.h b/gnulib-tests/sig-handler.h index 9ea3394..17604ea 100644 --- a/gnulib-tests/sig-handler.h +++ b/gnulib-tests/sig-handler.h @@ -1,6 +1,6 @@ /* Convenience declarations when working with <signal.h>. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/sigaction.c b/gnulib-tests/sigaction.c index 7e4af5f..792b3e8 100644 --- a/gnulib-tests/sigaction.c +++ b/gnulib-tests/sigaction.c @@ -1,5 +1,5 @@ /* POSIX compatible signal blocking. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. Written by Eric Blake <ebb9@byu.net>, 2008. This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/signal.in.h b/gnulib-tests/signal.in.h index 7d4927b..9fe9f60 100644 --- a/gnulib-tests/signal.in.h +++ b/gnulib-tests/signal.in.h @@ -1,6 +1,6 @@ /* A GNU-like <signal.h>. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2020 Free Software Foundation, Inc. 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 @@ -144,7 +144,9 @@ _GL_FUNCDECL_SYS (pthread_sigmask, int, _GL_CXXALIAS_SYS (pthread_sigmask, int, (int how, const sigset_t *new_mask, sigset_t *old_mask)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (pthread_sigmask); +# endif #elif defined GNULIB_POSIXCHECK # undef pthread_sigmask # if HAVE_RAW_DECL_PTHREAD_SIGMASK @@ -168,7 +170,9 @@ _GL_FUNCDECL_SYS (raise, int, (int sig)); # endif _GL_CXXALIAS_SYS (raise, int, (int sig)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (raise); +# endif #elif defined GNULIB_POSIXCHECK # undef raise /* Assume raise is always declared. */ @@ -318,10 +322,18 @@ _GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t, _GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t, (int sig, _gl_function_taking_int_returning_void_t func)); # else +/* On OpenBSD, the declaration of 'signal' may not be present at this point, + because it occurs in <sys/signal.h>, not <signal.h> directly. */ +# if defined __OpenBSD__ +_GL_FUNCDECL_SYS (signal, _gl_function_taking_int_returning_void_t, + (int sig, _gl_function_taking_int_returning_void_t func)); +# endif _GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t, (int sig, _gl_function_taking_int_returning_void_t func)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (signal); +# endif # if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE /* Raise signal SIGPIPE. */ diff --git a/gnulib-tests/signature.h b/gnulib-tests/signature.h index adabfad..c586fec 100644 --- a/gnulib-tests/signature.h +++ b/gnulib-tests/signature.h @@ -1,5 +1,5 @@ /* Macro for checking that a function declaration is compliant. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/sigprocmask.c b/gnulib-tests/sigprocmask.c index 7a49bcd..d186106 100644 --- a/gnulib-tests/sigprocmask.c +++ b/gnulib-tests/sigprocmask.c @@ -1,5 +1,5 @@ /* POSIX compatible signal blocking. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2020 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2006. This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/sleep.c b/gnulib-tests/sleep.c index 8b75390..8aca605 100644 --- a/gnulib-tests/sleep.c +++ b/gnulib-tests/sleep.c @@ -1,5 +1,5 @@ /* Pausing execution of the current thread. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2007. This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/socket.c b/gnulib-tests/socket.c index 84f4d94..67c6b1e 100644 --- a/gnulib-tests/socket.c +++ b/gnulib-tests/socket.c @@ -1,6 +1,6 @@ /* socket.c --- wrappers for Windows socket function - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/sockets.c b/gnulib-tests/sockets.c index eec1ec8..9e3251a 100644 --- a/gnulib-tests/sockets.c +++ b/gnulib-tests/sockets.c @@ -1,6 +1,6 @@ /* sockets.c --- wrappers for Windows socket functions - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/sockets.h b/gnulib-tests/sockets.h index 5a83332..4575fc5 100644 --- a/gnulib-tests/sockets.h +++ b/gnulib-tests/sockets.h @@ -1,6 +1,6 @@ /* sockets.h - wrappers for Windows socket functions - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/stdio-impl.h b/gnulib-tests/stdio-impl.h index 393ef0c..067b95e 100644 --- a/gnulib-tests/stdio-impl.h +++ b/gnulib-tests/stdio-impl.h @@ -1,5 +1,5 @@ /* Implementation details of FILE streams. - Copyright (C) 2007-2008, 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2008, 2010-2020 Free Software Foundation, Inc. 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 @@ -18,11 +18,16 @@ the same implementation of stdio extension API, except that some fields have different naming conventions, or their access requires some casts. */ -/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this - problem by defining it ourselves. FIXME: Do not rely on glibc +/* Glibc 2.28 made _IO_UNBUFFERED and _IO_IN_BACKUP private. For now, work + around this problem by defining them ourselves. FIXME: Do not rely on glibc internals. */ -#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN -# define _IO_IN_BACKUP 0x100 +#if defined _IO_EOF_SEEN +# if !defined _IO_UNBUFFERED +# define _IO_UNBUFFERED 0x2 +# endif +# if !defined _IO_IN_BACKUP +# define _IO_IN_BACKUP 0x100 +# endif #endif /* BSD stdio derived implementations. */ @@ -61,6 +66,11 @@ # define _r pub._r # define _w pub._w # elif defined __ANDROID__ /* Android */ +# ifdef __LP64__ +# define _gl_flags_file_t int +# else +# define _gl_flags_file_t short +# endif /* Up to this commit from 2015-10-12 <https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a> the innards of FILE were public, and fp_ub could be defined like for OpenBSD, @@ -70,8 +80,8 @@ # define fp_ ((struct { unsigned char *_p; \ int _r; \ int _w; \ - int _flags; \ - int _file; \ + _gl_flags_file_t _flags; \ + _gl_flags_file_t _file; \ struct { unsigned char *_base; size_t _size; } _bf; \ int _lbfsize; \ void *_cookie; \ diff --git a/gnulib-tests/strdup.c b/gnulib-tests/strdup.c index ce43940..4da6007 100644 --- a/gnulib-tests/strdup.c +++ b/gnulib-tests/strdup.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2018 Free Software +/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gnulib-tests/strerror_r.c b/gnulib-tests/strerror_r.c index 2a22cb4..9ccc6c3 100644 --- a/gnulib-tests/strerror_r.c +++ b/gnulib-tests/strerror_r.c @@ -1,6 +1,6 @@ /* strerror_r.c --- POSIX compatible system error routine - Copyright (C) 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2010-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/symlink.c b/gnulib-tests/symlink.c index c1c4b40..e7dbd18 100644 --- a/gnulib-tests/symlink.c +++ b/gnulib-tests/symlink.c @@ -1,5 +1,5 @@ /* Stub for symlink(). - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/sys_ioctl.in.h b/gnulib-tests/sys_ioctl.in.h index 42a5ca4..8437adf 100644 --- a/gnulib-tests/sys_ioctl.in.h +++ b/gnulib-tests/sys_ioctl.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <sys/ioctl.h>. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/sys_select.in.h b/gnulib-tests/sys_select.in.h index 154e570..7a7b157 100644 --- a/gnulib-tests/sys_select.in.h +++ b/gnulib-tests/sys_select.in.h @@ -1,5 +1,5 @@ /* Substitute for <sys/select.h>. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 @@ -295,11 +295,11 @@ _GL_FUNCDECL_RPL (select, int, struct timeval *restrict)); _GL_CXXALIAS_RPL (select, int, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, - struct timeval *restrict)); + timeval *restrict)); # else _GL_CXXALIAS_SYS (select, int, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, - struct timeval *restrict)); + timeval *restrict)); # endif _GL_CXXALIASWARN (select); #elif @HAVE_WINSOCK2_H@ diff --git a/gnulib-tests/sys_socket.in.h b/gnulib-tests/sys_socket.in.h index ef65dc6..41f71f6 100644 --- a/gnulib-tests/sys_socket.in.h +++ b/gnulib-tests/sys_socket.in.h @@ -1,6 +1,6 @@ /* Provide a sys/socket header file for systems lacking it (read: MinGW) and for systems where it is incomplete. - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2020 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify @@ -169,7 +169,7 @@ struct sockaddr_storage code may not run on older Windows releases then. My Windows 2000 box was not able to run the code, for example. The situation is slightly confusing because - <https://msdn.microsoft.com/en-us/library/ms738520> + <https://docs.microsoft.com/en-us/windows/desktop/api/ws2tcpip/nf-ws2tcpip-getaddrinfo> suggests that getaddrinfo should be available on all Windows releases. */ @@ -517,7 +517,10 @@ _GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags) _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags)); # else -_GL_CXXALIAS_SYS (recv, ssize_t, (int fd, void *buf, size_t len, int flags)); +/* Need to cast, because on HP-UX 11.31 the return type may be + int, + depending on compiler options. */ +_GL_CXXALIAS_SYS_CAST (recv, ssize_t, (int fd, void *buf, size_t len, int flags)); # endif _GL_CXXALIASWARN (recv); #elif @HAVE_WINSOCK2_H@ @@ -543,8 +546,11 @@ _GL_FUNCDECL_RPL (send, ssize_t, _GL_CXXALIAS_RPL (send, ssize_t, (int fd, const void *buf, size_t len, int flags)); # else -_GL_CXXALIAS_SYS (send, ssize_t, - (int fd, const void *buf, size_t len, int flags)); +/* Need to cast, because on HP-UX 11.31 the return type may be + int, + depending on compiler options. */ +_GL_CXXALIAS_SYS_CAST (send, ssize_t, + (int fd, const void *buf, size_t len, int flags)); # endif _GL_CXXALIASWARN (send); #elif @HAVE_WINSOCK2_H@ diff --git a/gnulib-tests/sys_uio.in.h b/gnulib-tests/sys_uio.in.h index 0b5790b..8588d3c 100644 --- a/gnulib-tests/sys_uio.in.h +++ b/gnulib-tests/sys_uio.in.h @@ -1,5 +1,5 @@ /* Substitute for <sys/uio.h>. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-accept.c b/gnulib-tests/test-accept.c index 10228dc..cdf8cb2 100644 --- a/gnulib-tests/test-accept.c +++ b/gnulib-tests/test-accept.c @@ -1,5 +1,5 @@ /* Test accepting a connection to a server socket. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-alignof.c b/gnulib-tests/test-alignof.c index 6cd8a56..34eaec2 100644 --- a/gnulib-tests/test-alignof.c +++ b/gnulib-tests/test-alignof.c @@ -1,5 +1,5 @@ /* Test of <alignof.h>. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-alloca-opt.c b/gnulib-tests/test-alloca-opt.c index c8c82db..faf7c74 100644 --- a/gnulib-tests/test-alloca-opt.c +++ b/gnulib-tests/test-alloca-opt.c @@ -1,5 +1,5 @@ /* Test of optional automatic memory allocation. - Copyright (C) 2005, 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-arpa_inet.c b/gnulib-tests/test-arpa_inet.c index fd93721..b7234b3 100644 --- a/gnulib-tests/test-arpa_inet.c +++ b/gnulib-tests/test-arpa_inet.c @@ -1,5 +1,5 @@ /* Test of <arpa/inet.h> substitute. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-binary-io.c b/gnulib-tests/test-binary-io.c index be7cdf3..808b8b5 100644 --- a/gnulib-tests/test-binary-io.c +++ b/gnulib-tests/test-binary-io.c @@ -1,5 +1,5 @@ /* Test of binary mode I/O. - Copyright (C) 2005, 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2005, 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-binary-io.sh b/gnulib-tests/test-binary-io.sh index 38af099..a177d94 100755 --- a/gnulib-tests/test-binary-io.sh +++ b/gnulib-tests/test-binary-io.sh @@ -4,7 +4,7 @@ tmpfiles="" trap 'rm -fr $tmpfiles' 1 2 3 15 tmpfiles="$tmpfiles t-bin-out0.tmp t-bin-out1.tmp" -./test-binary-io${EXEEXT} 1 > t-bin-out1.tmp || exit 1 +${CHECKER} ./test-binary-io${EXEEXT} 1 > t-bin-out1.tmp || exit 1 cmp t-bin-out0.tmp t-bin-out1.tmp > /dev/null || exit 1 rm -fr $tmpfiles diff --git a/gnulib-tests/test-bind.c b/gnulib-tests/test-bind.c index 5c2c00b..2f38de9 100644 --- a/gnulib-tests/test-bind.c +++ b/gnulib-tests/test-bind.c @@ -1,5 +1,5 @@ /* Test binding a server socket to a port. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-btowc.c b/gnulib-tests/test-btowc.c index a19a61a..18ad71b 100644 --- a/gnulib-tests/test-btowc.c +++ b/gnulib-tests/test-btowc.c @@ -1,5 +1,5 @@ /* Test of conversion of unibyte character to wide character. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-btowc1.sh b/gnulib-tests/test-btowc1.sh index aaef48d..ab4b287 100755 --- a/gnulib-tests/test-btowc1.sh +++ b/gnulib-tests/test-btowc1.sh @@ -12,4 +12,4 @@ if test $LOCALE_FR = none; then fi LC_ALL=$LOCALE_FR \ -./test-btowc${EXEEXT} 1 +${CHECKER} ./test-btowc${EXEEXT} 1 diff --git a/gnulib-tests/test-btowc2.sh b/gnulib-tests/test-btowc2.sh index 2e06038..d7d4d9c 100755 --- a/gnulib-tests/test-btowc2.sh +++ b/gnulib-tests/test-btowc2.sh @@ -12,4 +12,4 @@ if test $LOCALE_FR_UTF8 = none; then fi LC_ALL=$LOCALE_FR_UTF8 \ -./test-btowc${EXEEXT} 2 +${CHECKER} ./test-btowc${EXEEXT} 2 diff --git a/gnulib-tests/test-c-ctype.c b/gnulib-tests/test-c-ctype.c index 735227a..0cf1fdf 100644 --- a/gnulib-tests/test-c-ctype.c +++ b/gnulib-tests/test-c-ctype.c @@ -1,5 +1,5 @@ /* Test of character handling in C locale. - Copyright (C) 2005, 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2005, 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-c-strcase.sh b/gnulib-tests/test-c-strcase.sh index 5fcf906..14bdfb2 100755 --- a/gnulib-tests/test-c-strcase.sh +++ b/gnulib-tests/test-c-strcase.sh @@ -1,21 +1,21 @@ #!/bin/sh # Test in the C locale. -./test-c-strcasecmp${EXEEXT} || exit 1 -./test-c-strncasecmp${EXEEXT} || exit 1 +${CHECKER} ./test-c-strcasecmp${EXEEXT} || exit 1 +${CHECKER} ./test-c-strncasecmp${EXEEXT} || exit 1 # Test in an ISO-8859-1 or ISO-8859-15 locale. : ${LOCALE_FR=fr_FR} if test $LOCALE_FR != none; then - LC_ALL=$LOCALE_FR ./test-c-strcasecmp${EXEEXT} locale || exit 1 - LC_ALL=$LOCALE_FR ./test-c-strncasecmp${EXEEXT} locale || exit 1 + LC_ALL=$LOCALE_FR ${CHECKER} ./test-c-strcasecmp${EXEEXT} locale || exit 1 + LC_ALL=$LOCALE_FR ${CHECKER} ./test-c-strncasecmp${EXEEXT} locale || exit 1 fi # Test in a Turkish UTF-8 locale. : ${LOCALE_TR_UTF8=tr_TR.UTF-8} if test $LOCALE_TR_UTF8 != none; then - LC_ALL=$LOCALE_TR_UTF8 ./test-c-strcasecmp${EXEEXT} locale || exit 1 - LC_ALL=$LOCALE_TR_UTF8 ./test-c-strncasecmp${EXEEXT} locale || exit 1 + LC_ALL=$LOCALE_TR_UTF8 ${CHECKER} ./test-c-strcasecmp${EXEEXT} locale || exit 1 + LC_ALL=$LOCALE_TR_UTF8 ${CHECKER} ./test-c-strncasecmp${EXEEXT} locale || exit 1 fi exit 0 diff --git a/gnulib-tests/test-c-strcasecmp.c b/gnulib-tests/test-c-strcasecmp.c index bc5494e..c73cb9d 100644 --- a/gnulib-tests/test-c-strcasecmp.c +++ b/gnulib-tests/test-c-strcasecmp.c @@ -1,5 +1,5 @@ /* Test of case-insensitive string comparison function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-c-strncasecmp.c b/gnulib-tests/test-c-strncasecmp.c index 4677bd4..bbef54f 100644 --- a/gnulib-tests/test-c-strncasecmp.c +++ b/gnulib-tests/test-c-strncasecmp.c @@ -1,5 +1,5 @@ /* Test of case-insensitive string comparison function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-canonicalize-lgpl.c b/gnulib-tests/test-canonicalize-lgpl.c index 4cec490..fb49b20 100644 --- a/gnulib-tests/test-canonicalize-lgpl.c +++ b/gnulib-tests/test-canonicalize-lgpl.c @@ -1,5 +1,5 @@ -/* Test of execution of program termination handlers. - Copyright (C) 2007-2018 Free Software Foundation, Inc. +/* Test of execution of file name canonicalization. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 @@ -16,6 +16,11 @@ /* Written by Bruno Haible <bruno@clisp.org>, 2007. */ +/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc + may "optimize" the null_ptr function, when its result gets passed to a + function that has an argument declared as _GL_ARG_NONNULL. */ +#define _GL_ARG_NONNULL(params) + #include <config.h> #include <stdlib.h> @@ -66,14 +71,22 @@ main (void) ASSERT (strstr (result, "/" BASE "/tra") == result + strlen (result) - strlen ("/" BASE "/tra")); free (result); + errno = 0; result = canonicalize_file_name (""); ASSERT (result == NULL); ASSERT (errno == ENOENT); + + /* This test works only if the canonicalize_file_name implementation + comes from gnulib. If it comes from libc, we have no way to prevent + gcc from "optimizing" the null_ptr function in invalid ways. See + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93156>. */ +#if GNULIB_defined_canonicalize_file_name errno = 0; result = canonicalize_file_name (null_ptr ()); ASSERT (result == NULL); ASSERT (errno == EINVAL); +#endif } /* Check that a non-directory with trailing slash yields NULL. */ diff --git a/gnulib-tests/test-chdir.c b/gnulib-tests/test-chdir.c index 80e4fca..9f0739d 100644 --- a/gnulib-tests/test-chdir.c +++ b/gnulib-tests/test-chdir.c @@ -1,5 +1,5 @@ /* Test changing to a directory. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-cloexec.c b/gnulib-tests/test-cloexec.c index 8f8fcf6..7c992df 100644 --- a/gnulib-tests/test-cloexec.c +++ b/gnulib-tests/test-cloexec.c @@ -1,5 +1,5 @@ /* Test duplicating non-inheritable file descriptors. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-close.c b/gnulib-tests/test-close.c index 36b0ef5..beb7768 100644 --- a/gnulib-tests/test-close.c +++ b/gnulib-tests/test-close.c @@ -1,5 +1,5 @@ /* Test closing a file or socket. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-connect.c b/gnulib-tests/test-connect.c index 644361c..7f35ad1 100644 --- a/gnulib-tests/test-connect.c +++ b/gnulib-tests/test-connect.c @@ -1,5 +1,5 @@ /* Test connecting a client socket. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-copy-acl-1.sh b/gnulib-tests/test-copy-acl-1.sh index 2f9880e..0fe44a5 100755 --- a/gnulib-tests/test-copy-acl-1.sh +++ b/gnulib-tests/test-copy-acl-1.sh @@ -3,11 +3,16 @@ # Test copy-acl on the file system of /var/tmp, which usually is a local # file system. +. "${srcdir=.}/init.sh"; path_prepend_ . + if test -d /var/tmp; then TMPDIR=/var/tmp else TMPDIR=/tmp fi +test -d $TMPDIR || Exit 77 export TMPDIR -exec "${srcdir}/test-copy-acl.sh" +$BOURNE_SHELL "${srcdir}/test-copy-acl.sh" + +Exit $? diff --git a/gnulib-tests/test-copy-acl-2.sh b/gnulib-tests/test-copy-acl-2.sh index 984602d..a35c12e 100755 --- a/gnulib-tests/test-copy-acl-2.sh +++ b/gnulib-tests/test-copy-acl-2.sh @@ -3,7 +3,11 @@ # Test copy-acl on the file system of the build directory, which may be # a local file system or NFS mounted. +. "${srcdir=.}/init.sh"; path_prepend_ . + TMPDIR=`pwd` export TMPDIR -exec "${srcdir}/test-copy-acl.sh" +$BOURNE_SHELL "${srcdir}/test-copy-acl.sh" + +Exit $? diff --git a/gnulib-tests/test-copy-acl.c b/gnulib-tests/test-copy-acl.c index 9176b56..e7c5e54 100644 --- a/gnulib-tests/test-copy-acl.c +++ b/gnulib-tests/test-copy-acl.c @@ -1,5 +1,5 @@ /* Test of copying of files. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-copy-acl.sh b/gnulib-tests/test-copy-acl.sh index 147bf56..9f69d14 100755 --- a/gnulib-tests/test-copy-acl.sh +++ b/gnulib-tests/test-copy-acl.sh @@ -41,7 +41,12 @@ func_tmpdir () } func_tmpdir -builddir=`pwd` +# builddir may already be set by the script that invokes this one. +case "$builddir" in + '') builddir=`pwd` ;; + /* | ?:*) ;; + *) builddir=`pwd`/$builddir ;; +esac cd "$builddir" || { echo "$0: cannot determine build directory (unreadable parent dir?)" >&2 @@ -204,9 +209,9 @@ cd "$builddir" || { echo "Simple contents" > "$2" chmod 600 "$2" - "$builddir"/test-copy-acl${EXEEXT} "$1" "$2" || exit 1 - "$builddir"/test-sameacls${EXEEXT} "$1" "$2" || exit 1 - func_test_same_acls "$1" "$2" || exit 1 + ${CHECKER} "$builddir"/test-copy-acl${EXEEXT} "$1" "$2" || exit 1 + ${CHECKER} "$builddir"/test-sameacls${EXEEXT} "$1" "$2" || exit 1 + func_test_same_acls "$1" "$2" || exit 1 } func_test_copy tmpfile0 tmpfile1 diff --git a/gnulib-tests/test-ctype.c b/gnulib-tests/test-ctype.c index 897e988..9fc1965 100644 --- a/gnulib-tests/test-ctype.c +++ b/gnulib-tests/test-ctype.c @@ -1,5 +1,5 @@ /* Test of <ctype.h> substitute. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-dirent.c b/gnulib-tests/test-dirent.c index 030cb49..f451322 100644 --- a/gnulib-tests/test-dirent.c +++ b/gnulib-tests/test-dirent.c @@ -1,5 +1,5 @@ /* Test of <dirent.h> substitute. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-dup2.c b/gnulib-tests/test-dup2.c index 6654254..7f7b1c4 100644 --- a/gnulib-tests/test-dup2.c +++ b/gnulib-tests/test-dup2.c @@ -1,5 +1,5 @@ /* Test duplicating file descriptors. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-environ.c b/gnulib-tests/test-environ.c index 9fab110..55ccd5d 100644 --- a/gnulib-tests/test-environ.c +++ b/gnulib-tests/test-environ.c @@ -1,5 +1,5 @@ /* Test of environ variable. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-errno.c b/gnulib-tests/test-errno.c index 581c93c..54f5ae6 100644 --- a/gnulib-tests/test-errno.c +++ b/gnulib-tests/test-errno.c @@ -1,5 +1,5 @@ /* Test of <errno.h> substitute. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fcntl-h.c b/gnulib-tests/test-fcntl-h.c index d861f51..22a6212 100644 --- a/gnulib-tests/test-fcntl-h.c +++ b/gnulib-tests/test-fcntl-h.c @@ -1,5 +1,5 @@ /* Test of <fcntl.h> substitute. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fcntl.c b/gnulib-tests/test-fcntl.c index 5d64674..d5e7e63 100644 --- a/gnulib-tests/test-fcntl.c +++ b/gnulib-tests/test-fcntl.c @@ -1,5 +1,5 @@ /* Test of fcntl(2). - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fdopen.c b/gnulib-tests/test-fdopen.c index a1229f1..e10a858 100644 --- a/gnulib-tests/test-fdopen.c +++ b/gnulib-tests/test-fdopen.c @@ -1,5 +1,5 @@ /* Test opening a stream with a file descriptor. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fflush.c b/gnulib-tests/test-fflush.c index 4010557..cf61905 100644 --- a/gnulib-tests/test-fflush.c +++ b/gnulib-tests/test-fflush.c @@ -1,5 +1,5 @@ /* Test of POSIX compatible fflush() function. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fflush2.c b/gnulib-tests/test-fflush2.c index 22796c7..acca0ae 100644 --- a/gnulib-tests/test-fflush2.c +++ b/gnulib-tests/test-fflush2.c @@ -1,5 +1,5 @@ /* Test of POSIX compatible fflush() function. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 @@ -69,16 +69,10 @@ main (int argc, char **argv) according to the Austin Group's resolution on 2009-01-08. */ /* Check that fflush after a non-backup ungetc() call discards the ungetc buffer. This is mandated by POSIX - <http://www.opengroup.org/susv3/functions/ungetc.html>: - "The value of the file-position indicator for the stream after - reading or discarding all pushed-back bytes shall be the same - as it was before the bytes were pushed back." - <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> - "[After fflush(),] the file offset of the underlying open file - description shall be set to the file position of the stream, and - any characters pushed back onto the stream by ungetc() or - ungetwc() that have not subsequently been read from the stream - shall be discarded." */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fflush.html>: + "...any characters pushed back onto the stream by ungetc() + or ungetwc() that have not subsequently been read from the + stream shall be discarded..." */ c = fgetc (stdin); ASSERT (c == '#'); diff --git a/gnulib-tests/test-fflush2.sh b/gnulib-tests/test-fflush2.sh index ef77fa4..0d8859d 100755 --- a/gnulib-tests/test-fflush2.sh +++ b/gnulib-tests/test-fflush2.sh @@ -2,8 +2,8 @@ # Execute the test only with seekable input stream. # The behaviour of fflush() on a non-seekable input stream is undefined. -./test-fflush2${EXEEXT} 1 < "$srcdir/test-fflush2.sh" || exit $? -./test-fflush2${EXEEXT} 2 < "$srcdir/test-fflush2.sh" || exit $? -#cat "$srcdir/test-fflush2.sh" | ./test-fflush2${EXEEXT} || exit $? +${CHECKER} ./test-fflush2${EXEEXT} 1 < "$srcdir/test-fflush2.sh" || exit $? +${CHECKER} ./test-fflush2${EXEEXT} 2 < "$srcdir/test-fflush2.sh" || exit $? +#cat "$srcdir/test-fflush2.sh" | ${CHECKER} ./test-fflush2${EXEEXT} || exit $? exit 0 diff --git a/gnulib-tests/test-fgetc.c b/gnulib-tests/test-fgetc.c index f54599c..42db301 100644 --- a/gnulib-tests/test-fgetc.c +++ b/gnulib-tests/test-fgetc.c @@ -1,5 +1,5 @@ /* Test of fgetc() function. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-file-has-acl-1.sh b/gnulib-tests/test-file-has-acl-1.sh index e3ad9c0..c789d22 100755 --- a/gnulib-tests/test-file-has-acl-1.sh +++ b/gnulib-tests/test-file-has-acl-1.sh @@ -3,11 +3,16 @@ # Test file-has-acl on the file system of /var/tmp, which usually is a local # file system. +. "${srcdir=.}/init.sh"; path_prepend_ . + if test -d /var/tmp; then TMPDIR=/var/tmp else TMPDIR=/tmp fi +test -d $TMPDIR || Exit 77 export TMPDIR -exec "${srcdir}/test-file-has-acl.sh" +$BOURNE_SHELL "${srcdir}/test-file-has-acl.sh" + +Exit $? diff --git a/gnulib-tests/test-file-has-acl-2.sh b/gnulib-tests/test-file-has-acl-2.sh index 6b92b1d..41561d6 100755 --- a/gnulib-tests/test-file-has-acl-2.sh +++ b/gnulib-tests/test-file-has-acl-2.sh @@ -3,7 +3,11 @@ # Test file-has-acl on the file system of the build directory, which may be # a local file system or NFS mounted. +. "${srcdir=.}/init.sh"; path_prepend_ . + TMPDIR=`pwd` export TMPDIR -exec "${srcdir}/test-file-has-acl.sh" +$BOURNE_SHELL "${srcdir}/test-file-has-acl.sh" + +Exit $? diff --git a/gnulib-tests/test-file-has-acl.c b/gnulib-tests/test-file-has-acl.c index 3c11c55..35f8658 100644 --- a/gnulib-tests/test-file-has-acl.c +++ b/gnulib-tests/test-file-has-acl.c @@ -1,5 +1,5 @@ /* Test for presence of ACL. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-file-has-acl.sh b/gnulib-tests/test-file-has-acl.sh index 26610c1..09d18da 100755 --- a/gnulib-tests/test-file-has-acl.sh +++ b/gnulib-tests/test-file-has-acl.sh @@ -41,7 +41,12 @@ func_tmpdir () } func_tmpdir -builddir=`pwd` +# builddir may already be set by the script that invokes this one. +case "$builddir" in + '') builddir=`pwd` ;; + /* | ?:*) ;; + *) builddir=`pwd`/$builddir ;; +esac cd "$builddir" || { echo "$0: cannot determine build directory (unreadable parent dir?)" >&2 @@ -129,7 +134,7 @@ cd "$builddir" || # matches the expected value. func_test_file_has_acl () { - res=`"$builddir"/test-file-has-acl${EXEEXT} "$1"` + res=`${CHECKER} "$builddir"/test-file-has-acl${EXEEXT} "$1"` test "$res" = "$2" || { echo "file_has_acl(\"$1\") returned $res, expected $2" 1>&2 exit 1 diff --git a/gnulib-tests/test-fpending.c b/gnulib-tests/test-fpending.c index fbe6c10..a0bdd96 100644 --- a/gnulib-tests/test-fpending.c +++ b/gnulib-tests/test-fpending.c @@ -1,6 +1,6 @@ /* Ensure that __fpending works. - Copyright (C) 2004, 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2004, 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fpending.sh b/gnulib-tests/test-fpending.sh index 636af25..abe7d83 100755 --- a/gnulib-tests/test-fpending.sh +++ b/gnulib-tests/test-fpending.sh @@ -5,7 +5,7 @@ trap 'rm -fr $tmpfile' 1 2 3 15 tmpfile=test-fpending.t -./test-fpending${EXEEXT} > $tmpfile || exit 1 +${CHECKER} ./test-fpending${EXEEXT} > $tmpfile || exit 1 rm -fr $tmpfile diff --git a/gnulib-tests/test-fpurge.c b/gnulib-tests/test-fpurge.c index b100c3a..3bca176 100644 --- a/gnulib-tests/test-fpurge.c +++ b/gnulib-tests/test-fpurge.c @@ -1,5 +1,5 @@ /* Test of fpurge() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fputc.c b/gnulib-tests/test-fputc.c index 788877b..e8e25b8 100644 --- a/gnulib-tests/test-fputc.c +++ b/gnulib-tests/test-fputc.c @@ -1,5 +1,5 @@ /* Test of fputc() function. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fread.c b/gnulib-tests/test-fread.c index 4fe20f8..08b3a11 100644 --- a/gnulib-tests/test-fread.c +++ b/gnulib-tests/test-fread.c @@ -1,5 +1,5 @@ /* Test of fread() function. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-freading.c b/gnulib-tests/test-freading.c index 1658b10..f2abd1f 100644 --- a/gnulib-tests/test-freading.c +++ b/gnulib-tests/test-freading.c @@ -1,5 +1,5 @@ /* Test of freading() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fseek.c b/gnulib-tests/test-fseek.c index c8191bd..ae653a7 100644 --- a/gnulib-tests/test-fseek.c +++ b/gnulib-tests/test-fseek.c @@ -1,5 +1,5 @@ /* Test of fseek() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fseek.sh b/gnulib-tests/test-fseek.sh index bad6c08..4ad3fda 100755 --- a/gnulib-tests/test-fseek.sh +++ b/gnulib-tests/test-fseek.sh @@ -1,5 +1,5 @@ #!/bin/sh -./test-fseek${EXEEXT} 1 < "$srcdir/test-fseek.sh" || exit 1 -echo hi | ./test-fseek${EXEEXT} || exit 1 +${CHECKER} ./test-fseek${EXEEXT} 1 < "$srcdir/test-fseek.sh" || exit 1 +echo hi | ${CHECKER} ./test-fseek${EXEEXT} || exit 1 exit 0 diff --git a/gnulib-tests/test-fseek2.sh b/gnulib-tests/test-fseek2.sh index a4c9cb7..beadc98 100755 --- a/gnulib-tests/test-fseek2.sh +++ b/gnulib-tests/test-fseek2.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec ./test-fseek${EXEEXT} 1 2 < "$srcdir/test-fseek2.sh" +exec ${CHECKER} ./test-fseek${EXEEXT} 1 2 < "$srcdir/test-fseek2.sh" diff --git a/gnulib-tests/test-fseeko.c b/gnulib-tests/test-fseeko.c index f412789..2452999 100644 --- a/gnulib-tests/test-fseeko.c +++ b/gnulib-tests/test-fseeko.c @@ -1,5 +1,5 @@ /* Test of fseeko() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fseeko.sh b/gnulib-tests/test-fseeko.sh index 5c55827..c7b675e 100755 --- a/gnulib-tests/test-fseeko.sh +++ b/gnulib-tests/test-fseeko.sh @@ -1,5 +1,5 @@ #!/bin/sh -./test-fseeko${EXEEXT} 1 < "$srcdir/test-fseeko.sh" || exit 1 -echo hi | ./test-fseeko${EXEEXT} || exit 1 +${CHECKER} ./test-fseeko${EXEEXT} 1 < "$srcdir/test-fseeko.sh" || exit 1 +echo hi | ${CHECKER} ./test-fseeko${EXEEXT} || exit 1 exit 0 diff --git a/gnulib-tests/test-fseeko2.sh b/gnulib-tests/test-fseeko2.sh index 6e1130c..7bf315e 100755 --- a/gnulib-tests/test-fseeko2.sh +++ b/gnulib-tests/test-fseeko2.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec ./test-fseeko${EXEEXT} 1 2 < "$srcdir/test-fseeko2.sh" +exec ${CHECKER} ./test-fseeko${EXEEXT} 1 2 < "$srcdir/test-fseeko2.sh" diff --git a/gnulib-tests/test-fseeko3.c b/gnulib-tests/test-fseeko3.c index 31fce62..78b79c6 100644 --- a/gnulib-tests/test-fseeko3.c +++ b/gnulib-tests/test-fseeko3.c @@ -1,5 +1,5 @@ /* Test of fseeko() function. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fseeko3.sh b/gnulib-tests/test-fseeko3.sh index c50b4a2..254d0cb 100755 --- a/gnulib-tests/test-fseeko3.sh +++ b/gnulib-tests/test-fseeko3.sh @@ -1,7 +1,7 @@ #!/bin/sh -./test-fseeko3${EXEEXT} 0 "$srcdir/test-fseeko3.sh" || exit 1 +${CHECKER} ./test-fseeko3${EXEEXT} 0 "$srcdir/test-fseeko3.sh" || exit 1 -./test-fseeko3${EXEEXT} 1 "$srcdir/test-fseeko3.sh" || exit 1 +${CHECKER} ./test-fseeko3${EXEEXT} 1 "$srcdir/test-fseeko3.sh" || exit 1 exit 0 diff --git a/gnulib-tests/test-fseeko4.c b/gnulib-tests/test-fseeko4.c index bd2c64c..5e19c27 100644 --- a/gnulib-tests/test-fseeko4.c +++ b/gnulib-tests/test-fseeko4.c @@ -1,5 +1,5 @@ /* Test of fseeko() function. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fseeko4.sh b/gnulib-tests/test-fseeko4.sh index e6464ae..7a4d352 100755 --- a/gnulib-tests/test-fseeko4.sh +++ b/gnulib-tests/test-fseeko4.sh @@ -1,5 +1,5 @@ #!/bin/sh -./test-fseeko4${EXEEXT} "$srcdir/test-fseeko4.sh" || exit 1 +${CHECKER} ./test-fseeko4${EXEEXT} "$srcdir/test-fseeko4.sh" || exit 1 exit 0 diff --git a/gnulib-tests/test-fstat.c b/gnulib-tests/test-fstat.c index 16d8406..621498c 100644 --- a/gnulib-tests/test-fstat.c +++ b/gnulib-tests/test-fstat.c @@ -1,5 +1,5 @@ /* Tests of fstat() function. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-ftell.c b/gnulib-tests/test-ftell.c index 1bfab20..859fec7 100644 --- a/gnulib-tests/test-ftell.c +++ b/gnulib-tests/test-ftell.c @@ -1,5 +1,5 @@ /* Test of ftell() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-ftell.sh b/gnulib-tests/test-ftell.sh index bf55d2e..5c27808 100755 --- a/gnulib-tests/test-ftell.sh +++ b/gnulib-tests/test-ftell.sh @@ -1,5 +1,5 @@ #!/bin/sh -./test-ftell${EXEEXT} 1 < "$srcdir/test-ftell.sh" || exit 1 -echo hi | ./test-ftell${EXEEXT} || exit 1 +${CHECKER} ./test-ftell${EXEEXT} 1 < "$srcdir/test-ftell.sh" || exit 1 +echo hi | ${CHECKER} ./test-ftell${EXEEXT} || exit 1 exit 0 diff --git a/gnulib-tests/test-ftell2.sh b/gnulib-tests/test-ftell2.sh index 3b645b8..7d116d2 100755 --- a/gnulib-tests/test-ftell2.sh +++ b/gnulib-tests/test-ftell2.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec ./test-ftell${EXEEXT} 1 2 < "$srcdir/test-ftell2.sh" +exec ${CHECKER} ./test-ftell${EXEEXT} 1 2 < "$srcdir/test-ftell2.sh" diff --git a/gnulib-tests/test-ftell3.c b/gnulib-tests/test-ftell3.c index d0f4f10..1feafcb 100644 --- a/gnulib-tests/test-ftell3.c +++ b/gnulib-tests/test-ftell3.c @@ -1,5 +1,5 @@ /* Test of ftell() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-ftello.c b/gnulib-tests/test-ftello.c index f33ccde..71936a1 100644 --- a/gnulib-tests/test-ftello.c +++ b/gnulib-tests/test-ftello.c @@ -1,5 +1,5 @@ /* Test of ftello() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-ftello.sh b/gnulib-tests/test-ftello.sh index 33d2e83..e8db061 100755 --- a/gnulib-tests/test-ftello.sh +++ b/gnulib-tests/test-ftello.sh @@ -1,5 +1,5 @@ #!/bin/sh -./test-ftello${EXEEXT} 1 < "$srcdir/test-ftello.sh" || exit 1 -echo hi | ./test-ftello${EXEEXT} || exit 1 +${CHECKER} ./test-ftello${EXEEXT} 1 < "$srcdir/test-ftello.sh" || exit 1 +echo hi | ${CHECKER} ./test-ftello${EXEEXT} || exit 1 exit 0 diff --git a/gnulib-tests/test-ftello2.sh b/gnulib-tests/test-ftello2.sh index ba750b0..63a222c 100755 --- a/gnulib-tests/test-ftello2.sh +++ b/gnulib-tests/test-ftello2.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec ./test-ftello${EXEEXT} 1 2 < "$srcdir/test-ftello2.sh" +exec ${CHECKER} ./test-ftello${EXEEXT} 1 2 < "$srcdir/test-ftello2.sh" diff --git a/gnulib-tests/test-ftello3.c b/gnulib-tests/test-ftello3.c index 77eae43..f693596 100644 --- a/gnulib-tests/test-ftello3.c +++ b/gnulib-tests/test-ftello3.c @@ -1,5 +1,5 @@ /* Test of ftello() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-ftello4.c b/gnulib-tests/test-ftello4.c index 07e11f1..54cfe75 100644 --- a/gnulib-tests/test-ftello4.c +++ b/gnulib-tests/test-ftello4.c @@ -1,5 +1,5 @@ /* Test of ftello() function. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-ftello4.sh b/gnulib-tests/test-ftello4.sh index e3702bb..f7ff149 100755 --- a/gnulib-tests/test-ftello4.sh +++ b/gnulib-tests/test-ftello4.sh @@ -1,5 +1,5 @@ #!/bin/sh -./test-ftello4${EXEEXT} "$srcdir/test-ftello4.sh" || exit 1 +${CHECKER} ./test-ftello4${EXEEXT} "$srcdir/test-ftello4.sh" || exit 1 exit 0 diff --git a/gnulib-tests/test-ftruncate.c b/gnulib-tests/test-ftruncate.c index 6f597fb..3ad7edd 100644 --- a/gnulib-tests/test-ftruncate.c +++ b/gnulib-tests/test-ftruncate.c @@ -1,5 +1,5 @@ /* Test truncating a file. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-ftruncate.sh b/gnulib-tests/test-ftruncate.sh index d7394d2..203e07b 100755 --- a/gnulib-tests/test-ftruncate.sh +++ b/gnulib-tests/test-ftruncate.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec ./test-ftruncate${EXEEXT} "$srcdir/test-ftruncate.sh" +exec ${CHECKER} ./test-ftruncate${EXEEXT} "$srcdir/test-ftruncate.sh" diff --git a/gnulib-tests/test-fwrite.c b/gnulib-tests/test-fwrite.c index 12012db..9ff0d07 100644 --- a/gnulib-tests/test-fwrite.c +++ b/gnulib-tests/test-fwrite.c @@ -1,5 +1,5 @@ /* Test of fwrite() function. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-fwriting.c b/gnulib-tests/test-fwriting.c index c23068b..5377c96 100644 --- a/gnulib-tests/test-fwriting.c +++ b/gnulib-tests/test-fwriting.c @@ -1,5 +1,5 @@ /* Test of fwriting() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-getcwd-lgpl.c b/gnulib-tests/test-getcwd-lgpl.c index 3912c19..fdf0afd 100644 --- a/gnulib-tests/test-getcwd-lgpl.c +++ b/gnulib-tests/test-getcwd-lgpl.c @@ -1,5 +1,5 @@ /* Test of getcwd() function. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-getdelim.c b/gnulib-tests/test-getdelim.c index 8144c84..3ce7ccc 100644 --- a/gnulib-tests/test-getdelim.c +++ b/gnulib-tests/test-getdelim.c @@ -1,5 +1,5 @@ /* Test of getdelim() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-getdtablesize.c b/gnulib-tests/test-getdtablesize.c index 2bfcaeb..bf00fb4 100644 --- a/gnulib-tests/test-getdtablesize.c +++ b/gnulib-tests/test-getdtablesize.c @@ -1,5 +1,5 @@ /* Test of getdtablesize() function. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-getopt-gnu.c b/gnulib-tests/test-getopt-gnu.c index 1176d7b..34db5ae 100644 --- a/gnulib-tests/test-getopt-gnu.c +++ b/gnulib-tests/test-getopt-gnu.c @@ -1,5 +1,5 @@ /* Test of command line argument processing. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 @@ -23,7 +23,7 @@ #define _GL_NO_LARGE_FILES /* POSIX and glibc provide the getopt() function in <unistd.h>, see - http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html + https://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html https://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html But gnulib provides the getopt() function in <getopt.h>, not in <unistd.h>. This is what we are testing here. */ diff --git a/gnulib-tests/test-getopt-main.h b/gnulib-tests/test-getopt-main.h index c9c97bd..f3278cc 100644 --- a/gnulib-tests/test-getopt-main.h +++ b/gnulib-tests/test-getopt-main.h @@ -1,5 +1,5 @@ /* Test of command line argument processing. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-getopt-posix.c b/gnulib-tests/test-getopt-posix.c index b13f987..10ed784 100644 --- a/gnulib-tests/test-getopt-posix.c +++ b/gnulib-tests/test-getopt-posix.c @@ -1,5 +1,5 @@ /* Test of command line argument processing. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 @@ -23,7 +23,7 @@ #define _GL_NO_LARGE_FILES /* POSIX and glibc provide the getopt() function in <unistd.h>, see - http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html + https://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html https://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html But gnulib provides the getopt() function in <getopt.h>, not in <unistd.h>. Nevertheless the getopt() function should also be found in <unistd.h>. */ diff --git a/gnulib-tests/test-getopt.h b/gnulib-tests/test-getopt.h index 98ea389..c9237b0 100644 --- a/gnulib-tests/test-getopt.h +++ b/gnulib-tests/test-getopt.h @@ -1,5 +1,5 @@ /* Test of command line argument processing. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-getopt_long.h b/gnulib-tests/test-getopt_long.h index 4c22d8d..eaa61b4 100644 --- a/gnulib-tests/test-getopt_long.h +++ b/gnulib-tests/test-getopt_long.h @@ -1,5 +1,5 @@ /* Test of command line argument processing. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-getprogname.c b/gnulib-tests/test-getprogname.c index 7e219f4..38163ea 100644 --- a/gnulib-tests/test-getprogname.c +++ b/gnulib-tests/test-getprogname.c @@ -1,5 +1,5 @@ /* Test the gnulib getprogname module. - Copyright (C) 2016-2018 Free Software Foundation, Inc. + Copyright (C) 2016-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-gettimeofday.c b/gnulib-tests/test-gettimeofday.c index 322e7bd..4ce4107 100644 --- a/gnulib-tests/test-gettimeofday.c +++ b/gnulib-tests/test-gettimeofday.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005, 2007, 2009-2018 Free Software Foundation, Inc. + * Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc. * Written by Jim Meyering. * * This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/test-hard-locale.c b/gnulib-tests/test-hard-locale.c new file mode 100644 index 0000000..e232123 --- /dev/null +++ b/gnulib-tests/test-hard-locale.c @@ -0,0 +1,109 @@ +/* Test of determination whether a locale is different from the "C" locale. + Copyright (C) 2019-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2019. */ + +#include <config.h> + +#include "hard-locale.h" + +#include <locale.h> +#include <stdbool.h> +#include <stdio.h> +#include <string.h> + +/* True if all locale names are accepted and all locales are trivial. + This is the case e.g. on OpenBSD 3.8. */ +static bool all_trivial; + +static int +test_one (const char *name, int failure_bitmask) +{ + if (setlocale (LC_ALL, name) != NULL) + { + bool expected; + + /* musl libc has special code for the C.UTF-8 locale; other than that, + all locale names are accepted and all locales are trivial. + OpenBSD returns the locale name that was set, but we don't know how it + behaves under the hood. Likewise for Haiku. */ +#if defined MUSL_LIBC || defined __OpenBSD__ || defined __HAIKU__ + expected = true; +#else + expected = !all_trivial; +#endif + if (hard_locale (LC_CTYPE) != expected) + { + if (expected) + fprintf (stderr, "Unexpected: The category LC_CTYPE of the locale '%s' is not equivalent to C or POSIX.\n", + name); + else + fprintf (stderr, "Unexpected: The category LC_CTYPE of the locale '%s' is equivalent to C or POSIX.\n", + name); + return failure_bitmask; + } + + /* On NetBSD 7.0, some locales such as de_DE.ISO8859-1 and de_DE.UTF-8 + have the LC_COLLATE category set to "C". + Similarly, on musl libc, with the C.UTF-8 locale. */ +#if defined __NetBSD__ + expected = false; +#elif defined MUSL_LIBC + expected = strcmp (name, "C.UTF-8") != 0; +#elif (defined __OpenBSD__ && HAVE_DUPLOCALE) || defined __HAIKU__ /* OpenBSD >= 6.2, Haiku */ + expected = true; +#else + expected = !all_trivial; +#endif + if (hard_locale (LC_COLLATE) != expected) + { + if (expected) + fprintf (stderr, "Unexpected: The category LC_COLLATE of the locale '%s' is not equivalent to C or POSIX.\n", + name); + else + fprintf (stderr, "Unexpected: The category LC_COLLATE of the locale '%s' is equivalent to C or POSIX.\n", + name); + return failure_bitmask; + } + } + return 0; +} + +int +main () +{ + int fail = 0; + + /* The initial locale is the "C" or "POSIX" locale. */ + if (hard_locale (LC_CTYPE) || hard_locale (LC_COLLATE)) + { + fprintf (stderr, "The initial locale should not be hard!\n"); + fail |= 1; + } + + all_trivial = (setlocale (LC_ALL, "foobar") != NULL); + + fail |= test_one ("de", 2); + fail |= test_one ("de_DE", 4); + fail |= test_one ("de_DE.ISO8859-1", 8); + fail |= test_one ("de_DE.iso88591", 8); + fail |= test_one ("de_DE.UTF-8", 16); + fail |= test_one ("de_DE.utf8", 16); + fail |= test_one ("german", 32); + fail |= test_one ("C.UTF-8", 64); + + return fail; +} diff --git a/gnulib-tests/test-ignore-value.c b/gnulib-tests/test-ignore-value.c index d7b6308..f323a7b 100644 --- a/gnulib-tests/test-ignore-value.c +++ b/gnulib-tests/test-ignore-value.c @@ -1,6 +1,6 @@ /* Test the "ignore-value" module. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-inet_pton.c b/gnulib-tests/test-inet_pton.c index 7dc91c1..8ae0fe2 100644 --- a/gnulib-tests/test-inet_pton.c +++ b/gnulib-tests/test-inet_pton.c @@ -1,5 +1,5 @@ /* Test of inet_pton function. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-init.sh b/gnulib-tests/test-init.sh index 1cf0cb9..e9d2524 100755 --- a/gnulib-tests/test-init.sh +++ b/gnulib-tests/test-init.sh @@ -1,6 +1,6 @@ #!/bin/sh # Unit tests for init.sh -# Copyright (C) 2011-2018 Free Software Foundation, Inc. +# Copyright (C) 2011-2020 Free Software Foundation, Inc. # This file is part of the GNUlib Library. # # This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/test-intprops.c b/gnulib-tests/test-intprops.c index 286669a..a56b18e 100644 --- a/gnulib-tests/test-intprops.c +++ b/gnulib-tests/test-intprops.c @@ -1,5 +1,5 @@ /* Test intprops.h. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 @@ -56,6 +56,9 @@ #define DONTCARE __LINE__ +int int_minus_2 = -2; +int int_1 = 1; + int main (void) { @@ -215,8 +218,10 @@ main (void) CHECK_SBINOP (*, MULTIPLY, INT_MIN, INT_MIN, int, true, 0); CHECK_SBINOP (*, MULTIPLY, -1, INT_MIN, int, INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN); +#if !defined __HP_cc CHECK_SBINOP (*, MULTIPLY, LONG_MIN / INT_MAX, (long int) INT_MAX, long int, false, LONG_MIN - LONG_MIN % INT_MAX); +#endif CHECK_BINOP (/, DIVIDE, INT_MIN, -1, int, INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN); @@ -237,33 +242,48 @@ main (void) /* INT_<op>_OVERFLOW and INT_<op>_WRAPV with mixed types. */ #define CHECK_SUM(a, b, t, v, vres) \ - CHECK_SUM1(a, b, t, v, vres); \ - CHECK_SUM1(b, a, t, v, vres) - #define CHECK_SSUM(a, b, t, v, vres) \ - CHECK_SSUM1(a, b, t, v, vres); \ - CHECK_SSUM1(b, a, t, v, vres) + CHECK_SUM1 (a, b, t, v, vres); \ + CHECK_SUM1 (b, a, t, v, vres) + #define CHECK_SUM_WRAPV(a, b, t, v, vres, okres) \ + CHECK_SUM_WRAPV1 (a, b, t, v, vres, okres); \ + CHECK_SUM_WRAPV1 (b, a, t, v, vres, okres) #define CHECK_SUM1(a, b, t, v, vres) \ - VERIFY (INT_ADD_OVERFLOW (a, b) == (v)) - #define CHECK_SSUM1(a, b, t, v, vres) \ - CHECK_SUM1(a, b, t, v, vres); \ + VERIFY (INT_ADD_OVERFLOW (a, b) == (v)); \ + CHECK_SUM_WRAPV1 (a, b, t, v, vres, (a) + (b)) + #define CHECK_SUM_WRAPV1(a, b, t, v, vres, okres) \ { \ t result; \ ASSERT (INT_ADD_WRAPV (a, b, &result) == (v)); \ - ASSERT (result == ((v) ? (vres) : ((a) + (b)))); \ + ASSERT (result == ((v) ? (vres) : (okres))); \ } - CHECK_SSUM (-1, LONG_MIN, long int, true, LONG_MAX); + CHECK_SUM (-1, LONG_MIN, long int, true, LONG_MAX); CHECK_SUM (-1, UINT_MAX, unsigned int, false, DONTCARE); - CHECK_SSUM (-1L, INT_MIN, long int, INT_MIN == LONG_MIN, + CHECK_SUM (-1L, INT_MIN, long int, INT_MIN == LONG_MIN, INT_MIN == LONG_MIN ? INT_MAX : DONTCARE); CHECK_SUM (0u, -1, unsigned int, true, 0u + -1); CHECK_SUM (0u, 0, unsigned int, false, DONTCARE); CHECK_SUM (0u, 1, unsigned int, false, DONTCARE); - CHECK_SSUM (1, LONG_MAX, long int, true, LONG_MIN); + CHECK_SUM (1, LONG_MAX, long int, true, LONG_MIN); CHECK_SUM (1, UINT_MAX, unsigned int, true, 0u); - CHECK_SSUM (1L, INT_MAX, long int, INT_MAX == LONG_MAX, + CHECK_SUM (1L, INT_MAX, long int, INT_MAX == LONG_MAX, INT_MAX == LONG_MAX ? INT_MIN : DONTCARE); CHECK_SUM (1u, INT_MAX, unsigned int, INT_MAX == UINT_MAX, 1u + INT_MAX); CHECK_SUM (1u, INT_MIN, unsigned int, true, 1u + INT_MIN); + CHECK_SUM_WRAPV (-1, 1u, int, false, DONTCARE, 0); + CHECK_SUM_WRAPV (-1, 1ul, int, false, DONTCARE, 0); + CHECK_SUM_WRAPV (-1l, 1u, int, false, DONTCARE, 0); + CHECK_SUM_WRAPV (-100, 1000u, int, false, DONTCARE, 900); + CHECK_SUM_WRAPV (INT_MIN, UINT_MAX, int, false, DONTCARE, INT_MAX); + CHECK_SUM_WRAPV (1u, INT_MAX, int, true, INT_MIN, DONTCARE); + CHECK_SUM_WRAPV (INT_MAX, 1, long int, LONG_MAX <= INT_MAX, INT_MIN, + INT_MAX + 1L); + CHECK_SUM_WRAPV (UINT_MAX, 1, long int, LONG_MAX <= UINT_MAX, 0, + UINT_MAX + 1L); + CHECK_SUM_WRAPV (INT_MAX, 1, unsigned long int, ULONG_MAX <= INT_MAX, 0, + INT_MAX + 1uL); + CHECK_SUM_WRAPV (UINT_MAX, 1, unsigned long int, ULONG_MAX <= UINT_MAX, 0, + UINT_MAX + 1uL); + { long int result; ASSERT (INT_ADD_WRAPV (1, INT_MAX, &result) == (INT_MAX == LONG_MAX)); @@ -273,7 +293,9 @@ main (void) #define CHECK_DIFFERENCE(a, b, t, v, vres) \ VERIFY (INT_SUBTRACT_OVERFLOW (a, b) == (v)) #define CHECK_SDIFFERENCE(a, b, t, v, vres) \ - CHECK_DIFFERENCE(a, b, t, v, vres); \ + CHECK_DIFFERENCE (a, b, t, v, vres); \ + CHECK_SDIFFERENCE_WRAPV (a, b, t, v, vres) + #define CHECK_SDIFFERENCE_WRAPV(a, b, t, v, vres) \ { \ t result; \ ASSERT (INT_SUBTRACT_WRAPV (a, b, &result) == (v)); \ @@ -290,6 +312,11 @@ main (void) CHECK_SDIFFERENCE (-1, INT_MAX, int, false, -1 - INT_MAX); CHECK_SDIFFERENCE (0, INT_MIN, int, INT_MIN < -INT_MAX, INT_MIN); CHECK_SDIFFERENCE (0, INT_MAX, int, false, 0 - INT_MAX); + CHECK_SDIFFERENCE_WRAPV (-1, 1u, int, false, DONTCARE); + CHECK_SDIFFERENCE_WRAPV (-1, 1ul, int, false, DONTCARE); + CHECK_SDIFFERENCE_WRAPV (-1l, 1u, int, false, DONTCARE); + CHECK_SDIFFERENCE_WRAPV (0u, INT_MAX, int, false, DONTCARE); + CHECK_SDIFFERENCE_WRAPV (1u, INT_MIN, int, true, 1u - INT_MIN); { long int result; ASSERT (INT_SUBTRACT_WRAPV (INT_MAX, -1, &result) == (INT_MAX == LONG_MAX)); @@ -297,15 +324,20 @@ main (void) } #define CHECK_PRODUCT(a, b, t, v, vres) \ - CHECK_PRODUCT1(a, b, t, v, vres); \ - CHECK_PRODUCT1(b, a, t, v, vres) + CHECK_PRODUCT1 (a, b, t, v, vres); \ + CHECK_PRODUCT1 (b, a, t, v, vres) #define CHECK_SPRODUCT(a, b, t, v, vres) \ - CHECK_SPRODUCT1(a, b, t, v, vres); \ - CHECK_SPRODUCT1(b, a, t, v, vres) + CHECK_SPRODUCT1 (a, b, t, v, vres); \ + CHECK_SPRODUCT1 (b, a, t, v, vres) + #define CHECK_SPRODUCT_WRAPV(a, b, t, v, vres) \ + CHECK_SPRODUCT_WRAPV1 (a, b, t, v, vres); \ + CHECK_SPRODUCT_WRAPV1 (b, a, t, v, vres) #define CHECK_PRODUCT1(a, b, t, v, vres) \ VERIFY (INT_MULTIPLY_OVERFLOW (a, b) == (v)) #define CHECK_SPRODUCT1(a, b, t, v, vres) \ - CHECK_PRODUCT1(a, b, t, v, vres); \ + CHECK_PRODUCT1 (a, b, t, v, vres); \ + CHECK_SPRODUCT_WRAPV1 (a, b, t, v, vres) + #define CHECK_SPRODUCT_WRAPV1(a, b, t, v, vres) \ { \ t result; \ ASSERT (INT_MULTIPLY_WRAPV (a, b, &result) == (v)); \ @@ -338,11 +370,17 @@ main (void) CHECK_PRODUCT (INT_MAX, UINT_MAX, unsigned int, true, INT_MAX * UINT_MAX); CHECK_PRODUCT (INT_MAX, ULONG_MAX, unsigned long int, true, INT_MAX * ULONG_MAX); +#if !defined __HP_cc CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN - 1, long int, true, LONG_MIN); CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN, long int, false, DONTCARE); +#endif CHECK_PRODUCT (INT_MIN, UINT_MAX, unsigned int, true, INT_MIN * UINT_MAX); CHECK_PRODUCT (INT_MIN, ULONG_MAX, unsigned long int, true, INT_MIN * ULONG_MAX); + CHECK_SPRODUCT_WRAPV (-1, INT_MAX + 1u, int, false, DONTCARE); + CHECK_SPRODUCT_WRAPV (-1, 1u, int, false, DONTCARE); + CHECK_SPRODUCT (0, ULONG_MAX, int, false, DONTCARE); + CHECK_SPRODUCT (0u, LONG_MIN, int, false, DONTCARE); { long int result; ASSERT (INT_MULTIPLY_WRAPV (INT_MAX, INT_MAX, &result) @@ -365,6 +403,12 @@ main (void) } # endif + /* Check for GCC bug 91450. */ + { + unsigned long long result; + ASSERT (INT_MULTIPLY_WRAPV (int_minus_2, int_1, &result) && result == -2); + } + #define CHECK_QUOTIENT(a, b, v) VERIFY (INT_DIVIDE_OVERFLOW (a, b) == (v)) CHECK_QUOTIENT (INT_MIN, -1L, INT_MIN == LONG_MIN); diff --git a/gnulib-tests/test-inttypes.c b/gnulib-tests/test-inttypes.c index eb19655..21db820 100644 --- a/gnulib-tests/test-inttypes.c +++ b/gnulib-tests/test-inttypes.c @@ -1,5 +1,5 @@ /* Test of <inttypes.h> substitute. - Copyright (C) 2006-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-ioctl.c b/gnulib-tests/test-ioctl.c index 97dec4c..e09b009 100644 --- a/gnulib-tests/test-ioctl.c +++ b/gnulib-tests/test-ioctl.c @@ -1,5 +1,5 @@ /* Test of ioctl() function. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-isblank.c b/gnulib-tests/test-isblank.c index 5df1628..7dd9136 100644 --- a/gnulib-tests/test-isblank.c +++ b/gnulib-tests/test-isblank.c @@ -1,5 +1,5 @@ /* Test of isblank() function. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 @@ -35,7 +35,7 @@ main (int argc, char *argv[]) /* Verify the property in the "C" locale. POSIX specifies in - <http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html> + <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html> that - in all locales, the blank characters include the <space> and <tab> characters, diff --git a/gnulib-tests/test-langinfo.c b/gnulib-tests/test-langinfo.c index ba5fa86..4f3bbb0 100644 --- a/gnulib-tests/test-langinfo.c +++ b/gnulib-tests/test-langinfo.c @@ -1,5 +1,5 @@ /* Test of <langinfo.h> substitute. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-limits-h.c b/gnulib-tests/test-limits-h.c index ee30bde..2629c96 100644 --- a/gnulib-tests/test-limits-h.c +++ b/gnulib-tests/test-limits-h.c @@ -1,5 +1,5 @@ /* Test of <limits.h> substitute. - Copyright 2016-2018 Free Software Foundation, Inc. + Copyright 2016-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-link.c b/gnulib-tests/test-link.c index 3b0fbc1..5e192dc 100644 --- a/gnulib-tests/test-link.c +++ b/gnulib-tests/test-link.c @@ -1,5 +1,5 @@ /* Test of link() function. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-link.h b/gnulib-tests/test-link.h index 4d8cf0e..a244077 100644 --- a/gnulib-tests/test-link.h +++ b/gnulib-tests/test-link.h @@ -1,5 +1,5 @@ /* Test of link() function. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-listen.c b/gnulib-tests/test-listen.c index 121ef74..74d31ea 100644 --- a/gnulib-tests/test-listen.c +++ b/gnulib-tests/test-listen.c @@ -1,5 +1,5 @@ /* Test listen() function. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-localcharset.c b/gnulib-tests/test-localcharset.c index 69bca0b..b2dd51c 100644 --- a/gnulib-tests/test-localcharset.c +++ b/gnulib-tests/test-localcharset.c @@ -1,5 +1,5 @@ /* Manual test of localcharset() function. - Copyright (C) 2018 Free Software Foundation, Inc. + Copyright (C) 2018-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-locale.c b/gnulib-tests/test-locale.c index c09ae9a..264d7b6 100644 --- a/gnulib-tests/test-locale.c +++ b/gnulib-tests/test-locale.c @@ -1,5 +1,5 @@ /* Test of <locale.h> substitute. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 @@ -44,7 +44,7 @@ verify (sizeof NULL == sizeof (void *)); int main () { -#if HAVE_NEWLOCALE +#if HAVE_WORKING_NEWLOCALE /* Check that the locale_t type and the LC_GLOBAL_LOCALE macro are defined. */ locale_t b = LC_GLOBAL_LOCALE; (void) b; diff --git a/gnulib-tests/test-localeconv.c b/gnulib-tests/test-localeconv.c index d2bd761..ab54dde 100644 --- a/gnulib-tests/test-localeconv.c +++ b/gnulib-tests/test-localeconv.c @@ -1,5 +1,5 @@ /* Test of localeconv() function. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-localename.c b/gnulib-tests/test-localename.c index 21a5f5d..6ff10d9 100644 --- a/gnulib-tests/test-localename.c +++ b/gnulib-tests/test-localename.c @@ -1,5 +1,5 @@ /* Test of gl_locale_name function and its variants. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 @@ -26,7 +26,7 @@ #include "macros.h" -#if HAVE_NEWLOCALE && HAVE_WORKING_USELOCALE && !HAVE_FAKE_LOCALES +#if HAVE_WORKING_NEWLOCALE && HAVE_WORKING_USELOCALE && !HAVE_FAKE_LOCALES # define HAVE_GOOD_USELOCALE 1 #endif diff --git a/gnulib-tests/test-lseek.c b/gnulib-tests/test-lseek.c index 146f5ce..fd9e60e 100644 --- a/gnulib-tests/test-lseek.c +++ b/gnulib-tests/test-lseek.c @@ -1,5 +1,5 @@ /* Test of lseek() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-lseek.sh b/gnulib-tests/test-lseek.sh index 47237b5..ff206c6 100755 --- a/gnulib-tests/test-lseek.sh +++ b/gnulib-tests/test-lseek.sh @@ -5,14 +5,14 @@ trap 'rm -fr $tmpfiles' 1 2 3 15 tmpfiles=t-lseek.tmp # seekable files -./test-lseek${EXEEXT} 0 < "$srcdir/test-lseek.sh" > t-lseek.tmp || exit 1 +${CHECKER} ./test-lseek${EXEEXT} 0 < "$srcdir/test-lseek.sh" > t-lseek.tmp || exit 1 # pipes -echo hi | { ./test-lseek${EXEEXT} 1; echo $? > t-lseek.tmp; cat > /dev/null; } | cat +echo hi | { ${CHECKER} ./test-lseek${EXEEXT} 1; echo $? > t-lseek.tmp; cat > /dev/null; } | cat test "`cat t-lseek.tmp`" = "0" || exit 1 # closed descriptors -./test-lseek${EXEEXT} 2 <&- >&- || exit 1 +${CHECKER} ./test-lseek${EXEEXT} 2 <&- >&- || exit 1 rm -rf $tmpfiles exit 0 diff --git a/gnulib-tests/test-lstat.c b/gnulib-tests/test-lstat.c index 9ef2fcd..a7b928a 100644 --- a/gnulib-tests/test-lstat.c +++ b/gnulib-tests/test-lstat.c @@ -1,5 +1,5 @@ /* Test of lstat() function. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-lstat.h b/gnulib-tests/test-lstat.h index 248e7df..f9ad11d 100644 --- a/gnulib-tests/test-lstat.h +++ b/gnulib-tests/test-lstat.h @@ -1,5 +1,5 @@ /* Test of lstat() function. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 @@ -31,12 +31,16 @@ test_lstat_func (int (*func) (char const *, struct stat *), bool print) /* Test for common directories. */ ASSERT (func (".", &st1) == 0); ASSERT (func ("./", &st2) == 0); +#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES) ASSERT (SAME_INODE (st1, st2)); +#endif ASSERT (S_ISDIR (st1.st_mode)); ASSERT (S_ISDIR (st2.st_mode)); ASSERT (func ("/", &st1) == 0); ASSERT (func ("///", &st2) == 0); +#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES) ASSERT (SAME_INODE (st1, st2)); +#endif ASSERT (S_ISDIR (st1.st_mode)); ASSERT (S_ISDIR (st2.st_mode)); ASSERT (func ("..", &st1) == 0); @@ -85,7 +89,9 @@ test_lstat_func (int (*func) (char const *, struct stat *), bool print) ASSERT (stat (BASE "link1", &st2) == 0); ASSERT (S_ISDIR (st1.st_mode)); ASSERT (S_ISDIR (st2.st_mode)); +#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES) ASSERT (SAME_INODE (st1, st2)); +#endif ASSERT (func (BASE "link2", &st1) == 0); ASSERT (S_ISLNK (st1.st_mode)); diff --git a/gnulib-tests/test-malloca.c b/gnulib-tests/test-malloca.c index a07667b..a546add 100644 --- a/gnulib-tests/test-malloca.c +++ b/gnulib-tests/test-malloca.c @@ -1,5 +1,5 @@ /* Test of safe automatic memory allocation. - Copyright (C) 2005, 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-mbrtowc-w32-1.sh b/gnulib-tests/test-mbrtowc-w32-1.sh index 3f12e44..fec9ead 100755 --- a/gnulib-tests/test-mbrtowc-w32-1.sh +++ b/gnulib-tests/test-mbrtowc-w32-1.sh @@ -1,4 +1,4 @@ #!/bin/sh # Test a CP1252 locale. -./test-mbrtowc-w32${EXEEXT} French_France 1252 +${CHECKER} ./test-mbrtowc-w32${EXEEXT} French_France 1252 diff --git a/gnulib-tests/test-mbrtowc-w32-2.sh b/gnulib-tests/test-mbrtowc-w32-2.sh index 9e1a765..c55a0ec 100755 --- a/gnulib-tests/test-mbrtowc-w32-2.sh +++ b/gnulib-tests/test-mbrtowc-w32-2.sh @@ -1,4 +1,4 @@ #!/bin/sh # Test a CP1256 locale. -./test-mbrtowc-w32${EXEEXT} "Arabic_Saudi Arabia" 1256 +${CHECKER} ./test-mbrtowc-w32${EXEEXT} "Arabic_Saudi Arabia" 1256 diff --git a/gnulib-tests/test-mbrtowc-w32-3.sh b/gnulib-tests/test-mbrtowc-w32-3.sh index 782c2d0..c49f4bd 100755 --- a/gnulib-tests/test-mbrtowc-w32-3.sh +++ b/gnulib-tests/test-mbrtowc-w32-3.sh @@ -1,4 +1,4 @@ #!/bin/sh # Test a CP932 locale. -./test-mbrtowc-w32${EXEEXT} Japanese_Japan 932 +${CHECKER} ./test-mbrtowc-w32${EXEEXT} Japanese_Japan 932 diff --git a/gnulib-tests/test-mbrtowc-w32-4.sh b/gnulib-tests/test-mbrtowc-w32-4.sh index 0630f30..3e78615 100755 --- a/gnulib-tests/test-mbrtowc-w32-4.sh +++ b/gnulib-tests/test-mbrtowc-w32-4.sh @@ -1,4 +1,4 @@ #!/bin/sh # Test a CP950 locale. -./test-mbrtowc-w32${EXEEXT} Chinese_Taiwan 950 +${CHECKER} ./test-mbrtowc-w32${EXEEXT} Chinese_Taiwan 950 diff --git a/gnulib-tests/test-mbrtowc-w32-5.sh b/gnulib-tests/test-mbrtowc-w32-5.sh index 7d7faa9..c6ba222 100755 --- a/gnulib-tests/test-mbrtowc-w32-5.sh +++ b/gnulib-tests/test-mbrtowc-w32-5.sh @@ -1,4 +1,4 @@ #!/bin/sh # Test a CP936 locale. -./test-mbrtowc-w32${EXEEXT} Chinese_China 936 +${CHECKER} ./test-mbrtowc-w32${EXEEXT} Chinese_China 936 diff --git a/gnulib-tests/test-mbrtowc-w32-6.sh b/gnulib-tests/test-mbrtowc-w32-6.sh new file mode 100755 index 0000000..c2e8dfe --- /dev/null +++ b/gnulib-tests/test-mbrtowc-w32-6.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test a GB18030 locale. +${CHECKER} ./test-mbrtowc-w32${EXEEXT} Chinese_China 54936 diff --git a/gnulib-tests/test-mbrtowc-w32-7.sh b/gnulib-tests/test-mbrtowc-w32-7.sh new file mode 100755 index 0000000..2c5d555 --- /dev/null +++ b/gnulib-tests/test-mbrtowc-w32-7.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test some UTF-8 locales. +${CHECKER} ./test-mbrtowc-w32${EXEEXT} French_France Japanese_Japan Chinese_Taiwan Chinese_China 65001 diff --git a/gnulib-tests/test-mbrtowc-w32.c b/gnulib-tests/test-mbrtowc-w32.c index ba4d755..17908ed 100644 --- a/gnulib-tests/test-mbrtowc-w32.c +++ b/gnulib-tests/test-mbrtowc-w32.c @@ -1,5 +1,5 @@ /* Test of conversion of multibyte character to wide character. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 @@ -24,6 +24,7 @@ #include <stdlib.h> #include <string.h> +#include "localcharset.h" #include "macros.h" #if defined _WIN32 && !defined __CYGWIN__ @@ -476,6 +477,8 @@ test_one_locale (const char *name, int codepage) case 54936: /* Locale encoding is CP54936 = GB18030. */ + if (strcmp (locale_charset (), "GB18030") != 0) + return 77; { char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ memset (&state, '\0', sizeof (mbstate_t)); @@ -523,7 +526,7 @@ test_one_locale (const char *name, int codepage) ASSERT (ret == 1); ASSERT (wc == 'e'); ASSERT (mbsinit (&state)); - input[5] = '\0'; + input[7] = '\0'; wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, input + 8, 1, &state); @@ -572,6 +575,8 @@ test_one_locale (const char *name, int codepage) case 65001: /* Locale encoding is CP65001 = UTF-8. */ + if (strcmp (locale_charset (), "UTF-8") != 0) + return 77; { char input[] = "B\303\274\303\237er"; /* "Büßer" */ memset (&state, '\0', sizeof (mbstate_t)); diff --git a/gnulib-tests/test-mbrtowc.c b/gnulib-tests/test-mbrtowc.c index 44da295..09fbda7 100644 --- a/gnulib-tests/test-mbrtowc.c +++ b/gnulib-tests/test-mbrtowc.c @@ -1,5 +1,5 @@ /* Test of conversion of multibyte character to wide character. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 @@ -111,7 +111,7 @@ main (int argc, char *argv[]) locale. On most platforms, the bytes 0x80..0xFF map to U+0080..U+00FF. But on musl libc, the bytes 0x80..0xFF map to U+DF80..U+DFFF. */ - ASSERT (wc == (btowc (c) == WEOF ? c : btowc (c))); + ASSERT (wc == (btowc (c) == 0xDF00 + c ? btowc (c) : c)); ASSERT (mbsinit (&state)); ret = mbrtowc (NULL, buf, 1, &state); ASSERT (ret == 1); @@ -338,7 +338,7 @@ main (int argc, char *argv[]) ASSERT (ret == 1); ASSERT (wc == 'e'); ASSERT (mbsinit (&state)); - input[5] = '\0'; + input[7] = '\0'; wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, input + 8, 1, &state); diff --git a/gnulib-tests/test-mbrtowc1.sh b/gnulib-tests/test-mbrtowc1.sh index 3becba3..00b108b 100755 --- a/gnulib-tests/test-mbrtowc1.sh +++ b/gnulib-tests/test-mbrtowc1.sh @@ -12,4 +12,4 @@ if test $LOCALE_FR = none; then fi LC_ALL=$LOCALE_FR \ -./test-mbrtowc${EXEEXT} 1 +${CHECKER} ./test-mbrtowc${EXEEXT} 1 diff --git a/gnulib-tests/test-mbrtowc2.sh b/gnulib-tests/test-mbrtowc2.sh index 0405aba..5036930 100755 --- a/gnulib-tests/test-mbrtowc2.sh +++ b/gnulib-tests/test-mbrtowc2.sh @@ -12,4 +12,4 @@ if test $LOCALE_FR_UTF8 = none; then fi LC_ALL=$LOCALE_FR_UTF8 \ -./test-mbrtowc${EXEEXT} 2 +${CHECKER} ./test-mbrtowc${EXEEXT} 2 diff --git a/gnulib-tests/test-mbrtowc3.sh b/gnulib-tests/test-mbrtowc3.sh index 63a89a2..2773fa7 100755 --- a/gnulib-tests/test-mbrtowc3.sh +++ b/gnulib-tests/test-mbrtowc3.sh @@ -12,4 +12,4 @@ if test $LOCALE_JA = none; then fi LC_ALL=$LOCALE_JA \ -./test-mbrtowc${EXEEXT} 3 +${CHECKER} ./test-mbrtowc${EXEEXT} 3 diff --git a/gnulib-tests/test-mbrtowc4.sh b/gnulib-tests/test-mbrtowc4.sh index b299a2c..92f641c 100755 --- a/gnulib-tests/test-mbrtowc4.sh +++ b/gnulib-tests/test-mbrtowc4.sh @@ -12,4 +12,4 @@ if test $LOCALE_ZH_CN = none; then fi LC_ALL=$LOCALE_ZH_CN \ -./test-mbrtowc${EXEEXT} 4 +${CHECKER} ./test-mbrtowc${EXEEXT} 4 diff --git a/gnulib-tests/test-mbrtowc5.sh b/gnulib-tests/test-mbrtowc5.sh index c10b228..490496d 100755 --- a/gnulib-tests/test-mbrtowc5.sh +++ b/gnulib-tests/test-mbrtowc5.sh @@ -1,6 +1,6 @@ #!/bin/sh # Test whether the POSIX locale has encoding errors. LC_ALL=C \ -./test-mbrtowc${EXEEXT} 5 || exit +${CHECKER} ./test-mbrtowc${EXEEXT} 5 || exit LC_ALL=POSIX \ -./test-mbrtowc${EXEEXT} 5 +${CHECKER} ./test-mbrtowc${EXEEXT} 5 diff --git a/gnulib-tests/test-mbsinit.c b/gnulib-tests/test-mbsinit.c index 3b2d418..44beca3 100644 --- a/gnulib-tests/test-mbsinit.c +++ b/gnulib-tests/test-mbsinit.c @@ -1,5 +1,5 @@ /* Test of test for initial conversion state. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-mbsinit.sh b/gnulib-tests/test-mbsinit.sh index bbda48d..7308714 100755 --- a/gnulib-tests/test-mbsinit.sh +++ b/gnulib-tests/test-mbsinit.sh @@ -12,4 +12,4 @@ if test $LOCALE_FR_UTF8 = none; then fi LC_ALL=$LOCALE_FR_UTF8 \ -./test-mbsinit${EXEEXT} +${CHECKER} ./test-mbsinit${EXEEXT} diff --git a/gnulib-tests/test-memchr.c b/gnulib-tests/test-memchr.c index f191587..ab8d2c0 100644 --- a/gnulib-tests/test-memchr.c +++ b/gnulib-tests/test-memchr.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2018 Free Software Foundation, Inc. + * Copyright (C) 2008-2020 Free Software Foundation, Inc. * Written by Eric Blake and Bruno Haible * * This program is free software: you can redistribute it and/or modify @@ -88,7 +88,7 @@ main (void) /* Check that memchr() does not read past the first occurrence of the byte being searched. See the Austin Group's clarification - <http://www.opengroup.org/austin/docs/austin_454.txt>. + <https://www.opengroup.org/austin/docs/austin_454.txt>. Test both '\0' and something else, since some implementations special-case searching for NUL. */ diff --git a/gnulib-tests/test-memrchr.c b/gnulib-tests/test-memrchr.c index 0a35812..001134b 100644 --- a/gnulib-tests/test-memrchr.c +++ b/gnulib-tests/test-memrchr.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2018 Free Software Foundation, Inc. + * Copyright (C) 2008-2020 Free Software Foundation, Inc. * Written by Eric Blake and Bruno Haible * * This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/test-mkdir.c b/gnulib-tests/test-mkdir.c index 66a713f..9ce5817 100644 --- a/gnulib-tests/test-mkdir.c +++ b/gnulib-tests/test-mkdir.c @@ -1,5 +1,5 @@ /* Tests of mkdir. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-mkdir.h b/gnulib-tests/test-mkdir.h index 9849300..7da2706 100644 --- a/gnulib-tests/test-mkdir.h +++ b/gnulib-tests/test-mkdir.h @@ -1,5 +1,5 @@ /* Test of mkdir() function. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-nanosleep.c b/gnulib-tests/test-nanosleep.c index 65e261f..e82e45d 100644 --- a/gnulib-tests/test-nanosleep.c +++ b/gnulib-tests/test-nanosleep.c @@ -1,5 +1,5 @@ /* Test of nanosleep() function. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-netinet_in.c b/gnulib-tests/test-netinet_in.c index 692878c..f170410 100644 --- a/gnulib-tests/test-netinet_in.c +++ b/gnulib-tests/test-netinet_in.c @@ -1,5 +1,5 @@ /* Test of <netinet/in.h> substitute. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-nl_langinfo-mt.c b/gnulib-tests/test-nl_langinfo-mt.c new file mode 100644 index 0000000..de6cd99 --- /dev/null +++ b/gnulib-tests/test-nl_langinfo-mt.c @@ -0,0 +1,255 @@ +/* Multithread-safety test for nl_langinfo(). + Copyright (C) 2019-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2019. */ + +#include <config.h> + +#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS + +/* Specification. */ +#include <langinfo.h> + +#include <locale.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + +#include "glthread/thread.h" + + +/* Some common locale names. */ + +#if defined _WIN32 && !defined __CYGWIN__ +# define ENGLISH "English_United States" +# define FRENCH "French_France" +# define GERMAN "German_Germany" +# define ENCODING ".1252" +#else +# define ENGLISH "en_US" +# define FRENCH "fr_FR" +# define GERMAN "de_DE" +# if defined __sgi +# define ENCODING ".ISO8859-15" +# elif defined __hpux +# define ENCODING ".utf8" +# else +# define ENCODING ".UTF-8" +# endif +#endif + +static const char LOCALE1[] = ENGLISH ENCODING; +static const char LOCALE2[] = FRENCH ENCODING; +static const char LOCALE3[] = GERMAN ENCODING; + +static char *expected1; + +static void * +thread1_func (void *arg) +{ + for (;;) + { + const char *value = nl_langinfo (CODESET); + if (strcmp (expected1, value) != 0) + { + fprintf (stderr, "thread1 disturbed by threadN!\n"); fflush (stderr); + abort (); + } + } + + /*NOTREACHED*/ + return NULL; +} + +static char *expected2; + +static void * +thread2_func (void *arg) +{ + for (;;) + { + const char *value = nl_langinfo (PM_STR); + if (strcmp (expected2, value) != 0) + { + fprintf (stderr, "thread2 disturbed by threadN!\n"); fflush (stderr); + abort (); + } + } + + /*NOTREACHED*/ + return NULL; +} + +static char *expected3; + +static void * +thread3_func (void *arg) +{ + for (;;) + { + const char *value = nl_langinfo (DAY_2); + if (strcmp (expected3, value) != 0) + { + fprintf (stderr, "thread3 disturbed by threadN!\n"); fflush (stderr); + abort (); + } + } + + /*NOTREACHED*/ + return NULL; +} + +static char *expected4; + +static void * +thread4_func (void *arg) +{ + for (;;) + { + const char *value = nl_langinfo (ALTMON_2); + if (strcmp (expected4, value) != 0) + { + fprintf (stderr, "thread4 disturbed by threadN!\n"); fflush (stderr); + abort (); + } + } + + /*NOTREACHED*/ + return NULL; +} + +static char *expected5; + +static void * +thread5_func (void *arg) +{ + for (;;) + { + const char *value = nl_langinfo (CRNCYSTR); + if (strcmp (expected5, value) != 0) + { + fprintf (stderr, "thread5 disturbed by threadN!\n"); fflush (stderr); + abort (); + } + } + + /*NOTREACHED*/ + return NULL; +} + +static char *expected6; + +static void * +thread6_func (void *arg) +{ + for (;;) + { + const char *value = nl_langinfo (RADIXCHAR); + if (strcmp (expected6, value) != 0) + { + fprintf (stderr, "thread6 disturbed by threadN!\n"); fflush (stderr); + abort (); + } + } + + /*NOTREACHED*/ + return NULL; +} + +static void * +threadN_func (void *arg) +{ + for (;;) + { + nl_langinfo (CODESET); /* LC_CTYPE */ /* locale charmap */ + nl_langinfo (AM_STR); /* LC_TIME */ /* locale -k am_pm */ + nl_langinfo (PM_STR); /* LC_TIME */ /* locale -k am_pm */ + nl_langinfo (DAY_2); /* LC_TIME */ /* locale -k day */ + nl_langinfo (DAY_5); /* LC_TIME */ /* locale -k day */ + nl_langinfo (ALTMON_2); /* LC_TIME */ /* locale -k alt_mon */ + nl_langinfo (ALTMON_9); /* LC_TIME */ /* locale -k alt_mon */ + nl_langinfo (CRNCYSTR); /* LC_MONETARY */ /* locale -k currency_symbol */ + nl_langinfo (RADIXCHAR); /* LC_NUMERIC */ /* locale -k decimal_point */ + nl_langinfo (THOUSEP); /* LC_NUMERIC */ /* locale -k thousands_sep */ + } + + /*NOTREACHED*/ + return NULL; +} + +int +main (int argc, char *argv[]) +{ + if (setlocale (LC_ALL, LOCALE1) == NULL) + { + fprintf (stderr, "Skipping test: LOCALE1 not recognized\n"); + return 77; + } + if (setlocale (LC_MONETARY, LOCALE2) == NULL) + { + fprintf (stderr, "Skipping test: LOCALE2 not recognized\n"); + return 77; + } + if (setlocale (LC_NUMERIC, LOCALE3) == NULL) + { + fprintf (stderr, "Skipping test: LOCALE3 not recognized\n"); + return 77; + } + + expected1 = strdup (nl_langinfo (CODESET)); + expected2 = strdup (nl_langinfo (PM_STR)); + expected3 = strdup (nl_langinfo (DAY_2)); + expected4 = strdup (nl_langinfo (ALTMON_2)); + expected5 = strdup (nl_langinfo (CRNCYSTR)); + expected6 = strdup (nl_langinfo (RADIXCHAR)); + + /* Create the checker threads. */ + gl_thread_create (thread1_func, NULL); + gl_thread_create (thread2_func, NULL); + gl_thread_create (thread3_func, NULL); + gl_thread_create (thread4_func, NULL); + gl_thread_create (thread5_func, NULL); + gl_thread_create (thread6_func, NULL); + /* Create the disturber thread. */ + gl_thread_create (threadN_func, NULL); + + /* Let them run for 2 seconds. */ + { + struct timespec duration; + duration.tv_sec = (argc > 1 ? atoi (argv[1]) : 2); + duration.tv_nsec = 0; + + nanosleep (&duration, NULL); + } + + return 0; +} + +#else + +/* No multithreading available. */ + +#include <stdio.h> + +int +main () +{ + fputs ("Skipping test: multithreading not enabled\n", stderr); + return 77; +} + +#endif diff --git a/gnulib-tests/test-nl_langinfo.c b/gnulib-tests/test-nl_langinfo.c index a13fb71..e21d003 100644 --- a/gnulib-tests/test-nl_langinfo.c +++ b/gnulib-tests/test-nl_langinfo.c @@ -1,5 +1,5 @@ /* Test of nl_langinfo replacement. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-nl_langinfo.sh b/gnulib-tests/test-nl_langinfo.sh index 3168f42..b1ce46c 100755 --- a/gnulib-tests/test-nl_langinfo.sh +++ b/gnulib-tests/test-nl_langinfo.sh @@ -1,17 +1,17 @@ #!/bin/sh -LC_ALL=C ./test-nl_langinfo${EXEEXT} 0 || exit 1 +LC_ALL=C ${CHECKER} ./test-nl_langinfo${EXEEXT} 0 || exit 1 # Test whether a specific traditional locale is installed. : ${LOCALE_FR=fr_FR} if test $LOCALE_FR != none; then - LC_ALL=$LOCALE_FR ./test-nl_langinfo${EXEEXT} 1 || exit 1 + LC_ALL=$LOCALE_FR ${CHECKER} ./test-nl_langinfo${EXEEXT} 1 || exit 1 fi # Test whether a specific UTF-8 locale is installed. : ${LOCALE_FR_UTF8=fr_FR.UTF-8} if test $LOCALE_FR_UTF8 != none; then - LC_ALL=$LOCALE_FR_UTF8 ./test-nl_langinfo${EXEEXT} 2 || exit 1 + LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-nl_langinfo${EXEEXT} 2 || exit 1 fi exit 0 diff --git a/gnulib-tests/test-open.c b/gnulib-tests/test-open.c index 125950e..30d9764 100644 --- a/gnulib-tests/test-open.c +++ b/gnulib-tests/test-open.c @@ -1,5 +1,5 @@ /* Test of opening a file descriptor. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-open.h b/gnulib-tests/test-open.h index 8996c09..c57054f 100644 --- a/gnulib-tests/test-open.h +++ b/gnulib-tests/test-open.h @@ -1,5 +1,5 @@ /* Test of opening a file descriptor. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 @@ -37,8 +37,11 @@ static ALWAYS_INLINE int test_open (int (*func) (char const *, int, ...), bool print) { int fd; + /* Remove anything from prior partial run. */ unlink (BASE "file"); + unlink (BASE "e.exe"); + unlink (BASE "link"); /* Cannot create directory. */ errno = 0; @@ -51,6 +54,11 @@ test_open (int (*func) (char const *, int, ...), bool print) ASSERT (0 <= fd); ASSERT (close (fd) == 0); + /* Create an executable regular file. */ + fd = func (BASE "e.exe", O_CREAT | O_RDONLY, 0700); + ASSERT (0 <= fd); + ASSERT (close (fd) == 0); + /* Trailing slash handling. */ errno = 0; ASSERT (func (BASE "file/", O_RDONLY) == -1); @@ -98,6 +106,7 @@ test_open (int (*func) (char const *, int, ...), bool print) /* Cleanup. */ ASSERT (unlink (BASE "file") == 0); + ASSERT (unlink (BASE "e.exe") == 0); ASSERT (unlink (BASE "link") == 0); return 0; diff --git a/gnulib-tests/test-pathmax.c b/gnulib-tests/test-pathmax.c index aa55be8..3c4bd56 100644 --- a/gnulib-tests/test-pathmax.c +++ b/gnulib-tests/test-pathmax.c @@ -1,5 +1,5 @@ /* Test of "pathmax.h". - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-perror.c b/gnulib-tests/test-perror.c index eacadec..a6263f2 100644 --- a/gnulib-tests/test-perror.c +++ b/gnulib-tests/test-perror.c @@ -1,5 +1,5 @@ /* Test of perror() function. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-perror.sh b/gnulib-tests/test-perror.sh index 40a3034..e776609 100755 --- a/gnulib-tests/test-perror.sh +++ b/gnulib-tests/test-perror.sh @@ -5,22 +5,22 @@ # Test NULL prefix. Result should not contain a number, except in lines that # start with 'EDC' (IBM z/OS libc produces an error identifier before the # error message). -test-perror 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror.tmp +${CHECKER} test-perror 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror.tmp grep -v '^EDC' t-perror.tmp | grep '[0-9]' > /dev/null \ && fail_ "result should not contain a number" # Test empty prefix. Result should be the same. -test-perror '' 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror1.tmp +${CHECKER} test-perror '' 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror1.tmp diff t-perror.tmp t-perror1.tmp \ || fail_ "empty prefix should behave like NULL argument" # Test non-empty prefix. -test-perror foo 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror3.tmp +${CHECKER} test-perror foo 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror3.tmp sed -e 's/^/foo: /' < t-perror.tmp > t-perror2.tmp diff t-perror2.tmp t-perror3.tmp || fail_ "prefix applied incorrectly" # Test exit status. -test-perror >out 2>/dev/null || fail_ "unexpected exit status" +${CHECKER} test-perror >out 2>/dev/null || fail_ "unexpected exit status" test -s out && fail_ "unexpected output" Exit 0 diff --git a/gnulib-tests/test-perror2.c b/gnulib-tests/test-perror2.c index 8e6adb4..1d14eda 100644 --- a/gnulib-tests/test-perror2.c +++ b/gnulib-tests/test-perror2.c @@ -1,5 +1,5 @@ /* Test of perror() function. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-pipe.c b/gnulib-tests/test-pipe.c index 55f6208..36ff480 100644 --- a/gnulib-tests/test-pipe.c +++ b/gnulib-tests/test-pipe.c @@ -1,5 +1,5 @@ /* Test of pipe. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-pthread-thread.c b/gnulib-tests/test-pthread-thread.c new file mode 100644 index 0000000..a274d78 --- /dev/null +++ b/gnulib-tests/test-pthread-thread.c @@ -0,0 +1,73 @@ +/* Test of pthread_create () function. + Copyright (C) 2011-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2011. */ + +#include <config.h> + +#include <pthread.h> + +#include <stdio.h> +#include <string.h> + +#include "macros.h" + +static pthread_t main_thread_before; +static pthread_t main_thread_after; +static pthread_t worker_thread; + +#define MAGIC ((void *) 1266074729) +static volatile int work_done; + +static void * +worker_thread_func (void *arg) +{ + work_done = 1; + return MAGIC; +} + +int +main () +{ + main_thread_before = pthread_self (); + + if (pthread_create (&worker_thread, NULL, worker_thread_func, NULL) == 0) + { + void *ret; + + /* Check that pthread_self () has the same value before than after the + first call to pthread_create (). */ + main_thread_after = pthread_self (); + ASSERT (memcmp (&main_thread_before, &main_thread_after, + sizeof (pthread_t)) + == 0); + + ASSERT (pthread_join (worker_thread, &ret) == 0); + + /* Check the return value of the thread. */ + ASSERT (ret == MAGIC); + + /* Check that worker_thread_func () has finished executing. */ + ASSERT (work_done); + + return 0; + } + else + { + fputs ("pthread_create failed\n", stderr); + return 1; + } +} diff --git a/gnulib-tests/test-pthread.c b/gnulib-tests/test-pthread.c new file mode 100644 index 0000000..800ad04 --- /dev/null +++ b/gnulib-tests/test-pthread.c @@ -0,0 +1,90 @@ +/* Test of <pthread.h> substitute. + Copyright (C) 2019-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2019. */ + +#include <config.h> + +#include <pthread.h> + +#include "verify.h" + +/* Check that the types are all defined. */ + +pthread_t t1; +pthread_attr_t t2; + +pthread_once_t t3 = PTHREAD_ONCE_INIT; + +pthread_mutex_t t4 = PTHREAD_MUTEX_INITIALIZER; +pthread_mutexattr_t t5; + +pthread_rwlock_t t6 = PTHREAD_RWLOCK_INITIALIZER; +pthread_rwlockattr_t t7; + +pthread_cond_t t8 = PTHREAD_COND_INITIALIZER; +pthread_condattr_t t9; + +pthread_key_t t10; + +pthread_spinlock_t t11; + +#ifdef TODO /* Not implemented in gnulib yet */ +pthread_barrier_t t12; +pthread_barrierattr_t t13; +#endif + +/* Check that the various macros are defined. */ + +/* Constants for pthread_attr_setdetachstate(). */ +int ds[] = { PTHREAD_CREATE_JOINABLE, PTHREAD_CREATE_DETACHED }; + +/* Constants for pthread_exit(). */ +void *canceled = PTHREAD_CANCELED; + +/* Constants for pthread_mutexattr_settype(). */ +int mt[] = { + PTHREAD_MUTEX_DEFAULT, + PTHREAD_MUTEX_NORMAL, + PTHREAD_MUTEX_RECURSIVE, + PTHREAD_MUTEX_ERRORCHECK +}; + +#ifdef TODO /* Not implemented in gnulib yet */ + +/* Constants for pthread_mutexattr_setrobust(). */ +int mr[] = { PTHREAD_MUTEX_ROBUST, PTHREAD_MUTEX_STALLED }; + +/* Constants for pthread_barrierattr_setpshared(). */ +int bp[] = { PTHREAD_PROCESS_SHARED, PTHREAD_PROCESS_PRIVATE }; + +/* Constants for pthread_barrier_wait(). */ +int bw[] = { PTHREAD_BARRIER_SERIAL_THREAD }; + +/* Constants for pthread_setcancelstate(). */ +int cs[] = { PTHREAD_CANCEL_ENABLE, PTHREAD_CANCEL_DISABLE }; + +/* Constants for pthread_setcanceltype(). */ +int ct[] = { PTHREAD_CANCEL_DEFERRED, PTHREAD_CANCEL_ASYNCHRONOUS }; + +#endif + + +int +main (void) +{ + return 0; +} diff --git a/gnulib-tests/test-pthread_sigmask1.c b/gnulib-tests/test-pthread_sigmask1.c new file mode 100644 index 0000000..c1df429 --- /dev/null +++ b/gnulib-tests/test-pthread_sigmask1.c @@ -0,0 +1,95 @@ +/* Test of pthread_sigmask in a single-threaded program. + Copyright (C) 2011-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2011. */ + +#include <config.h> + +#include <signal.h> + +#include "signature.h" +SIGNATURE_CHECK (pthread_sigmask, int, (int, const sigset_t *, sigset_t *)); + +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +#include "macros.h" + +#if !(defined _WIN32 && !defined __CYGWIN__) + +static volatile int sigint_occurred; + +static void +sigint_handler (int sig) +{ + sigint_occurred++; +} + +int +main (int argc, char *argv[]) +{ + sigset_t set; + int pid = getpid (); + char command[80]; + + signal (SIGINT, sigint_handler); + + sigemptyset (&set); + sigaddset (&set, SIGINT); + + /* Check error handling. */ + ASSERT (pthread_sigmask (1729, &set, NULL) == EINVAL); + + /* Block SIGINT. */ + ASSERT (pthread_sigmask (SIG_BLOCK, &set, NULL) == 0); + + /* Request a SIGINT signal from outside. */ + sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, pid); + ASSERT (system (command) == 0); + + /* Wait. */ + sleep (2); + + /* The signal should not have arrived yet, because it is blocked. */ + ASSERT (sigint_occurred == 0); + + /* Unblock SIGINT. */ + ASSERT (pthread_sigmask (SIG_UNBLOCK, &set, NULL) == 0); + + /* The signal should have arrived now, because POSIX says + "If there are any pending unblocked signals after the call to + pthread_sigmask(), at least one of those signals shall be delivered + before the call to pthread_sigmask() returns." */ + ASSERT (sigint_occurred == 1); + + return 0; +} + +#else + +/* On native Windows, getpid() values and the arguments that are passed to + the (Cygwin?) 'kill' program are not necessarily related. */ + +int +main () +{ + fputs ("Skipping test: native Windows platform\n", stderr); + return 77; +} + +#endif diff --git a/gnulib-tests/test-pthread_sigmask2.c b/gnulib-tests/test-pthread_sigmask2.c new file mode 100644 index 0000000..1877458 --- /dev/null +++ b/gnulib-tests/test-pthread_sigmask2.c @@ -0,0 +1,105 @@ +/* Test of pthread_sigmask in a multi-threaded program. + Copyright (C) 2011-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2011. */ + +#include <config.h> + +#include <signal.h> + +#include <errno.h> +#include <pthread.h> +#include <stdio.h> +#include <unistd.h> + +#include "macros.h" + +#if USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS + +static pthread_t main_thread; +static pthread_t killer_thread; + +static void * +killer_thread_func (void *arg) +{ + sleep (1); + pthread_kill (main_thread, SIGINT); + return NULL; +} + +static volatile int sigint_occurred; + +static void +sigint_handler (int sig) +{ + sigint_occurred++; +} + +int +main (int argc, char *argv[]) +{ + sigset_t set; + + signal (SIGINT, sigint_handler); + + sigemptyset (&set); + sigaddset (&set, SIGINT); + + /* Check error handling. */ + /* This call returns 0 on NetBSD 8.0. */ +#if !defined __NetBSD__ + ASSERT (pthread_sigmask (1729, &set, NULL) == EINVAL); +#endif + + /* Block SIGINT. */ + ASSERT (pthread_sigmask (SIG_BLOCK, &set, NULL) == 0); + + /* Request a SIGINT signal from another thread. */ + main_thread = pthread_self (); + ASSERT (pthread_create (&killer_thread, NULL, killer_thread_func, NULL) == 0); + + /* Wait. */ + sleep (2); + + /* The signal should not have arrived yet, because it is blocked. */ + ASSERT (sigint_occurred == 0); + + /* Unblock SIGINT. */ + ASSERT (pthread_sigmask (SIG_UNBLOCK, &set, NULL) == 0); + + /* The signal should have arrived now, because POSIX says + "If there are any pending unblocked signals after the call to + pthread_sigmask(), at least one of those signals shall be delivered + before the call to pthread_sigmask() returns." */ + ASSERT (sigint_occurred == 1); + + /* Clean up the thread. This avoid a "ThreadSanitizer: thread leak" warning + from "gcc -fsanitize=thread". */ + ASSERT (pthread_join (killer_thread, NULL) == 0); + + return 0; +} + +#else + +int +main () +{ + fputs ("Skipping test: POSIX threads not enabled\n", stderr); + return 77; +} + +#endif diff --git a/gnulib-tests/test-quotearg-simple.c b/gnulib-tests/test-quotearg-simple.c index b350141..e1c8ba8 100644 --- a/gnulib-tests/test-quotearg-simple.c +++ b/gnulib-tests/test-quotearg-simple.c @@ -1,5 +1,5 @@ /* Test of quotearg family of functions. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-quotearg.h b/gnulib-tests/test-quotearg.h index 177d2bc..dd7529a 100644 --- a/gnulib-tests/test-quotearg.h +++ b/gnulib-tests/test-quotearg.h @@ -1,5 +1,5 @@ /* Test of quotearg family of functions. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-raise.c b/gnulib-tests/test-raise.c index 1210ced..9135623 100644 --- a/gnulib-tests/test-raise.c +++ b/gnulib-tests/test-raise.c @@ -1,5 +1,5 @@ /* Test raising a signal. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-read-file.c b/gnulib-tests/test-read-file.c index aa0cd60..930cf4a 100644 --- a/gnulib-tests/test-read-file.c +++ b/gnulib-tests/test-read-file.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2007, 2010-2018 Free Software Foundation, Inc. + * Copyright (C) 2006-2007, 2010-2020 Free Software Foundation, Inc. * Written by Simon Josefsson * * This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/test-readlink.c b/gnulib-tests/test-readlink.c index 176b9be..c625e9b 100644 --- a/gnulib-tests/test-readlink.c +++ b/gnulib-tests/test-readlink.c @@ -1,5 +1,5 @@ /* Tests of readlink. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-readlink.h b/gnulib-tests/test-readlink.h index 19f92c8..f2e7bd2 100644 --- a/gnulib-tests/test-readlink.h +++ b/gnulib-tests/test-readlink.h @@ -1,5 +1,5 @@ /* Tests of readlink. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-regex.c b/gnulib-tests/test-regex.c index a0aa112..d3f429a 100644 --- a/gnulib-tests/test-regex.c +++ b/gnulib-tests/test-regex.c @@ -1,5 +1,5 @@ /* Test regular expressions - Copyright 1996-2001, 2003-2018 Free Software Foundation, Inc. + Copyright 1996-2001, 2003-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-rename.c b/gnulib-tests/test-rename.c index 7be4d79..633a70f 100644 --- a/gnulib-tests/test-rename.c +++ b/gnulib-tests/test-rename.c @@ -1,5 +1,5 @@ /* Test of rename() function. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-rename.h b/gnulib-tests/test-rename.h index 0548c6c..844e107 100644 --- a/gnulib-tests/test-rename.h +++ b/gnulib-tests/test-rename.h @@ -1,5 +1,5 @@ /* Test of rename() function. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-rmdir.c b/gnulib-tests/test-rmdir.c index 29c299d..0c787b9 100644 --- a/gnulib-tests/test-rmdir.c +++ b/gnulib-tests/test-rmdir.c @@ -1,5 +1,5 @@ /* Tests of rmdir. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-rmdir.h b/gnulib-tests/test-rmdir.h index 3b200ee..c5bdef2 100644 --- a/gnulib-tests/test-rmdir.h +++ b/gnulib-tests/test-rmdir.h @@ -1,5 +1,5 @@ /* Tests of rmdir. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-sameacls.c b/gnulib-tests/test-sameacls.c index 51196e3..cdb10f4 100644 --- a/gnulib-tests/test-sameacls.c +++ b/gnulib-tests/test-sameacls.c @@ -1,5 +1,5 @@ /* Test whether two files have the same ACLs. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 @@ -84,6 +84,9 @@ main (int argc, char *argv[]) fflush (stderr); abort (); } + + free (contents2); + free (contents1); } /* Compare the access permissions of the two files, including ACLs. */ @@ -218,6 +221,12 @@ main (int argc, char *argv[]) return 1; } } + acl_free (text2); + if (acl2 != (acl_t)NULL) + acl_free (acl2); + acl_free (text1); + if (acl1 != (acl_t)NULL) + acl_free (acl1); } #elif HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */ int count1; @@ -287,6 +296,8 @@ main (int argc, char *argv[]) return 1; } } + free (entries2); + free (entries1); } # ifdef ACE_GETACL count1 = acl (file1, ACE_GETACLCNT, 0, NULL); @@ -366,6 +377,8 @@ main (int argc, char *argv[]) return 1; } } + free (entries2); + free (entries1); } # endif #elif HAVE_GETACL /* HP-UX */ @@ -438,6 +451,8 @@ main (int argc, char *argv[]) return 1; } } + free (entries2); + free (entries1); } # if HAVE_ACLV_H /* HP-UX >= 11.11 */ @@ -511,6 +526,8 @@ main (int argc, char *argv[]) return 1; } } + free (entries2); + free (entries1); } # endif #elif HAVE_ACLX_GET /* AIX */ @@ -687,6 +704,8 @@ main (int argc, char *argv[]) return 1; } } + free (entries2); + free (entries1); } #endif } diff --git a/gnulib-tests/test-sched.c b/gnulib-tests/test-sched.c new file mode 100644 index 0000000..7fa4b66 --- /dev/null +++ b/gnulib-tests/test-sched.c @@ -0,0 +1,41 @@ +/* Test of <sched.h> substitute. + Copyright (C) 2008-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <sched.h> + +/* Check that 'struct sched_param' is defined. */ +static struct sched_param a; + +/* Check that the SCHED_* macros are defined and compile-time constants. */ +int b[] = { SCHED_FIFO, SCHED_RR, SCHED_OTHER }; + +/* Check that the types are all defined. */ +pid_t t1; + +static int f1; + +int +main () +{ + /* Check fields of 'struct sched_param'. */ + f1 = a.sched_priority; + + return 0; +} diff --git a/gnulib-tests/test-select-fd.c b/gnulib-tests/test-select-fd.c index 3c1cb98..02f10c4 100644 --- a/gnulib-tests/test-select-fd.c +++ b/gnulib-tests/test-select-fd.c @@ -1,5 +1,5 @@ /* Test of select() substitute, reading or writing from a given file descriptor. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-select-in.sh b/gnulib-tests/test-select-in.sh index 44f5dbb..68176d3 100755 --- a/gnulib-tests/test-select-in.sh +++ b/gnulib-tests/test-select-in.sh @@ -12,25 +12,25 @@ tmpfiles="$tmpfiles t-select-in.tmp" # Regular files. rm -f t-select-in.tmp -./test-select-fd${EXEEXT} r 0 t-select-in.tmp < ./test-select-fd${EXEEXT} +${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < ./test-select-fd${EXEEXT} test `cat t-select-in.tmp` = "1" || exit 1 # Pipes. rm -f t-select-in.tmp { sleep 1; echo abc; } | \ - { ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; cat > /dev/null; } + { ${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; cat > /dev/null; } test `cat t-select-in.tmp` = "0" || exit 1 rm -f t-select-in.tmp -echo abc | { sleep 1; ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; } +echo abc | { sleep 1; ${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; } test `cat t-select-in.tmp` = "1" || exit 1 # Special files. # This part of the test is known to fail on Solaris 2.6 and older. rm -f t-select-in.tmp -./test-select-fd${EXEEXT} r 0 t-select-in.tmp < /dev/null +${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < /dev/null test `cat t-select-in.tmp` = "1" || exit 1 rm -fr $tmpfiles diff --git a/gnulib-tests/test-select-out.sh b/gnulib-tests/test-select-out.sh index c5fd861..dbeace5 100755 --- a/gnulib-tests/test-select-out.sh +++ b/gnulib-tests/test-select-out.sh @@ -9,25 +9,25 @@ tmpfiles="$tmpfiles t-select-out.out t-select-out.tmp" # Regular files. rm -f t-select-out.tmp -./test-select-fd${EXEEXT} w 1 t-select-out.tmp > t-select-out.out +${CHECKER} ./test-select-fd${EXEEXT} w 1 t-select-out.tmp > t-select-out.out test `cat t-select-out.tmp` = "1" || exit 1 # Pipes. if false; then # This test fails on some platforms. rm -f t-select-out.tmp - ( { echo abc; ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | { sleep 1; cat; } ) > /dev/null + ( { echo abc; ${CHECKER} ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | { sleep 1; cat; } ) > /dev/null test `cat t-select-out.tmp` = "0" || exit 1 fi rm -f t-select-out.tmp -( { sleep 1; echo abc; ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | cat) > /dev/null +( { sleep 1; echo abc; ${CHECKER} ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | cat) > /dev/null test `cat t-select-out.tmp` = "1" || exit 1 # Special files. rm -f t-select-out.tmp -./test-select-fd${EXEEXT} w 1 t-select-out.tmp > /dev/null +${CHECKER} ./test-select-fd${EXEEXT} w 1 t-select-out.tmp > /dev/null test `cat t-select-out.tmp` = "1" || exit 1 rm -fr $tmpfiles diff --git a/gnulib-tests/test-select-stdin.c b/gnulib-tests/test-select-stdin.c index f8d7617..aadba6e 100644 --- a/gnulib-tests/test-select-stdin.c +++ b/gnulib-tests/test-select-stdin.c @@ -1,5 +1,5 @@ /* Test of select() substitute, reading from stdin. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-select.c b/gnulib-tests/test-select.c index 00e4fb6..55ad7bc 100644 --- a/gnulib-tests/test-select.c +++ b/gnulib-tests/test-select.c @@ -1,5 +1,5 @@ /* Test of select() substitute. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-select.h b/gnulib-tests/test-select.h index b0f17f3..45d0325 100644 --- a/gnulib-tests/test-select.h +++ b/gnulib-tests/test-select.h @@ -1,5 +1,5 @@ /* Test of select() substitute. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-set-mode-acl-1.sh b/gnulib-tests/test-set-mode-acl-1.sh index 68c247c..73a4010 100755 --- a/gnulib-tests/test-set-mode-acl-1.sh +++ b/gnulib-tests/test-set-mode-acl-1.sh @@ -3,11 +3,16 @@ # Test set-mode-acl on the file system of /var/tmp, which usually is a local # file system. +. "${srcdir=.}/init.sh"; path_prepend_ . + if test -d /var/tmp; then TMPDIR=/var/tmp else TMPDIR=/tmp fi +test -d $TMPDIR || Exit 77 export TMPDIR -exec "${srcdir}/test-set-mode-acl.sh" +$BOURNE_SHELL "${srcdir}/test-set-mode-acl.sh" + +Exit $? diff --git a/gnulib-tests/test-set-mode-acl-2.sh b/gnulib-tests/test-set-mode-acl-2.sh index d1377df..2f7c8c0 100755 --- a/gnulib-tests/test-set-mode-acl-2.sh +++ b/gnulib-tests/test-set-mode-acl-2.sh @@ -3,7 +3,11 @@ # Test set-mode-acl on the file system of the build directory, which may be # a local file system or NFS mounted. +. "${srcdir=.}/init.sh"; path_prepend_ . + TMPDIR=`pwd` export TMPDIR -exec "${srcdir}/test-set-mode-acl.sh" +$BOURNE_SHELL "${srcdir}/test-set-mode-acl.sh" + +Exit $? diff --git a/gnulib-tests/test-set-mode-acl.c b/gnulib-tests/test-set-mode-acl.c index 13eb601..638eda7 100644 --- a/gnulib-tests/test-set-mode-acl.c +++ b/gnulib-tests/test-set-mode-acl.c @@ -1,5 +1,5 @@ /* Test of setting an ACL equivalent to a mode. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-set-mode-acl.sh b/gnulib-tests/test-set-mode-acl.sh index f0b1641..fdcd64b 100755 --- a/gnulib-tests/test-set-mode-acl.sh +++ b/gnulib-tests/test-set-mode-acl.sh @@ -41,7 +41,12 @@ func_tmpdir () } func_tmpdir -builddir=`pwd` +# builddir may already be set by the script that invokes this one. +case "$builddir" in + '') builddir=`pwd` ;; + /* | ?:*) ;; + *) builddir=`pwd`/$builddir ;; +esac cd "$builddir" || { echo "$0: cannot determine build directory (unreadable parent dir?)" >&2 @@ -155,14 +160,14 @@ cd "$builddir" || chmod 600 tmpfile1 # Try to set the ACL to only the given mode. - "$builddir"/test-set-mode-acl${EXEEXT} tmpfile1 $mode + ${CHECKER} "$builddir"/test-set-mode-acl${EXEEXT} tmpfile1 $mode # Verify that tmpfile1 has no ACL and has the desired mode. modestring=`ls -l tmpfile1 | dd ibs=1 count=10 2>/dev/null` if test "x$modestring" != "x$modestring0"; then echo "mode = $mode: tmpfile1 has wrong mode: $modestring" 1>&2 exit 1 fi - if test `"$builddir"/test-file-has-acl${EXEEXT} tmpfile1` != no; then + if test `${CHECKER} "$builddir"/test-file-has-acl${EXEEXT} tmpfile1` != no; then echo "mode = $mode: tmpfile1 got an ACL" 1>&2 exit 1 fi @@ -207,14 +212,14 @@ cd "$builddir" || esac # Try to set the ACL to only the given mode. - "$builddir"/test-set-mode-acl${EXEEXT} tmpfile2 $mode + ${CHECKER} "$builddir"/test-set-mode-acl${EXEEXT} tmpfile2 $mode # Verify that tmpfile2 has no ACL and has the desired mode. modestring=`ls -l tmpfile2 | dd ibs=1 count=10 2>/dev/null` if test "x$modestring" != "x$modestring0"; then echo "mode = $mode: tmpfile2 has wrong mode: $modestring" 1>&2 exit 1 fi - if test `"$builddir"/test-file-has-acl${EXEEXT} tmpfile2` != no; then + if test `${CHECKER} "$builddir"/test-file-has-acl${EXEEXT} tmpfile2` != no; then echo "mode = $mode: tmpfile2 still has an ACL" 1>&2 exit 1 fi diff --git a/gnulib-tests/test-setenv.c b/gnulib-tests/test-setenv.c index ded124d..2114d9e 100644 --- a/gnulib-tests/test-setenv.c +++ b/gnulib-tests/test-setenv.c @@ -1,5 +1,5 @@ /* Tests of setenv. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-setlocale1.c b/gnulib-tests/test-setlocale1.c index a9bb3a0..1dd41e3 100644 --- a/gnulib-tests/test-setlocale1.c +++ b/gnulib-tests/test-setlocale1.c @@ -1,5 +1,5 @@ /* Test of setting the current locale. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-setlocale1.sh b/gnulib-tests/test-setlocale1.sh index 59a0532..53ad09f 100755 --- a/gnulib-tests/test-setlocale1.sh +++ b/gnulib-tests/test-setlocale1.sh @@ -16,19 +16,19 @@ if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none \ fi if test $LOCALE_FR != none; then - LC_ALL=$LOCALE_FR ./test-setlocale1${EXEEXT} || exit 1 + LC_ALL=$LOCALE_FR ${CHECKER} ./test-setlocale1${EXEEXT} || exit 1 fi if test $LOCALE_FR_UTF8 != none; then - LC_ALL=$LOCALE_FR_UTF8 ./test-setlocale1${EXEEXT} || exit 1 + LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-setlocale1${EXEEXT} || exit 1 fi if test $LOCALE_JA != none; then - LC_ALL=$LOCALE_JA ./test-setlocale1${EXEEXT} || exit 1 + LC_ALL=$LOCALE_JA ${CHECKER} ./test-setlocale1${EXEEXT} || exit 1 fi if test $LOCALE_ZH_CN != none; then - LC_ALL=$LOCALE_ZH_CN ./test-setlocale1${EXEEXT} || exit 1 + LC_ALL=$LOCALE_ZH_CN ${CHECKER} ./test-setlocale1${EXEEXT} || exit 1 fi exit 0 diff --git a/gnulib-tests/test-setlocale2.c b/gnulib-tests/test-setlocale2.c index 780e1ea..d634689 100644 --- a/gnulib-tests/test-setlocale2.c +++ b/gnulib-tests/test-setlocale2.c @@ -1,5 +1,5 @@ /* Test of setting the current locale. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-setlocale2.sh b/gnulib-tests/test-setlocale2.sh index f772cb0..79ea32f 100755 --- a/gnulib-tests/test-setlocale2.sh +++ b/gnulib-tests/test-setlocale2.sh @@ -2,7 +2,7 @@ # Test locale names with likely unsupported encoding in Unix syntax. for name in ar_SA.ISO-8859-1 fr_FR.CP1251 zh_TW.GB18030 zh_CN.BIG5; do - env LC_ALL=$name ./test-setlocale2${EXEEXT} 1 || exit 1 + env LC_ALL=$name ${CHECKER} ./test-setlocale2${EXEEXT} 1 || exit 1 done # Test locale names with likely unsupported encoding in native Windows syntax. @@ -11,7 +11,7 @@ for name in "Arabic_Saudi Arabia.1252" "Arabic_Saudi Arabia.65001" \ Chinese_Taiwan.65001 Chinese_China.54936 Chinese_China.65001; do # Here we use 'env' to set the LC_ALL environment variable, because on # Solaris 11.0, the /bin/sh refuses to do it for Turkish_Turkey.65001. - env LC_ALL="$name" ./test-setlocale2${EXEEXT} 1 || exit 1 + env LC_ALL="$name" ${CHECKER} ./test-setlocale2${EXEEXT} 1 || exit 1 done exit 0 diff --git a/gnulib-tests/test-setlocale_null-mt-all.c b/gnulib-tests/test-setlocale_null-mt-all.c new file mode 100644 index 0000000..19bdb55 --- /dev/null +++ b/gnulib-tests/test-setlocale_null-mt-all.c @@ -0,0 +1,169 @@ +/* Multithread-safety test for setlocale_null_r (LC_ALL, ...). + Copyright (C) 2019-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2019. */ + +#include <config.h> + +#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS + +/* Specification. */ +#include <locale.h> + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + +#include "glthread/thread.h" + +/* We want to use the system's setlocale() function here, not the gnulib + override. */ +#undef setlocale + + +/* Some common locale names. */ + +#if defined _WIN32 && !defined __CYGWIN__ +# define ENGLISH "English_United States" +# define GERMAN "German_Germany" +# define FRENCH "French_France" +# define ENCODING ".1252" +#else +# define ENGLISH "en_US" +# define GERMAN "de_DE" +# define FRENCH "fr_FR" +# if defined __sgi +# define ENCODING ".ISO8859-15" +# elif defined __hpux +# define ENCODING ".utf8" +# else +# define ENCODING ".UTF-8" +# endif +#endif + +static const char LOCALE1[] = ENGLISH ENCODING; +static const char LOCALE2[] = GERMAN ENCODING; +static const char LOCALE3[] = FRENCH ENCODING; + +static char *expected; + +static void * +thread1_func (void *arg) +{ + for (;;) + { + char buf[SETLOCALE_NULL_ALL_MAX]; + + if (setlocale_null_r (LC_ALL, buf, sizeof (buf))) + abort (); + if (strcmp (expected, buf) != 0) + { + fprintf (stderr, "thread1 disturbed by thread2!\n"); fflush (stderr); + abort (); + } + } + + /*NOTREACHED*/ + return NULL; +} + +static void * +thread2_func (void *arg) +{ + for (;;) + { + char buf[SETLOCALE_NULL_ALL_MAX]; + + setlocale_null_r (LC_NUMERIC, buf, sizeof (buf)); + setlocale_null_r (LC_ALL, buf, sizeof (buf)); + } + + /*NOTREACHED*/ + return NULL; +} + +int +main (int argc, char *argv[]) +{ + if (setlocale (LC_ALL, LOCALE1) == NULL) + { + fprintf (stderr, "Skipping test: LOCALE1 not recognized\n"); + return 77; + } + if (setlocale (LC_NUMERIC, LOCALE2) == NULL) + { + fprintf (stderr, "Skipping test: LOCALE2 not recognized\n"); + return 77; + } + if (setlocale (LC_TIME, LOCALE3) == NULL) + { + fprintf (stderr, "Skipping test: LOCALE3 not recognized\n"); + return 77; + } + + expected = strdup (setlocale (LC_ALL, NULL)); + + /* Create the two threads. */ + gl_thread_create (thread1_func, NULL); + gl_thread_create (thread2_func, NULL); + + /* Let them run for 5 seconds. */ + { + struct timespec duration; + duration.tv_sec = 5; + duration.tv_nsec = 0; + + nanosleep (&duration, NULL); + } + + return 0; +} + +#else + +/* No multithreading available. */ + +#include <stdio.h> + +int +main () +{ + fputs ("Skipping test: multithreading not enabled\n", stderr); + return 77; +} + +#endif + +/* Without locking, the results of this test would be: +glibc OK +musl libc crash < 10 sec +macOS crash < 1 sec +FreeBSD crash < 1 sec +NetBSD crash < 2 sec +OpenBSD crash < 1 sec +AIX crash < 2 sec +HP-UX OK +IRIX OK +Solaris 10 OK +Solaris 11.0 OK +Solaris 11.4 OK +Solaris OpenIndiana OK +Haiku crash < 1 sec +Cygwin crash < 1 sec +mingw OK +MSVC OK (assuming compiler option /MD !) +*/ diff --git a/gnulib-tests/test-setlocale_null-mt-one.c b/gnulib-tests/test-setlocale_null-mt-one.c new file mode 100644 index 0000000..fd6083a --- /dev/null +++ b/gnulib-tests/test-setlocale_null-mt-one.c @@ -0,0 +1,169 @@ +/* Multithread-safety test for setlocale_null_r (LC_xxx, ...). + Copyright (C) 2019-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2019. */ + +#include <config.h> + +#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS + +/* Specification. */ +#include <locale.h> + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + +#include "glthread/thread.h" + +/* We want to use the system's setlocale() function here, not the gnulib + override. */ +#undef setlocale + + +/* Some common locale names. */ + +#if defined _WIN32 && !defined __CYGWIN__ +# define ENGLISH "English_United States" +# define GERMAN "German_Germany" +# define FRENCH "French_France" +# define ENCODING ".1252" +#else +# define ENGLISH "en_US" +# define GERMAN "de_DE" +# define FRENCH "fr_FR" +# if defined __sgi +# define ENCODING ".ISO8859-15" +# elif defined __hpux +# define ENCODING ".utf8" +# else +# define ENCODING ".UTF-8" +# endif +#endif + +static const char LOCALE1[] = ENGLISH ENCODING; +static const char LOCALE2[] = GERMAN ENCODING; +static const char LOCALE3[] = FRENCH ENCODING; + +static char *expected; + +static void * +thread1_func (void *arg) +{ + for (;;) + { + char buf[SETLOCALE_NULL_MAX]; + + if (setlocale_null_r (LC_NUMERIC, buf, sizeof (buf))) + abort (); + if (strcmp (expected, buf) != 0) + { + fprintf (stderr, "thread1 disturbed by thread2!\n"); fflush (stderr); + abort (); + } + } + + /*NOTREACHED*/ + return NULL; +} + +static void * +thread2_func (void *arg) +{ + for (;;) + { + char buf[SETLOCALE_NULL_MAX]; + + setlocale_null_r (LC_NUMERIC, buf, sizeof (buf)); + setlocale_null_r (LC_TIME, buf, sizeof (buf)); + } + + /*NOTREACHED*/ + return NULL; +} + +int +main (int argc, char *argv[]) +{ + if (setlocale (LC_ALL, LOCALE1) == NULL) + { + fprintf (stderr, "Skipping test: LOCALE1 not recognized\n"); + return 77; + } + if (setlocale (LC_NUMERIC, LOCALE2) == NULL) + { + fprintf (stderr, "Skipping test: LOCALE2 not recognized\n"); + return 77; + } + if (setlocale (LC_TIME, LOCALE3) == NULL) + { + fprintf (stderr, "Skipping test: LOCALE3 not recognized\n"); + return 77; + } + + expected = strdup (setlocale (LC_NUMERIC, NULL)); + + /* Create the two threads. */ + gl_thread_create (thread1_func, NULL); + gl_thread_create (thread2_func, NULL); + + /* Let them run for 2 seconds. */ + { + struct timespec duration; + duration.tv_sec = 2; + duration.tv_nsec = 0; + + nanosleep (&duration, NULL); + } + + return 0; +} + +#else + +/* No multithreading available. */ + +#include <stdio.h> + +int +main () +{ + fputs ("Skipping test: multithreading not enabled\n", stderr); + return 77; +} + +#endif + +/* Without locking, the results of this test would be: +glibc OK +musl libc OK +macOS OK +FreeBSD OK +NetBSD OK +OpenBSD crash < 1 sec +AIX crash < 2 sec +HP-UX OK +IRIX OK +Solaris 10 OK +Solaris 11.0 OK +Solaris 11.4 OK +Solaris OpenIndiana OK +Haiku OK +Cygwin OK +mingw OK +MSVC OK (assuming compiler option /MD !) +*/ diff --git a/gnulib-tests/test-setlocale_null.c b/gnulib-tests/test-setlocale_null.c new file mode 100644 index 0000000..5a9329e --- /dev/null +++ b/gnulib-tests/test-setlocale_null.c @@ -0,0 +1,32 @@ +/* Test of setlocale_null_r function. + Copyright (C) 2019-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2019. */ + +#include <config.h> + +/* Specification. */ +#include <locale.h> + +/* Check that SETLOCALE_NULL_ALL_MAX is a constant expression. */ +static char buf[SETLOCALE_NULL_ALL_MAX]; + +int +main () +{ + /* Check that setlocale_null_r() can be used with $(LIB_SETLOCALE_NULL). */ + return setlocale_null_r (LC_ALL, buf, sizeof (buf)) != 0; +} diff --git a/gnulib-tests/test-setsockopt.c b/gnulib-tests/test-setsockopt.c index 22a444f..d2456dd 100644 --- a/gnulib-tests/test-setsockopt.c +++ b/gnulib-tests/test-setsockopt.c @@ -1,5 +1,5 @@ /* Test setsockopt() function. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-sigaction.c b/gnulib-tests/test-sigaction.c index e0ef06c..e48ba2b 100644 --- a/gnulib-tests/test-sigaction.c +++ b/gnulib-tests/test-sigaction.c @@ -1,5 +1,5 @@ /* Test of sigaction() function. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-signal-h.c b/gnulib-tests/test-signal-h.c index 0ee5146..a504f56 100644 --- a/gnulib-tests/test-signal-h.c +++ b/gnulib-tests/test-signal-h.c @@ -1,5 +1,5 @@ /* Test of <signal.h> substitute. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-sigprocmask.c b/gnulib-tests/test-sigprocmask.c index 7b09bb1..df3602e 100644 --- a/gnulib-tests/test-sigprocmask.c +++ b/gnulib-tests/test-sigprocmask.c @@ -1,5 +1,5 @@ /* Test of sigprocmask. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-sleep.c b/gnulib-tests/test-sleep.c index 2f0a995..cb659ba 100644 --- a/gnulib-tests/test-sleep.c +++ b/gnulib-tests/test-sleep.c @@ -1,5 +1,5 @@ /* Test of sleep() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-sockets.c b/gnulib-tests/test-sockets.c index 4ff8357..cd35952 100644 --- a/gnulib-tests/test-sockets.c +++ b/gnulib-tests/test-sockets.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2018 Free Software Foundation, Inc. + * Copyright (C) 2008-2020 Free Software Foundation, Inc. * Written by Simon Josefsson. * * This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/test-stat-time.c b/gnulib-tests/test-stat-time.c index 49d5497..86d4346 100644 --- a/gnulib-tests/test-stat-time.c +++ b/gnulib-tests/test-stat-time.c @@ -1,5 +1,5 @@ /* Test of <stat-time.h>. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-stat.c b/gnulib-tests/test-stat.c index 19971e7..59cfca7 100644 --- a/gnulib-tests/test-stat.c +++ b/gnulib-tests/test-stat.c @@ -1,5 +1,5 @@ /* Tests of stat. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-stat.h b/gnulib-tests/test-stat.h index 425246e..264d739 100644 --- a/gnulib-tests/test-stat.h +++ b/gnulib-tests/test-stat.h @@ -1,5 +1,5 @@ /* Tests of stat. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 @@ -32,12 +32,18 @@ test_stat_func (int (*func) (char const *, struct stat *), bool print) ASSERT (cwd); ASSERT (func (".", &st1) == 0); ASSERT (func ("./", &st2) == 0); +#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES) ASSERT (SAME_INODE (st1, st2)); +#endif ASSERT (func (cwd, &st2) == 0); +#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES) ASSERT (SAME_INODE (st1, st2)); +#endif ASSERT (func ("/", &st1) == 0); ASSERT (func ("///", &st2) == 0); +#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES) ASSERT (SAME_INODE (st1, st2)); +#endif errno = 0; ASSERT (func ("", &st1) == -1); diff --git a/gnulib-tests/test-stdalign.c b/gnulib-tests/test-stdalign.c index bced3f6..65e5c6a 100644 --- a/gnulib-tests/test-stdalign.c +++ b/gnulib-tests/test-stdalign.c @@ -1,5 +1,5 @@ /* Test of <stdalign.h>. - Copyright 2009-2018 Free Software Foundation, Inc. + Copyright 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-stdbool.c b/gnulib-tests/test-stdbool.c index 6b775bf..b128b55 100644 --- a/gnulib-tests/test-stdbool.c +++ b/gnulib-tests/test-stdbool.c @@ -1,5 +1,5 @@ /* Test of <stdbool.h> substitute. - Copyright (C) 2002-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-stddef.c b/gnulib-tests/test-stddef.c index 311001a..636c075 100644 --- a/gnulib-tests/test-stddef.c +++ b/gnulib-tests/test-stddef.c @@ -1,5 +1,5 @@ /* Test of <stddef.h> substitute. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-stdint.c b/gnulib-tests/test-stdint.c index 8a46557..6da84b2 100644 --- a/gnulib-tests/test-stdint.c +++ b/gnulib-tests/test-stdint.c @@ -1,5 +1,5 @@ /* Test of <stdint.h> substitute. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2020 Free Software Foundation, Inc. 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 @@ -217,12 +217,14 @@ err or; /* 7.18.2.4. Limits of integer types capable of holding object pointers */ intptr_t g[3] = { 17, INTPTR_MIN, INTPTR_MAX }; +verify (sizeof (void *) <= sizeof (intptr_t)); verify (TYPE_MINIMUM (intptr_t) == INTPTR_MIN); verify (TYPE_MAXIMUM (intptr_t) == INTPTR_MAX); verify_same_types (INTPTR_MIN, (intptr_t) 0 + 0); verify_same_types (INTPTR_MAX, (intptr_t) 0 + 0); uintptr_t h[2] = { 17, UINTPTR_MAX }; +verify (sizeof (void *) <= sizeof (uintptr_t)); verify (TYPE_MAXIMUM (uintptr_t) == UINTPTR_MAX); verify_same_types (UINTPTR_MAX, (uintptr_t) 0 + 0); diff --git a/gnulib-tests/test-stdio.c b/gnulib-tests/test-stdio.c index c307d8c..55a34db 100644 --- a/gnulib-tests/test-stdio.c +++ b/gnulib-tests/test-stdio.c @@ -1,5 +1,5 @@ /* Test of <stdio.h> substitute. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-stdlib.c b/gnulib-tests/test-stdlib.c index 3a5c608..1314d77 100644 --- a/gnulib-tests/test-stdlib.c +++ b/gnulib-tests/test-stdlib.c @@ -1,5 +1,5 @@ /* Test of <stdlib.h> substitute. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-strerror.c b/gnulib-tests/test-strerror.c index cd0df39..16afe00 100644 --- a/gnulib-tests/test-strerror.c +++ b/gnulib-tests/test-strerror.c @@ -1,5 +1,5 @@ /* Test of strerror() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-strerror_r.c b/gnulib-tests/test-strerror_r.c index da3679a..b11d6fd 100644 --- a/gnulib-tests/test-strerror_r.c +++ b/gnulib-tests/test-strerror_r.c @@ -1,5 +1,5 @@ /* Test of strerror_r() function. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-string.c b/gnulib-tests/test-string.c index 75313b2..2151f7a 100644 --- a/gnulib-tests/test-string.c +++ b/gnulib-tests/test-string.c @@ -1,5 +1,5 @@ /* Test of <string.h> substitute. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-strverscmp.c b/gnulib-tests/test-strverscmp.c index 5aeec59..22cca34 100644 --- a/gnulib-tests/test-strverscmp.c +++ b/gnulib-tests/test-strverscmp.c @@ -1,5 +1,5 @@ /* Test of strverscmp() function. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-symlink.c b/gnulib-tests/test-symlink.c index d58f27e..76ac63f 100644 --- a/gnulib-tests/test-symlink.c +++ b/gnulib-tests/test-symlink.c @@ -1,5 +1,5 @@ /* Tests of symlink. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-symlink.h b/gnulib-tests/test-symlink.h index ddc8994..da6b184 100644 --- a/gnulib-tests/test-symlink.h +++ b/gnulib-tests/test-symlink.h @@ -1,5 +1,5 @@ /* Tests of symlink. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 @@ -67,7 +67,8 @@ test_symlink (int (*func) (char const *, char const *), bool print) ASSERT (errno == EEXIST); errno = 0; ASSERT (func ("nowhere", BASE "dir/") == -1); - ASSERT (errno == EEXIST || errno == EINVAL); + ASSERT (errno == EEXIST || errno == EINVAL + || errno == ENOENT /* Lustre FS on Linux */); ASSERT (close (creat (BASE "file", 0600)) == 0); errno = 0; ASSERT (func ("nowhere", BASE "file") == -1); diff --git a/gnulib-tests/test-sys_ioctl.c b/gnulib-tests/test-sys_ioctl.c index 7643bed..3aeb375 100644 --- a/gnulib-tests/test-sys_ioctl.c +++ b/gnulib-tests/test-sys_ioctl.c @@ -1,5 +1,5 @@ /* Test of <sys/ioctl.h> substitute. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-sys_select.c b/gnulib-tests/test-sys_select.c index d9ca02d..01eced5 100644 --- a/gnulib-tests/test-sys_select.c +++ b/gnulib-tests/test-sys_select.c @@ -1,5 +1,5 @@ /* Test of <sys/select.h> substitute. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-sys_socket.c b/gnulib-tests/test-sys_socket.c index 1335823..82c1419 100644 --- a/gnulib-tests/test-sys_socket.c +++ b/gnulib-tests/test-sys_socket.c @@ -1,5 +1,5 @@ /* Test of <sys/socket.h> substitute. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-sys_stat.c b/gnulib-tests/test-sys_stat.c index 3c68c3c..a75f5f6 100644 --- a/gnulib-tests/test-sys_stat.c +++ b/gnulib-tests/test-sys_stat.c @@ -1,5 +1,5 @@ /* Test of <sys/stat.h> substitute. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-sys_time.c b/gnulib-tests/test-sys_time.c index 6a35e0f..db9909b 100644 --- a/gnulib-tests/test-sys_time.c +++ b/gnulib-tests/test-sys_time.c @@ -1,5 +1,5 @@ /* Test of <sys/time.h> substitute. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-sys_types.c b/gnulib-tests/test-sys_types.c index a44164d..65d49dc 100644 --- a/gnulib-tests/test-sys_types.c +++ b/gnulib-tests/test-sys_types.c @@ -1,5 +1,5 @@ /* Test of <sys/types.h> substitute. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-sys_uio.c b/gnulib-tests/test-sys_uio.c index 0b9347c..fc62cf3 100644 --- a/gnulib-tests/test-sys_uio.c +++ b/gnulib-tests/test-sys_uio.c @@ -1,5 +1,5 @@ /* Test of <sys/uio.h> substitute. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-sys_wait.h b/gnulib-tests/test-sys_wait.h index 699f2fb..20c4f31 100644 --- a/gnulib-tests/test-sys_wait.h +++ b/gnulib-tests/test-sys_wait.h @@ -1,5 +1,5 @@ /* Test of macros shared between <sys/wait.h> and <stdlib.h>. - Copyright (C) 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2010-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-thread_create.c b/gnulib-tests/test-thread_create.c new file mode 100644 index 0000000..320d64a --- /dev/null +++ b/gnulib-tests/test-thread_create.c @@ -0,0 +1,78 @@ +/* Test of gl_thread_create () macro. + Copyright (C) 2011-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2011. */ + +#include <config.h> + +#include "glthread/thread.h" + +#include <stdio.h> +#include <string.h> + +#include "macros.h" + +static gl_thread_t main_thread_before; +static gl_thread_t main_thread_after; +static gl_thread_t worker_thread; + +static int dummy; +static volatile int work_done; + +static void * +worker_thread_func (void *arg) +{ + work_done = 1; + return &dummy; +} + +int +main () +{ + main_thread_before = gl_thread_self (); + + if (glthread_create (&worker_thread, worker_thread_func, NULL) == 0) + { + void *ret; + + /* Check that gl_thread_self () has the same value before than after the + first call to gl_thread_create (). */ + main_thread_after = gl_thread_self (); + ASSERT (memcmp (&main_thread_before, &main_thread_after, + sizeof (gl_thread_t)) + == 0); + + gl_thread_join (worker_thread, &ret); + + /* Check the return value of the thread. */ + ASSERT (ret == &dummy); + + /* Check that worker_thread_func () has finished executing. */ + ASSERT (work_done); + + return 0; + } + else + { +#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS + fputs ("glthread_create failed\n", stderr); + return 1; +#else + fputs ("Skipping test: multithreading not enabled\n", stderr); + return 77; +#endif + } +} diff --git a/gnulib-tests/test-thread_self.c b/gnulib-tests/test-thread_self.c new file mode 100644 index 0000000..f0c302b --- /dev/null +++ b/gnulib-tests/test-thread_self.c @@ -0,0 +1,39 @@ +/* Test of gl_thread_self () macro. + Copyright (C) 2011-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2011. */ + +#include <config.h> + +#include "glthread/thread.h" + +gl_thread_t main_thread; + +int +main () +{ + /* Check that gl_thread_self () can be used with just $(LIBTHREAD), not + $(LIBMULTITHREAD), i.e. in libraries that are multithread-safe but don't + create threads themselves. */ + /* This is not the case on AIX with --enable-threads=isoc+posix, because in + this case, $(LIBTHREAD) is empty whereas $(LIBMULTITHREAD) is '-lpthread'. + */ +#if !defined _AIX + main_thread = gl_thread_self (); +#endif + + return 0; +} diff --git a/gnulib-tests/test-time.c b/gnulib-tests/test-time.c index e016397..1587c28 100644 --- a/gnulib-tests/test-time.c +++ b/gnulib-tests/test-time.c @@ -1,5 +1,5 @@ /* Test of <time.h> substitute. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-unistd.c b/gnulib-tests/test-unistd.c index 2219456..5ba7d5b 100644 --- a/gnulib-tests/test-unistd.c +++ b/gnulib-tests/test-unistd.c @@ -1,5 +1,5 @@ /* Test of <unistd.h> substitute. - Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-unsetenv.c b/gnulib-tests/test-unsetenv.c index a5dd594..f912e79 100644 --- a/gnulib-tests/test-unsetenv.c +++ b/gnulib-tests/test-unsetenv.c @@ -1,5 +1,5 @@ /* Tests of unsetenv. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-update-copyright.sh b/gnulib-tests/test-update-copyright.sh index d1d18c1..adba779 100755 --- a/gnulib-tests/test-update-copyright.sh +++ b/gnulib-tests/test-update-copyright.sh @@ -1,6 +1,6 @@ #!/bin/sh # Test suite for update-copyright. -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2020 Free Software Foundation, Inc. # This file is part of the GNUlib Library. # # This program is free software: you can redistribute it and/or modify @@ -37,9 +37,23 @@ trap 'rm -f $TMP_BASE*' 0 1 2 3 15 TMP=$TMP_BASE s=$TMP-script cat <<\EOF > $s -eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"' - & eval 'exec perl -wS -0777 -pi "$0" $argv:q' - if 0; +#!/bin/sh +#! -*-perl-*- +# This is a prologue that allows to run a perl script as an executable +# on systems that are compliant to a POSIX version before POSIX:2017. +# On such systems, the usual invocation of an executable through execlp() +# or execvp() fails with ENOEXEC if it is a script that does not start +# with a #! line. The script interpreter mentioned in the #! line has +# to be /bin/sh, because on GuixSD systems that is the only program that +# has a fixed file name. The second line is essential for perl and is +# also useful for editing this file in Emacs. The next two lines below +# are valid code in both sh and perl. When executed by sh, they re-execute +# the script through the perl program found in $PATH. The '-x' option +# is essential as well; without it, perl would re-execute the script +# through /bin/sh. When executed by perl, the next two lines are a no-op. +eval 'exec perl -wSx -pi "$0" "$@"' + if 0; + s/a/b/ EOF chmod a+x $s diff --git a/gnulib-tests/test-vc-list-files-cvs.sh b/gnulib-tests/test-vc-list-files-cvs.sh index 5cd37f7..964d1c4 100755 --- a/gnulib-tests/test-vc-list-files-cvs.sh +++ b/gnulib-tests/test-vc-list-files-cvs.sh @@ -1,6 +1,6 @@ #!/bin/sh # Unit tests for vc-list-files -# Copyright (C) 2008-2018 Free Software Foundation, Inc. +# Copyright (C) 2008-2020 Free Software Foundation, Inc. # This file is part of the GNUlib Library. # # This program is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. */ : ${srcdir=.} -. "$srcdir/init.sh"; path_prepend_ "$abs_aux_dir" . +. "$srcdir/init.sh"; path_prepend_ . tmpdir=vc-cvs repo=`pwd`/$tmpdir/repo @@ -44,7 +44,7 @@ for i in with-cvsu without; do cvs -Q -d "$repo" import -m imp m M M0 && cvs -Q -d "$repo" co m && cd m && printf '%s\n' b c d/a > expected && - vc-list-files | sort > actual && + $BOURNE_SHELL "$abs_aux_dir/vc-list-files" | sort > actual && compare expected actual && ok=1 test $ok = 0 && fail=1 diff --git a/gnulib-tests/test-vc-list-files-git.sh b/gnulib-tests/test-vc-list-files-git.sh index 2775fd8..ef537f8 100755 --- a/gnulib-tests/test-vc-list-files-git.sh +++ b/gnulib-tests/test-vc-list-files-git.sh @@ -1,6 +1,6 @@ #!/bin/sh # Unit tests for vc-list-files -# Copyright (C) 2008-2018 Free Software Foundation, Inc. +# Copyright (C) 2008-2020 Free Software Foundation, Inc. # This file is part of the GNUlib Library. # # This program is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. */ : ${srcdir=.} -. "$srcdir/init.sh"; path_prepend_ "$abs_aux_dir" . +. "$srcdir/init.sh"; path_prepend_ . tmpdir=vc-git-$$ GIT_DIR= GIT_WORK_TREE=; unset GIT_DIR GIT_WORK_TREE @@ -35,7 +35,7 @@ mkdir $tmpdir && cd $tmpdir && git add . > /dev/null && git commit -q -a -m log && printf '%s\n' b c d/a > expected && - vc-list-files > actual && + $BOURNE_SHELL "$abs_aux_dir/vc-list-files" > actual && compare expected actual && fail=0 diff --git a/gnulib-tests/test-verify-try.c b/gnulib-tests/test-verify-try.c index 20ccffc..c44a065 100644 --- a/gnulib-tests/test-verify-try.c +++ b/gnulib-tests/test-verify-try.c @@ -1,6 +1,6 @@ /* Test the "verify" module. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-verify.c b/gnulib-tests/test-verify.c index af97076..498dd2f 100644 --- a/gnulib-tests/test-verify.c +++ b/gnulib-tests/test-verify.c @@ -1,6 +1,6 @@ /* Test the "verify" module. - Copyright (C) 2005, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc. 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 @@ -39,7 +39,7 @@ verify (1 == 1); verify (1 == 1); /* should be ok */ enum { - item = verify_true (1 == 1) * 0 + 17 /* should be ok */ + item = verify_expr (1 == 1, 10 * 0 + 17) /* should be ok */ }; static int diff --git a/gnulib-tests/test-version-etc.c b/gnulib-tests/test-version-etc.c index 931aa08..5c66e85 100644 --- a/gnulib-tests/test-version-etc.c +++ b/gnulib-tests/test-version-etc.c @@ -1,5 +1,5 @@ /* Test suite for version-etc. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. This file is part of the GNUlib Library. This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/test-version-etc.sh b/gnulib-tests/test-version-etc.sh index b796f3e..6e9e6c4 100755 --- a/gnulib-tests/test-version-etc.sh +++ b/gnulib-tests/test-version-etc.sh @@ -1,6 +1,6 @@ #! /bin/sh # Test suite for version-etc. -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2020 Free Software Foundation, Inc. # This file is part of the GNUlib Library. # # This program is free software: you can redistribute it and/or modify @@ -33,7 +33,7 @@ There is NO WARRANTY, to the extent permitted by law. Written by Sergey Poznyakoff and Eric Blake. EOT -test-version-etc${EXEEXT} --version | +${CHECKER} test-version-etc${EXEEXT} --version | sed '1s/test-version-etc (.*) .*/test-version-etc (PROJECT) VERSION/ /^Packaged by/d 2,3 s/Copyright (C) [0-9]\{4,4\}/COPYRIGHT/' | diff --git a/gnulib-tests/test-wchar.c b/gnulib-tests/test-wchar.c index ac1b508..7069b60 100644 --- a/gnulib-tests/test-wchar.c +++ b/gnulib-tests/test-wchar.c @@ -1,5 +1,5 @@ /* Test of <wchar.h> substitute. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-wcrtomb-w32-1.sh b/gnulib-tests/test-wcrtomb-w32-1.sh index 50c82f5..b01c543 100755 --- a/gnulib-tests/test-wcrtomb-w32-1.sh +++ b/gnulib-tests/test-wcrtomb-w32-1.sh @@ -1,4 +1,4 @@ #!/bin/sh # Test a CP1252 locale. -./test-wcrtomb-w32${EXEEXT} French_France 1252 +${CHECKER} ./test-wcrtomb-w32${EXEEXT} French_France 1252 diff --git a/gnulib-tests/test-wcrtomb-w32-2.sh b/gnulib-tests/test-wcrtomb-w32-2.sh index 783c70c..5481634 100755 --- a/gnulib-tests/test-wcrtomb-w32-2.sh +++ b/gnulib-tests/test-wcrtomb-w32-2.sh @@ -1,4 +1,4 @@ #!/bin/sh # Test a CP1256 locale. -./test-wcrtomb-w32${EXEEXT} "Arabic_Saudi Arabia" 1256 +${CHECKER} ./test-wcrtomb-w32${EXEEXT} "Arabic_Saudi Arabia" 1256 diff --git a/gnulib-tests/test-wcrtomb-w32-3.sh b/gnulib-tests/test-wcrtomb-w32-3.sh index 619ea64..f35879d 100755 --- a/gnulib-tests/test-wcrtomb-w32-3.sh +++ b/gnulib-tests/test-wcrtomb-w32-3.sh @@ -1,4 +1,4 @@ #!/bin/sh # Test a CP932 locale. -./test-wcrtomb-w32${EXEEXT} Japanese_Japan 932 +${CHECKER} ./test-wcrtomb-w32${EXEEXT} Japanese_Japan 932 diff --git a/gnulib-tests/test-wcrtomb-w32-4.sh b/gnulib-tests/test-wcrtomb-w32-4.sh index 67b6803..8eec6cb 100755 --- a/gnulib-tests/test-wcrtomb-w32-4.sh +++ b/gnulib-tests/test-wcrtomb-w32-4.sh @@ -1,4 +1,4 @@ #!/bin/sh # Test a CP950 locale. -./test-wcrtomb-w32${EXEEXT} Chinese_Taiwan 950 +${CHECKER} ./test-wcrtomb-w32${EXEEXT} Chinese_Taiwan 950 diff --git a/gnulib-tests/test-wcrtomb-w32-5.sh b/gnulib-tests/test-wcrtomb-w32-5.sh index 9841fa9..fd47d6f 100755 --- a/gnulib-tests/test-wcrtomb-w32-5.sh +++ b/gnulib-tests/test-wcrtomb-w32-5.sh @@ -1,4 +1,4 @@ #!/bin/sh # Test a CP936 locale. -./test-wcrtomb-w32${EXEEXT} Chinese_China 936 +${CHECKER} ./test-wcrtomb-w32${EXEEXT} Chinese_China 936 diff --git a/gnulib-tests/test-wcrtomb-w32-6.sh b/gnulib-tests/test-wcrtomb-w32-6.sh new file mode 100755 index 0000000..802237d --- /dev/null +++ b/gnulib-tests/test-wcrtomb-w32-6.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test a GB18030 locale. +${CHECKER} ./test-wcrtomb-w32${EXEEXT} Chinese_China 54936 diff --git a/gnulib-tests/test-wcrtomb-w32-7.sh b/gnulib-tests/test-wcrtomb-w32-7.sh new file mode 100755 index 0000000..fb04e58 --- /dev/null +++ b/gnulib-tests/test-wcrtomb-w32-7.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Test some UTF-8 locales. +${CHECKER} ./test-wcrtomb-w32${EXEEXT} French_France Japanese_Japan Chinese_Taiwan Chinese_China 65001 diff --git a/gnulib-tests/test-wcrtomb-w32.c b/gnulib-tests/test-wcrtomb-w32.c index 19770d1..0f02ed2 100644 --- a/gnulib-tests/test-wcrtomb-w32.c +++ b/gnulib-tests/test-wcrtomb-w32.c @@ -1,5 +1,5 @@ /* Test of conversion of wide character to multibyte character. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 @@ -23,6 +23,7 @@ #include <stdlib.h> #include <string.h> +#include "localcharset.h" #include "macros.h" #if defined _WIN32 && !defined __CYGWIN__ @@ -257,6 +258,8 @@ test_one_locale (const char *name, int codepage) case 54936: /* Locale encoding is CP54936 = GB18030. */ + if (strcmp (locale_charset (), "GB18030") != 0) + return 77; { /* Convert "B\250\271\201\060\211\070er": "Büßer" */ memset (buf, 'x', 8); @@ -275,6 +278,8 @@ test_one_locale (const char *name, int codepage) case 65001: /* Locale encoding is CP65001 = UTF-8. */ + if (strcmp (locale_charset (), "UTF-8") != 0) + return 77; { /* Convert "B\303\274\303\237er": "Büßer" */ memset (buf, 'x', 8); diff --git a/gnulib-tests/test-wcrtomb.c b/gnulib-tests/test-wcrtomb.c index 3c53fcb..3924d59 100644 --- a/gnulib-tests/test-wcrtomb.c +++ b/gnulib-tests/test-wcrtomb.c @@ -1,5 +1,5 @@ /* Test of conversion of wide character to multibyte character. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 @@ -156,6 +156,10 @@ main (int argc, char *argv[]) check_character (input + 3, 4); } return 0; + + case '5': + /* C locale; tested above. */ + return 0; } return 1; diff --git a/gnulib-tests/test-wcrtomb.sh b/gnulib-tests/test-wcrtomb.sh index 3eda8f3..1a31b6e 100755 --- a/gnulib-tests/test-wcrtomb.sh +++ b/gnulib-tests/test-wcrtomb.sh @@ -4,7 +4,7 @@ : ${LOCALE_FR=fr_FR} if test $LOCALE_FR != none; then LC_ALL=$LOCALE_FR \ - ./test-wcrtomb${EXEEXT} 1 \ + ${CHECKER} ./test-wcrtomb${EXEEXT} 1 \ || exit 1 fi @@ -12,7 +12,7 @@ fi : ${LOCALE_FR_UTF8=fr_FR.UTF-8} if test $LOCALE_FR_UTF8 != none; then LC_ALL=$LOCALE_FR_UTF8 \ - ./test-wcrtomb${EXEEXT} 2 \ + ${CHECKER} ./test-wcrtomb${EXEEXT} 2 \ || exit 1 fi @@ -20,7 +20,7 @@ fi : ${LOCALE_JA=ja_JP} if test $LOCALE_JA != none; then LC_ALL=$LOCALE_JA \ - ./test-wcrtomb${EXEEXT} 3 \ + ${CHECKER} ./test-wcrtomb${EXEEXT} 3 \ || exit 1 fi @@ -28,8 +28,12 @@ fi : ${LOCALE_ZH_CN=zh_CN.GB18030} if test $LOCALE_ZH_CN != none; then LC_ALL=$LOCALE_ZH_CN \ - ./test-wcrtomb${EXEEXT} 4 \ + ${CHECKER} ./test-wcrtomb${EXEEXT} 4 \ || exit 1 fi +# Test in the POSIX locale. +LC_ALL=C ${CHECKER} ./test-wcrtomb${EXEEXT} 5 || exit 1 +LC_ALL=POSIX ${CHECKER} ./test-wcrtomb${EXEEXT} 5 || exit 1 + exit 0 diff --git a/gnulib-tests/test-wctype-h.c b/gnulib-tests/test-wctype-h.c index 673cdc3..e1c4e23 100644 --- a/gnulib-tests/test-wctype-h.c +++ b/gnulib-tests/test-wctype-h.c @@ -1,5 +1,5 @@ /* Test of <wctype.h> substitute. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-xalloc-die.c b/gnulib-tests/test-xalloc-die.c index 28c3bf7..7f0069e 100644 --- a/gnulib-tests/test-xalloc-die.c +++ b/gnulib-tests/test-xalloc-die.c @@ -1,5 +1,5 @@ /* Test of xalloc_die() function. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/test-xalloc-die.sh b/gnulib-tests/test-xalloc-die.sh index 8596cd1..033084b 100755 --- a/gnulib-tests/test-xalloc-die.sh +++ b/gnulib-tests/test-xalloc-die.sh @@ -1,6 +1,6 @@ #!/bin/sh # Test suite for xalloc_die. -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2020 Free Software Foundation, Inc. # This file is part of the GNUlib Library. # # This program is free software: you can redistribute it and/or modify @@ -18,7 +18,7 @@ . "${srcdir=.}/init.sh"; path_prepend_ . -test-xalloc-die${EXEEXT} > out 2> err +${CHECKER} test-xalloc-die${EXEEXT} > out 2> err case $? in 1) ;; *) Exit 1;; diff --git a/gnulib-tests/unsetenv.c b/gnulib-tests/unsetenv.c index 82c6c06..766df35 100644 --- a/gnulib-tests/unsetenv.c +++ b/gnulib-tests/unsetenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995-2002, 2005-2018 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995-2002, 2005-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/gnulib-tests/unused-parameter.h b/gnulib-tests/unused-parameter.h index 40a0ff8..f5cf21e 100644 --- a/gnulib-tests/unused-parameter.h +++ b/gnulib-tests/unused-parameter.h @@ -1,5 +1,5 @@ /* A C macro for declaring that specific function parameters are not used. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/gnulib-tests/w32sock.h b/gnulib-tests/w32sock.h index 1e5e584..9c23c9d 100644 --- a/gnulib-tests/w32sock.h +++ b/gnulib-tests/w32sock.h @@ -1,6 +1,6 @@ /* w32sock.h --- internal auxiliary functions for Windows socket functions - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. 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 diff --git a/gnulib-tests/warn-on-use.h b/gnulib-tests/warn-on-use.h index 72d67cc..1be2cbb 100644 --- a/gnulib-tests/warn-on-use.h +++ b/gnulib-tests/warn-on-use.h @@ -1,5 +1,5 @@ /* A C macro for emitting warnings if a function is used. - Copyright (C) 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2010-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/gnulib-tests/windows-thread.c b/gnulib-tests/windows-thread.c new file mode 100644 index 0000000..1fc02a0 --- /dev/null +++ b/gnulib-tests/windows-thread.c @@ -0,0 +1,243 @@ +/* Creating and controlling threads (native Windows implementation). + Copyright (C) 2005-2020 Free Software Foundation, Inc. + + 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 3, 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2005. + Based on GCC's gthr-win32.h. */ + +#include <config.h> + +/* Specification. */ +#include "windows-thread.h" + +#include <errno.h> +#include <process.h> +#include <stdlib.h> + +#include "windows-once.h" +#include "windows-tls.h" + +/* The Thread-Local Storage (TLS) key that allows to access each thread's + 'struct glwthread_thread_struct *' pointer. */ +static DWORD self_key = (DWORD)-1; + +/* Initializes self_key. This function must only be called once. */ +static void +do_init_self_key (void) +{ + self_key = TlsAlloc (); + /* If this fails, we're hosed. */ + if (self_key == (DWORD)-1) + abort (); +} + +/* Initializes self_key. */ +static void +init_self_key (void) +{ + static glwthread_once_t once = GLWTHREAD_ONCE_INIT; + glwthread_once (&once, do_init_self_key); +} + +/* This structure contains information about a thread. + It is stored in TLS under key self_key. */ +struct glwthread_thread_struct +{ + /* Fields for managing the handle. */ + HANDLE volatile handle; + CRITICAL_SECTION handle_lock; + /* Fields for managing the exit value. */ + BOOL volatile detached; + void * volatile result; + /* Fields for managing the thread start. */ + void * (*func) (void *); + void *arg; +}; + +/* Return a real HANDLE object for the current thread. */ +static HANDLE +get_current_thread_handle (void) +{ + HANDLE this_handle; + + /* GetCurrentThread() returns a pseudo-handle, i.e. only a symbolic + identifier, not a real handle. */ + if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), + GetCurrentProcess (), &this_handle, + 0, FALSE, DUPLICATE_SAME_ACCESS)) + abort (); + return this_handle; +} + +glwthread_thread_t +glwthread_thread_self (void) +{ + glwthread_thread_t thread; + + if (self_key == (DWORD)-1) + init_self_key (); + thread = TlsGetValue (self_key); + if (thread == NULL) + { + /* This happens only in threads that have not been created through + glthread_create(), such as the main thread. */ + for (;;) + { + thread = + (struct glwthread_thread_struct *) + malloc (sizeof (struct glwthread_thread_struct)); + if (thread != NULL) + break; + /* Memory allocation failed. There is not much we can do. Have to + busy-loop, waiting for the availability of memory. */ + Sleep (1); + } + + thread->handle = get_current_thread_handle (); + InitializeCriticalSection (&thread->handle_lock); + thread->detached = FALSE; /* This can lead to a memory leak. */ + thread->result = NULL; /* just to be deterministic */ + TlsSetValue (self_key, thread); + } + return thread; +} + +/* The main function of a freshly creating thread. It's a wrapper around + the FUNC and ARG arguments passed to glthread_create_func. */ +static unsigned int WINAPI +wrapper_func (void *varg) +{ + struct glwthread_thread_struct *thread = + (struct glwthread_thread_struct *) varg; + + EnterCriticalSection (&thread->handle_lock); + /* Create a new handle for the thread only if the parent thread did not yet + fill in the handle. */ + if (thread->handle == NULL) + thread->handle = get_current_thread_handle (); + LeaveCriticalSection (&thread->handle_lock); + + if (self_key == (DWORD)-1) + init_self_key (); + TlsSetValue (self_key, thread); + + /* Run the thread. Store the exit value if the thread was not terminated + otherwise. */ + thread->result = thread->func (thread->arg); + + /* Process the TLS destructors. */ + glwthread_tls_process_destructors (); + + if (thread->detached) + { + /* Clean up the thread, like thrd_join would do. */ + DeleteCriticalSection (&thread->handle_lock); + CloseHandle (thread->handle); + free (thread); + } + + return 0; +} + +int +glwthread_thread_create (glwthread_thread_t *threadp, unsigned int attr, + void * (*func) (void *), void *arg) +{ + struct glwthread_thread_struct *thread = + (struct glwthread_thread_struct *) + malloc (sizeof (struct glwthread_thread_struct)); + if (thread == NULL) + return ENOMEM; + thread->handle = NULL; + InitializeCriticalSection (&thread->handle_lock); + thread->detached = (attr & GLWTHREAD_ATTR_DETACHED ? TRUE : FALSE); + thread->result = NULL; /* just to be deterministic */ + thread->func = func; + thread->arg = arg; + + { + unsigned int thread_id; + HANDLE thread_handle; + + thread_handle = (HANDLE) + _beginthreadex (NULL, 100000, wrapper_func, thread, 0, &thread_id); + /* calls CreateThread with the same arguments */ + if (thread_handle == NULL) + { + DeleteCriticalSection (&thread->handle_lock); + free (thread); + return EAGAIN; + } + + EnterCriticalSection (&thread->handle_lock); + if (thread->handle == NULL) + thread->handle = thread_handle; + else + /* thread->handle was already set by the thread itself. */ + CloseHandle (thread_handle); + LeaveCriticalSection (&thread->handle_lock); + + *threadp = thread; + return 0; + } +} + +int +glwthread_thread_join (glwthread_thread_t thread, void **retvalp) +{ + if (thread == NULL) + return EINVAL; + + if (thread == glwthread_thread_self ()) + return EDEADLK; + + if (thread->detached) + return EINVAL; + + if (WaitForSingleObject (thread->handle, INFINITE) == WAIT_FAILED) + return EINVAL; + + if (retvalp != NULL) + *retvalp = thread->result; + + DeleteCriticalSection (&thread->handle_lock); + CloseHandle (thread->handle); + free (thread); + + return 0; +} + +int +glwthread_thread_detach (glwthread_thread_t thread) +{ + if (thread == NULL) + return EINVAL; + + if (thread->detached) + return EINVAL; + + thread->detached = TRUE; + return 0; +} + +int +glwthread_thread_exit (void *retval) +{ + glwthread_thread_t thread = glwthread_thread_self (); + thread->result = retval; + glwthread_tls_process_destructors (); + _endthreadex (0); /* calls ExitThread (0) */ + abort (); +} diff --git a/gnulib-tests/windows-thread.h b/gnulib-tests/windows-thread.h new file mode 100644 index 0000000..0a9714c --- /dev/null +++ b/gnulib-tests/windows-thread.h @@ -0,0 +1,55 @@ +/* Creating and controlling threads (native Windows implementation). + Copyright (C) 2005-2020 Free Software Foundation, Inc. + + 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 3, 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2005. + Based on GCC's gthr-win32.h. */ + +#ifndef _WINDOWS_THREAD_H +#define _WINDOWS_THREAD_H + +#define WIN32_LEAN_AND_MEAN /* avoid including junk */ +#include <windows.h> + +/* The glwthread_thread_t is a pointer to a structure in memory. + Why not the thread handle? If it were the thread handle, it would be hard + to implement glwthread_thread_self() (since GetCurrentThread () returns a + pseudo-handle, DuplicateHandle (GetCurrentThread ()) returns a handle that + must be closed afterwards, and there is no function for quickly retrieving + a thread handle from its id). + Why not the thread id? I tried it. It did not work: Sometimes ids appeared + that did not belong to running threads, and glthread_join failed with ESRCH. + */ +typedef struct glwthread_thread_struct *glwthread_thread_t; + +#ifdef __cplusplus +extern "C" { +#endif + +/* attr is a bit mask, consisting of the following bits: */ +#define GLWTHREAD_ATTR_DETACHED 1 +extern int glwthread_thread_create (glwthread_thread_t *threadp, + unsigned int attr, + void * (*func) (void *), void *arg); +extern int glwthread_thread_join (glwthread_thread_t thread, void **retvalp); +extern int glwthread_thread_detach (glwthread_thread_t thread); +extern glwthread_thread_t glwthread_thread_self (void); +extern int glwthread_thread_exit (void *retval); + +#ifdef __cplusplus +} +#endif + +#endif /* _WINDOWS_THREAD_H */ diff --git a/gnulib-tests/windows-tls.c b/gnulib-tests/windows-tls.c new file mode 100644 index 0000000..d52515c --- /dev/null +++ b/gnulib-tests/windows-tls.c @@ -0,0 +1,339 @@ +/* Thread-local storage (native Windows implementation). + Copyright (C) 2005-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2005. */ + +#include <config.h> + +/* Specification. */ +#include "windows-tls.h" + +#include <errno.h> +#include <limits.h> +#include <stdlib.h> + +#include "windows-once.h" + +void * +glwthread_tls_get (glwthread_tls_key_t key) +{ + return TlsGetValue (key); +} + +int +glwthread_tls_set (glwthread_tls_key_t key, void *value) +{ + if (!TlsSetValue (key, value)) + return EINVAL; + return 0; +} + +/* The following variables keep track of TLS keys with non-NULL destructor. */ + +static glwthread_once_t dtor_table_init_once = GLWTHREAD_ONCE_INIT; + +static CRITICAL_SECTION dtor_table_lock; + +struct dtor { glwthread_tls_key_t key; void (*destructor) (void *); }; + +/* The table of dtors. */ +static struct dtor *dtor_table; +/* Number of active entries in the dtor_table. */ +static unsigned int dtors_count; +/* Valid indices into dtor_table are 0..dtors_used-1. */ +static unsigned int dtors_used; +/* Allocation size of dtor_table. */ +static unsigned int dtors_allocated; +/* Invariant: 0 <= dtors_count <= dtors_used <= dtors_allocated. */ + +/* Number of threads that are currently processing destructors. */ +static unsigned int dtor_processing_threads; + +static void +dtor_table_initialize (void) +{ + InitializeCriticalSection (&dtor_table_lock); + /* The other variables are already initialized to NULL or 0, respectively. */ +} + +static void +dtor_table_ensure_initialized (void) +{ + glwthread_once (&dtor_table_init_once, dtor_table_initialize); +} + +/* Shrinks dtors_used down to dtors_count, by replacing inactive entries + with active ones. */ +static void +dtor_table_shrink_used (void) +{ + unsigned int i = 0; + unsigned int j = dtors_used; + + for (;;) + { + BOOL i_found = FALSE; + BOOL j_found = FALSE; + /* Find the next inactive entry, from the left. */ + for (; i < dtors_count;) + { + if (dtor_table[i].destructor == NULL) + { + i_found = TRUE; + break; + } + i++; + } + + /* Find the next active entry, from the right. */ + for (; j > dtors_count;) + { + j--; + if (dtor_table[j].destructor != NULL) + { + j_found = TRUE; + break; + } + } + + if (i_found != j_found) + /* dtors_count was apparently wrong. */ + abort (); + + if (!i_found) + break; + + /* i_found and j_found are TRUE. Swap the two entries. */ + dtor_table[i] = dtor_table[j]; + + i++; + } + + dtors_used = dtors_count; +} + +void +glwthread_tls_process_destructors (void) +{ + unsigned int repeat; + + dtor_table_ensure_initialized (); + + EnterCriticalSection (&dtor_table_lock); + if (dtor_processing_threads == 0) + { + /* Now it's the appropriate time for shrinking dtors_used. */ + if (dtors_used > dtors_count) + dtor_table_shrink_used (); + } + dtor_processing_threads++; + + for (repeat = GLWTHREAD_DESTRUCTOR_ITERATIONS; repeat > 0; repeat--) + { + unsigned int destructors_run = 0; + + /* Iterate across dtor_table. We don't need to make a copy of dtor_table, + because + * When another thread calls glwthread_tls_key_create with a non-NULL + destructor argument, this will possibly reallocate the dtor_table + array and increase dtors_allocated as well as dtors_used and + dtors_count, but it will not change dtors_used nor the contents of + the first dtors_used entries of dtor_table. + * When another thread calls glwthread_tls_key_delete, this will + possibly set some 'destructor' member to NULL, thus marking an + entry as inactive, but it will not otherwise change dtors_used nor + the contents of the first dtors_used entries of dtor_table. */ + unsigned int i_limit = dtors_used; + unsigned int i; + + for (i = 0; i < i_limit; i++) + { + struct dtor current = dtor_table[i]; + if (current.destructor != NULL) + { + /* The current dtor has not been deleted yet. */ + void *current_value = glwthread_tls_get (current.key); + if (current_value != NULL) + { + /* The current value is non-NULL. Run the destructor. */ + glwthread_tls_set (current.key, NULL); + LeaveCriticalSection (&dtor_table_lock); + current.destructor (current_value); + EnterCriticalSection (&dtor_table_lock); + destructors_run++; + } + } + } + + /* When all TLS values were already NULL, no further iterations are + needed. */ + if (destructors_run == 0) + break; + } + + dtor_processing_threads--; + LeaveCriticalSection (&dtor_table_lock); +} + +int +glwthread_tls_key_create (glwthread_tls_key_t *keyp, void (*destructor) (void *)) +{ + if (destructor != NULL) + { + dtor_table_ensure_initialized (); + + EnterCriticalSection (&dtor_table_lock); + if (dtor_processing_threads == 0) + { + /* Now it's the appropriate time for shrinking dtors_used. */ + if (dtors_used > dtors_count) + dtor_table_shrink_used (); + } + + while (dtors_used == dtors_allocated) + { + /* Need to grow the dtor_table. */ + unsigned int new_allocated = 2 * dtors_allocated + 1; + if (new_allocated < 7) + new_allocated = 7; + if (new_allocated <= dtors_allocated) /* overflow? */ + new_allocated = UINT_MAX; + + LeaveCriticalSection (&dtor_table_lock); + { + struct dtor *new_table = + (struct dtor *) malloc (new_allocated * sizeof (struct dtor)); + if (new_table == NULL) + return ENOMEM; + EnterCriticalSection (&dtor_table_lock); + /* Attention! dtors_used, dtors_allocated may have changed! */ + if (dtors_used < new_allocated) + { + if (dtors_allocated < new_allocated) + { + /* The new_table is useful. */ + memcpy (new_table, dtor_table, + dtors_used * sizeof (struct dtor)); + dtor_table = new_table; + dtors_allocated = new_allocated; + } + else + { + /* The new_table is not useful, since another thread + meanwhile allocated a drop_table that is at least + as large. */ + free (new_table); + } + break; + } + /* The new_table is not useful, since other threads increased + dtors_used. Free it any retry. */ + free (new_table); + } + } + /* Here dtors_used < dtors_allocated. */ + { + /* Allocate a new key. */ + glwthread_tls_key_t key = TlsAlloc (); + if (key == (DWORD)-1) + { + LeaveCriticalSection (&dtor_table_lock); + return EAGAIN; + } + /* Store the new dtor in the dtor_table, after all used entries. + Do not overwrite inactive entries with indices < dtors_used, in order + not to disturb glwthread_tls_process_destructors invocations that may + be executing in other threads. */ + dtor_table[dtors_used].key = key; + dtor_table[dtors_used].destructor = destructor; + dtors_used++; + dtors_count++; + LeaveCriticalSection (&dtor_table_lock); + *keyp = key; + } + } + else + { + /* Allocate a new key. */ + glwthread_tls_key_t key = TlsAlloc (); + if (key == (DWORD)-1) + return EAGAIN; + *keyp = key; + } + return 0; +} + +int +glwthread_tls_key_delete (glwthread_tls_key_t key) +{ + /* Should the destructor be called for all threads that are currently running? + Probably not, because + - ISO C does not specify when the destructor is to be invoked at all. + - In POSIX, the destructor functions specified with pthread_key_create() + are invoked at thread exit. + - It would be hard to implement, because there are no primitives for + accessing thread-specific values from a different thread. */ + dtor_table_ensure_initialized (); + + EnterCriticalSection (&dtor_table_lock); + if (dtor_processing_threads == 0) + { + /* Now it's the appropriate time for shrinking dtors_used. */ + if (dtors_used > dtors_count) + dtor_table_shrink_used (); + /* Here dtors_used == dtors_count. */ + + /* Find the key in dtor_table. */ + { + unsigned int i_limit = dtors_used; + unsigned int i; + + for (i = 0; i < i_limit; i++) + if (dtor_table[i].key == key) + { + if (i < dtors_used - 1) + /* Swap the entries i and dtors_used - 1. */ + dtor_table[i] = dtor_table[dtors_used - 1]; + dtors_count = dtors_used = dtors_used - 1; + break; + } + } + } + else + { + /* Be careful not to disturb the glwthread_tls_process_destructors + invocations that are executing in other threads. */ + unsigned int i_limit = dtors_used; + unsigned int i; + + for (i = 0; i < i_limit; i++) + if (dtor_table[i].destructor != NULL /* skip inactive entries */ + && dtor_table[i].key == key) + { + /* Mark this entry as inactive. */ + dtor_table[i].destructor = NULL; + dtors_count = dtors_count - 1; + break; + } + } + LeaveCriticalSection (&dtor_table_lock); + /* Now we have ensured that glwthread_tls_process_destructors will no longer + use this key. */ + + if (!TlsFree (key)) + return EINVAL; + return 0; +} diff --git a/gnulib-tests/windows-tls.h b/gnulib-tests/windows-tls.h new file mode 100644 index 0000000..2b39fab --- /dev/null +++ b/gnulib-tests/windows-tls.h @@ -0,0 +1,42 @@ +/* Thread-local storage (native Windows implementation). + Copyright (C) 2005-2020 Free Software Foundation, Inc. + + 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 3 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, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2005. */ + +#ifndef _WINDOWS_TLS_H +#define _WINDOWS_TLS_H + +#define WIN32_LEAN_AND_MEAN /* avoid including junk */ +#include <windows.h> + +typedef DWORD glwthread_tls_key_t; + +#ifdef __cplusplus +extern "C" { +#endif + +extern int glwthread_tls_key_create (glwthread_tls_key_t *keyp, void (*destructor) (void *)); +extern void *glwthread_tls_get (glwthread_tls_key_t key); +extern int glwthread_tls_set (glwthread_tls_key_t key, void *value); +extern int glwthread_tls_key_delete (glwthread_tls_key_t key); +extern void glwthread_tls_process_destructors (void); +#define GLWTHREAD_DESTRUCTOR_ITERATIONS 4 + +#ifdef __cplusplus +} +#endif + +#endif /* _WINDOWS_TLS_H */ diff --git a/gnulib-tests/zerosize-ptr.h b/gnulib-tests/zerosize-ptr.h index d5592c5..4a5d267 100644 --- a/gnulib-tests/zerosize-ptr.h +++ b/gnulib-tests/zerosize-ptr.h @@ -1,5 +1,5 @@ /* Return a pointer to a zero-size object in memory. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. 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 |