]> Savannah Git Hosting - gnulib.git/log
gnulib.git
5 years agoparse-datetime: Require Bison 2.4 or newer.
Bruno Haible [Fri, 19 Jul 2019 03:00:10 +0000 (05:00 +0200)]
parse-datetime: Require Bison 2.4 or newer.

* m4/parse-datetime.m4 (gl_PARSE_DATETIME): Set PARSE_DATETIME_BISON.
Code taken from gettext's intl.m4.
* modules/parse-datetime (Makefile.am): Use PARSE_DATETIME_BISON instead
of YACC.

5 years agoareadlink-with-size, xgethostname, xgetdomainname: Fix GCC warning.
Bruno Haible [Fri, 19 Jul 2019 03:21:11 +0000 (05:21 +0200)]
areadlink-with-size, xgethostname, xgetdomainname: Fix GCC warning.

* lib/areadlink-with-size.c: Include <string.h>.
* lib/areadlinkat-with-size.c: Likewise.
* lib/xgethostname.c: Likewise.
* lib/xgetdomainname.c: Likewise.

5 years agoparse-datetime: avoid "%pure-parser" deprecation warning from Bison 3.4
Bernhard Voelker [Thu, 18 Jul 2019 23:17:25 +0000 (01:17 +0200)]
parse-datetime: avoid "%pure-parser" deprecation warning from Bison 3.4

* lib/parse-datetime.y: Use "%define api.pure" rather than obsolescent
"%pure-parser".  The former is available since Bison 2.3b (2008, [1]),
while the latter is marked as obsolete since version 3.4 (May 2019, [2]):

  ./lib/parse-datetime.y:568.1-12: warning: deprecated directive, \
    use '%define api.pure' [-Wdeprecated]
  568 | %pure-parser
      | ^~~~~~~~~~~~

[1] https://git.sv.gnu.org/cgit/bison.git/commit/?id=d9df47b656fd
[2] https://git.sv.gnu.org/cgit/bison.git/commit/?id=de5207244b5c

5 years agoupdate-copyright: Make it work again (regression from 2019-06-15).
Bruno Haible [Tue, 16 Jul 2019 08:02:30 +0000 (10:02 +0200)]
update-copyright: Make it work again (regression from 2019-06-15).

Reported by Brian C. Lane <bcl@redhat.com>.

* build-aux/update-copyright: Add back the -0777, -p, -i options.

5 years agodoc: Update info about <pthread.h>.
Bruno Haible [Mon, 15 Jul 2019 01:10:38 +0000 (03:10 +0200)]
doc: Update info about <pthread.h>.

* doc/posix-headers/pthread.texi: Mention the module 'pthread-h' instead
of 'pthread'.

5 years agopthread_sigmask tests: Use new multithread modules.
Bruno Haible [Mon, 15 Jul 2019 00:41:24 +0000 (02:41 +0200)]
pthread_sigmask tests: Use new multithread modules.

* tests/test-pthread_sigmask2.c: Include <pthread.h> instead of
glthread/thread.h.
(main_thread, killer_thread): Change type to pthread_t.
(main): Update accordingly.
* modules/pthread_sigmask-tests (Depends-on): Add pthread-thread. Remove
thread.

5 years agopthread-tss: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:41:21 +0000 (02:41 +0200)]
pthread-tss: Add tests.

* tests/test-pthread-tss.c: New file, based on tests/test-tls.c and
tests/test-tss.c.
* modules/pthread-tss-tests: New file.

5 years agopthread-cond: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:41:18 +0000 (02:41 +0200)]
pthread-cond: Add tests.

* tests/test-pthread-cond.c: New file, based on tests/test-cond.c and
tests/test-cnd.c.
* modules/pthread-cond-tests: New file.

5 years agopthread-rwlock: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:41:14 +0000 (02:41 +0200)]
pthread-rwlock: Add tests.

* tests/test-pthread-rwlock.c: New file, based on tests/test-lock.c.
* modules/pthread-rwlock-tests: New file.

5 years agopthread-mutex: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:41:12 +0000 (02:41 +0200)]
pthread-mutex: Add tests.

* tests/test-pthread-mutex.c: New file, based on tests/test-lock.c and
tests/test-mtx.c.
* modules/pthread-mutex-tests: New file.

5 years agopthread-once: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:41:09 +0000 (02:41 +0200)]
pthread-once: Add tests.

* tests/test-pthread-once1.c: New file, based on tests/test-once.c and
tests/test-call_once.c.
* tests/test-pthread-once2.c: New file, based on tests/test-lock.c and
tests/test-mtx.c.
* modules/pthread-once-tests: New file.

5 years agopthread-thread: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:41:07 +0000 (02:41 +0200)]
pthread-thread: Add tests.

* tests/test-pthread-thread.c: New file, based on
tests/test-thread_create.c and tests/test-thrd_create.c.
* modules/pthread-thread-tests: New file.

5 years agopthread: Turn into a convenience module.
Bruno Haible [Mon, 15 Jul 2019 00:41:05 +0000 (02:41 +0200)]
pthread: Turn into a convenience module.

* lib/pthread.in.h: Remove declarations for extern inline functions.
* lib/pthread.c: Remove file.
* modules/pthread (Files): Remove it.
(Depends-on): Add pthread-thread, pthread-once, pthread-mutex,
pthread-rwlock, pthread-cond, pthread-tss, pthread-spin.
(configure.ac): Don't compile lib/pthread.c. Don't set GNULIB_PTHREAD.
* m4/pthread_h.m4 (gl_PTHREAD_H_DEFAULTS): Don't initialize
GNULIB_PTHREAD.
* modules/pthread-h (Makefile.am): Don't substitute GNULIB_PTHREAD.

5 years agopthread-spin: New module.
Bruno Haible [Mon, 15 Jul 2019 00:41:02 +0000 (02:41 +0200)]
pthread-spin: New module.

* lib/pthread.in.h (pthread_spin_init, pthread_spin_destroy,
pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock): Remove
inline definitions.
* lib/pthread-spin.c: New file.
* m4/pthread-spin.m4: New file.
* modules/pthread-spin: New file.
* doc/posix-functions/pthread_spin_init.texi: Mention the new module.
* doc/posix-functions/pthread_spin_lock.texi: Likewise.
* doc/posix-functions/pthread_spin_trylock.texi: Likewise.
* doc/posix-functions/pthread_spin_unlock.texi: Likewise.
* doc/posix-functions/pthread_spin_destroy.texi: Likewise.

5 years agopthread-tss: New module.
Bruno Haible [Mon, 15 Jul 2019 00:41:00 +0000 (02:41 +0200)]
pthread-tss: New module.

* lib/pthread-tss.c: New file.
* m4/pthread-tss.m4: New file.
* modules/pthread-tss: New file.
* doc/posix-functions/pthread_key_create.texi: Mention the new module.
* doc/posix-functions/pthread_setspecific.texi: Likewise.
* doc/posix-functions/pthread_getspecific.texi: Likewise.
* doc/posix-functions/pthread_key_delete.texi: Likewise.

5 years agopthread-cond: New module.
Bruno Haible [Mon, 15 Jul 2019 00:40:57 +0000 (02:40 +0200)]
pthread-cond: New module.

* lib/pthread.in.h (pthread_cond_destroy, pthread_cond_init,
pthread_cond_signal, pthread_cond_wait): Remove inline definitions.
* lib/pthread-cond.c: New file.
* m4/pthread-cond.m4: New file.
* modules/pthread-cond: New file.
* doc/posix-functions/pthread_cond_init.texi: Mention the new module.
* doc/posix-functions/pthread_condattr_init.texi: Likewise.
* doc/posix-functions/pthread_condattr_destroy.texi: Likewise.
* doc/posix-functions/pthread_cond_wait.texi: Likewise.
* doc/posix-functions/pthread_cond_timedwait.texi: Likewise.
* doc/posix-functions/pthread_cond_signal.texi: Likewise.
* doc/posix-functions/pthread_cond_broadcast.texi: Likewise.
* doc/posix-functions/pthread_cond_destroy.texi: Likewise.

5 years agopthread-rwlock: New module.
Bruno Haible [Mon, 15 Jul 2019 00:37:47 +0000 (02:37 +0200)]
pthread-rwlock: New module.

* lib/pthread-rwlock.c: New file, based on lib/glthread/lock.c.
* m4/pthread-rwlock.m4: New file.
* modules/pthread-rwlock: New file.
* doc/posix-functions/pthread_rwlock_init.texi: Mention the new module
and the Android problem.
* doc/posix-functions/pthread_rwlockattr_init.texi: Likewise.
* doc/posix-functions/pthread_rwlockattr_destroy.texi: Likewise.
* doc/posix-functions/pthread_rwlock_rdlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_wrlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_tryrdlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_trywrlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_timedrdlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_timedwrlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_unlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_destroy.texi: Likewise.

5 years agopthread-mutex: New module.
Bruno Haible [Mon, 15 Jul 2019 00:37:44 +0000 (02:37 +0200)]
pthread-mutex: New module.

* lib/pthread.in.h (pthread_mutexattr_destroy, pthread_mutexattr_init,
pthread_mutexattr_settype, pthread_mutex_destroy, pthread_mutex_init,
pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_timedlock,
pthread_mutex_unlock): Remove inline definitions.
* lib/pthread-mutex.c: New file.
* m4/pthread-mutex.m4: New file.
* modules/pthread-mutex: New file.
* doc/posix-functions/pthread_mutex_init.texi: Mention the new module.
* doc/posix-functions/pthread_mutexattr_init.texi: Likewise.
* doc/posix-functions/pthread_mutexattr_gettype.texi: Likewise.
* doc/posix-functions/pthread_mutexattr_settype.texi: Likewise.
* doc/posix-functions/pthread_mutexattr_getrobust.texi: Likewise.
* doc/posix-functions/pthread_mutexattr_setrobust.texi: Likewise.
* doc/posix-functions/pthread_mutexattr_destroy.texi: Likewise.
* doc/posix-functions/pthread_mutex_lock.texi: Likewise.
* doc/posix-functions/pthread_mutex_trylock.texi: Likewise.
* doc/posix-functions/pthread_mutex_timedlock.texi: Likewise.
* doc/posix-functions/pthread_mutex_unlock.texi: Likewise.
* doc/posix-functions/pthread_mutex_destroy.texi: Likewise.

5 years agopthread-once: New module.
Bruno Haible [Mon, 15 Jul 2019 00:37:41 +0000 (02:37 +0200)]
pthread-once: New module.

* lib/pthread-once.c: New file.
* m4/pthread-once.m4: New file.
* modules/pthread-once: New file.
* doc/posix-functions/pthread_once.texi: Mention the new module.

5 years agopthread-thread: New module.
Bruno Haible [Mon, 15 Jul 2019 00:37:38 +0000 (02:37 +0200)]
pthread-thread: New module.

* lib/pthread.in.h (pthread_create, pthread_exit, pthread_join): Remove
inline definitions.
* lib/pthread-thread.c: New file.
* m4/pthread-thread.m4: New file.
* modules/pthread-thread: New file.
* doc/posix-functions/pthread_create.texi: Mention the new module.
* doc/posix-functions/pthread_attr_init.texi: Likewise.
* doc/posix-functions/pthread_attr_getdetachstate.texi: Likewise.
* doc/posix-functions/pthread_attr_setdetachstate.texi: Likewise.
* doc/posix-functions/pthread_attr_destroy.texi: Likewise.
* doc/posix-functions/pthread_self.texi: Likewise.
* doc/posix-functions/pthread_equal.texi: Likewise.
* doc/posix-functions/pthread_detach.texi: Likewise.
* doc/posix-functions/pthread_join.texi: Likewise.
* doc/posix-functions/pthread_exit.texi: Likewise.

5 years agopthread-h: Prepare for adding new modules.
Bruno Haible [Mon, 15 Jul 2019 00:36:28 +0000 (02:36 +0200)]
pthread-h: Prepare for adding new modules.

* lib/pthread.in.h: Define the types and macros for each of the
facilities separately.
* m4/pthread_h.m4 (gl_PTHREAD_H): Set HAVE_PTHREAD_CREATE_DETACHED,
HAVE_PTHREAD_MUTEX_RECURSIVE, HAVE_PTHREAD_MUTEX_ROBUST,
HAVE_PTHREAD_PROCESS_SHARED.
(gl_PTHREAD_H_DEFAULTS): Initialize HAVE_PTHREAD_CREATE_DETACHED,
HAVE_PTHREAD_MUTEX_RECURSIVE, HAVE_PTHREAD_MUTEX_ROBUST,
HAVE_PTHREAD_PROCESS_SHARED.
* modules/pthread-h (Makefile.am): Substitute
HAVE_PTHREAD_CREATE_DETACHED, HAVE_PTHREAD_MUTEX_RECURSIVE,
HAVE_PTHREAD_MUTEX_ROBUST, HAVE_PTHREAD_PROCESS_SHARED.

5 years agopthread-h: Add declarations of essential pthread functions.
Bruno Haible [Mon, 15 Jul 2019 00:36:24 +0000 (02:36 +0200)]
pthread-h: Add declarations of essential pthread functions.

* lib/pthread.in.h: Include snippets.
(pthread_create, pthread_attr_init, pthread_attr_getdetachstate,
pthread_attr_setdetachstate, pthread_attr_destroy, pthread_self,
pthread_equal, pthread_detach, pthread_join, pthread_exit, pthread_once,
pthread_mutex_init, pthread_mutexattr_init, pthread_mutexattr_gettype,
pthread_mutexattr_settype, pthread_mutexattr_getrobust,
pthread_mutexattr_setrobust, pthread_mutexattr_destroy,
pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_unlock,
pthread_mutex_destroy, pthread_rwlock_init, pthread_rwlockattr_init,
pthread_rwlockattr_destroy, pthread_rwlock_rdlock,
pthread_rwlock_wrlock, pthread_rwlock_tryrdlock,
pthread_rwlock_trywrlock, pthread_rwlock_timedrdlock,
pthread_rwlock_timedwrlock, pthread_rwlock_unlock,
pthread_rwlock_destroy, pthread_cond_init, pthread_condattr_init,
pthread_condattr_destroy, pthread_cond_wait, pthread_cond_timedwait,
pthread_cond_signal, pthread_cond_broadcast, pthread_cond_destroy,
pthread_key_create, pthread_setspecific, pthread_getspecific,
pthread_key_delete, pthread_spin_init, pthread_spin_lock,
pthread_spin_trylock, pthread_spin_unlock, pthread_spin_destroy): New
declarations.
(pthread_mutex_timedlock): Move declaration.
* m4/pthread_h.m4 (gl_PTHREAD_H): Check whether the new functions are
declared.
(gl_PTHREAD_H_DEFAULTS): Initialize GNULIB_PTHREAD_THREAD,
GNULIB_PTHREAD_ONCE, GNULIB_PTHREAD_MUTEX, GNULIB_PTHREAD_RWLOCK,
GNULIB_PTHREAD_COND, GNULIB_PTHREAD_TSS, GNULIB_PTHREAD_SPIN and the
HAVE_* and REPLACE_* variables for the new functions.
* modules/pthread-h (Depends-on): Add snippet/c++defs,
snippet/_Noreturn, snippet/arg-nonnull, snippet/warn-on-use.
(Makefile.am): Substitute GNULIB_PTHREAD_THREAD, GNULIB_PTHREAD_ONCE,
GNULIB_PTHREAD_MUTEX, GNULIB_PTHREAD_RWLOCK, GNULIB_PTHREAD_COND,
GNULIB_PTHREAD_TSS, GNULIB_PTHREAD_SPIN and the HAVE_* and REPLACE_*
variables for the new functions. Split the sed script, to avoid the
limit of 99 commands of HP-UX sed.
* tests/test-pthread-c++.cc: Check the signature of the new functions.

5 years agopthread-h: Respect --enable-threads={posix|windows} option on mingw.
Bruno Haible [Mon, 15 Jul 2019 00:36:21 +0000 (02:36 +0200)]
pthread-h: Respect --enable-threads={posix|windows} option on mingw.

* m4/pthread_h.m4 (gl_PTHREAD_H): Require gl_THREADLIB. Set
HAVE_PTHREAD_H if gl_threads_api is 'windows'.
(LIB_PTHREAD): Rely on $LIBMULTITHREAD from threadlib.m4.
* modules/pthread (Link): Change to $(LIBMULTITHREAD).
* modules/pthread-h (Depends-on): Add threadlib.
(Link): Change to $(LIBTHREAD).
* modules/pthread-h-c++-tests (test_pthread_c___LDADD): Use
$(LIBMULTITHREAD) instead of $(LIB_PTHREAD).

5 years agopthread-h: Add C++ tests.
Bruno Haible [Mon, 15 Jul 2019 00:36:19 +0000 (02:36 +0200)]
pthread-h: Add C++ tests.

* tests/test-pthread-c++.cc: New file.
* modules/pthread-h-c++-tests: New file.

5 years agopthread-h: Add tests.
Bruno Haible [Mon, 15 Jul 2019 00:36:16 +0000 (02:36 +0200)]
pthread-h: Add tests.

* tests/test-pthread.c: New file.
* modules/pthread-h-tests: New file.

5 years agopthread-h: New module.
Bruno Haible [Mon, 15 Jul 2019 00:36:13 +0000 (02:36 +0200)]
pthread-h: New module.

* lib/pthread.in.h: Define replacement functions only if GNULIB_PTHREAD
is 1.
* m4/pthread_h.m4: Renamed from m4/pthread.m4.
(gl_PTHREAD_H): Renamed from gl_PTHREAD_CHECK. Don't test whether
<pthread.h> pollutes the namespace; instead, prepare for generating a
pthread.h always. Substitute HAVE_PTHREAD_H here.
(gl_PTHREAD_H_DEFAULTS): Renamed from gl_PTHREAD_DEFAULTS. Initialize
GNULIB_PTHREAD. Don't initialize HAVE_PTHREAD_H here.
* modules/pthread-h: New file, based on modules/pthread.
* modules/pthread: Rely on 'pthread-h'.
* m4/pthread_mutex_timedlock.m4 (gl_FUNC_PTHREAD_MUTEX_TIMEDLOCK):
Update.
* modules/pthread_mutex_timedlock (Depends-on): Add pthread-h. Remove
pthread.

5 years agosched_yield: New module.
Bruno Haible [Mon, 15 Jul 2019 00:36:10 +0000 (02:36 +0200)]
sched_yield: New module.

* lib/sched.in.h: Add _GL_FUNCDECL_RPL, _GL_WARN_ON_USE placeholders.
(sched_yield): New declaration.
* lib/sched_yield.c: New file.
* m4/sched_yield.m4: New file.
* m4/sched_h.m4 (gl_SCHED_H): Require gl_SCHED_H_DEFAULTS. Arrange to
provide a replacement sched.h always. Test whether sched_yield is
declared.
(gl_SCHED_MODULE_INDICATOR, gl_SCHED_H_DEFAULTS): New macros.
* modules/sched (Depends-on): Add snippet/c++defs, snippet/warn-on-use.
(Makefile.am): Provide a replacement sched.h always. Substitute
GNULIB_SCHED_YIELD, HAVE_SCHED_YIELD, REPLACE_SCHED_YIELD,
_GL_FUNCDECL_RPL, _GL_WARN_ON_USE.
* modules/sched_yield: New file.
* doc/posix-functions/sched_yield.texi: Mention the new module.

5 years agowindows-spin: New module.
Bruno Haible [Mon, 15 Jul 2019 00:36:08 +0000 (02:36 +0200)]
windows-spin: New module.

* lib/windows-spin.h: New file.
* lib/windows-spin.c: New file.
* modules/windows-spin: New file.

5 years agowindows-timedrwlock: New module.
Bruno Haible [Mon, 15 Jul 2019 00:36:05 +0000 (02:36 +0200)]
windows-timedrwlock: New module.

* lib/windows-timedrwlock.h: New file, based on windows-rwlock.h.
* lib/windows-timedrwlock.c: New file, based on windows-rwlock.c and
windows-cond.c.
* lib/windows-cond.h (struct glwthread_waitqueue_link): Protect against
redefinition conflict with windows-timedrwlock.h.
* modules/windows-timedrwlock: New file.

5 years agowindows-rwlock: New module.
Bruno Haible [Mon, 15 Jul 2019 00:36:02 +0000 (02:36 +0200)]
windows-rwlock: New module.

* lib/windows-rwlock.h: New file, extracted from lib/glthread/lock.h.
* lib/windows-rwlock.c: New file, extracted from lib/glthread/lock.c.
* lib/glthread/lock.h: Include windows-rwlock.h. Don't include
windows-initguard.h.
(gl_rwlock_t): Define using glwthread_rwlock_t.
(gl_rwlock_initializer): Define using GLWTHREAD_RWLOCK_INIT.
(glthread_rwlock_init): Define using glwthread_rwlock_init.
(glthread_rwlock_rdlock): Define using glwthread_rwlock_rdlock.
(glthread_rwlock_wrlock): Define using glwthread_rwlock_wrlock.
(glthread_rwlock_unlock): Define using glwthread_rwlock_unlock.
(glthread_rwlock_destroy): Define using glwthread_rwlock_destroy.
(glthread_rwlock_init_func, glthread_rwlock_rdlock_func,
glthread_rwlock_wrlock_func, glthread_rwlock_unlock_func,
glthread_rwlock_destroy_func): Remove declarations.
* lib/glthread/lock.c (gl_waitqueue_t): Remove type.
(gl_waitqueue_init, gl_waitqueue_add, gl_waitqueue_notify_first,
gl_waitqueue_notify_all, glthread_rwlock_init_func,
glthread_rwlock_rdlock_func, glthread_rwlock_wrlock_func,
glthread_rwlock_unlock_func, glthread_rwlock_destroy_func): Remove
functions.
* modules/windows-rwlock: New file.
* modules/lock (Depends-on): Add windows-rwlock.

5 years agowindows-thread: Add support for creating a thread in detached state.
Bruno Haible [Mon, 15 Jul 2019 00:35:58 +0000 (02:35 +0200)]
windows-thread: Add support for creating a thread in detached state.

* lib/windows-thread.h (GLWTHREAD_ATTR_DETACHED): New macro.
(glwthread_thread_create): Add attr argument.
* lib/windows-thread.c (glwthread_thread_create): Likewise.
* lib/glthread/thread.h (glthread_create): Update.
* lib/thrd.c (thrd_create): Update.

5 years agowindows-*: Rename glwthread_spinlock_t to glwthread_initguard_t.
Bruno Haible [Mon, 15 Jul 2019 00:35:56 +0000 (02:35 +0200)]
windows-*: Rename glwthread_spinlock_t to glwthread_initguard_t.

* lib/windows-initguard.h: Renamed from lib/windows-spinlock.h.
(glwthread_initguard_t): Renamed from glwthread_spinlock_t.
(GLWTHREAD_INITGUARD_INIT): Renamed from GLWTHREAD_SPINLOCK_INIT.
* lib/windows-mutex.h: Update.
* lib/windows-recmutex.h: Likewise.
* lib/windows-timedmutex.h: Likewise.
* lib/windows-timedrecmutex.h: Likewise.
* lib/windows-cond.h: Likewise.
* lib/glthread/lock.h: Likewise.
* modules/windows-mutex (Files): Add lib/windows-initguard.h. Remove
lib/windows-spinlock.h.
* modules/windows-recmutex (Files): Likewise.
* modules/windows-timedmutex (Files): Likewise.
* modules/windows-timedrecmutex (Files): Likewise.
* modules/windows-cond (Files): Likewise.
* modules/threads-h (Files): Likewise.

5 years agodoc: Fix info about pthread API in HP-UX.
Bruno Haible [Mon, 15 Jul 2019 00:35:53 +0000 (02:35 +0200)]
doc: Fix info about pthread API in HP-UX.

* doc/posix-functions/pthread_*.texi: Fix info about HP-UX 11.

5 years agoFix typo in comment.
Bruno Haible [Mon, 15 Jul 2019 00:35:50 +0000 (02:35 +0200)]
Fix typo in comment.

* tests/test-cnd.c (EXPLICIT_YIELD): Fix typo in comment.
* tests/test-tss.c (EXPLICIT_YIELD): Likewise.
* tests/test-thread_local.c (EXPLICIT_YIELD): Likewise.

5 years agothreads-h: Fix generation of threads.h.
Bruno Haible [Mon, 15 Jul 2019 00:35:46 +0000 (02:35 +0200)]
threads-h: Fix generation of threads.h.

* modules/threads-h (Makefile.am): Insert the required header file
snippets.

5 years agostriconveh test: Fix a compilation failure when iconv is not available.
Bruno Haible [Tue, 9 Jul 2019 06:45:16 +0000 (08:45 +0200)]
striconveh test: Fix a compilation failure when iconv is not available.

Reported by Tom G. Christensen <tgc@jupiterrise.com>.

* tests/test-striconveh.c (main): Move iconv_close invocations inside
HAVE_ICONV.

5 years agoargmatch: adjust columns for help2man.
Akim Demaille [Sun, 7 Jul 2019 10:12:25 +0000 (12:12 +0200)]
argmatch: adjust columns for help2man.

* lib/argmatch.h (argmatch_##Name##_doc_col): If some argument
requires column 20 or more, return 20.

5 years agoareadlink-with-size: avoid realloc when size==0
Paul Eggert [Sun, 7 Jul 2019 02:25:24 +0000 (19:25 -0700)]
areadlink-with-size: avoid realloc when size==0

* lib/areadlink-with-size.c (areadlink_with_size):
* lib/areadlinkat-with-size.c (areadlinkat_with_size):
Reallocate at the end to the actual size, to avoid memory waste,
as suggested by Bruno Haible.  But when the guessed size is zero -
useful when the size is unknown - do the initial small readlink
into the stack, to avoid that realloc in the usual case.

5 years agoareadlink-with-size: guess a buffer size with 0 size
Pádraig Brady [Sat, 6 Jul 2019 18:43:11 +0000 (19:43 +0100)]
areadlink-with-size: guess a buffer size with 0 size

The size is usually taken from st_size, which can be zero,
resulting in inefficient operation as seen with:

  $ strace -e readlink stat -c %N /proc/$$/cwd
  readlink("/proc/9036/cwd", "/", 1)      = 1
  readlink("/proc/9036/cwd", "/h", 2)     = 2
  readlink("/proc/9036/cwd", "/hom", 4)   = 4
  readlink("/proc/9036/cwd", "/home/pa", 8) = 8
  readlink("/proc/9036/cwd", "/home/padraig", 16) = 13

Instead let zero select an initial memory allocation
of 128 bytes, which most symlinks fit within.

* lib/areadlink-with-size.c (areadlink_with_size):
Start with a 128 byte buffer, for SIZE == 0.
* lib/areadlinkat-with-size.c (areadlinkat_with_size): Likewise.

5 years agoReplace manually crafted hex regexes with [:xdigit:]
Konstantin Kharlamov [Sat, 6 Jul 2019 14:59:49 +0000 (07:59 -0700)]
Replace manually crafted hex regexes with [:xdigit:]

* build-aux/gitlog-to-changelog (parse_amend_file)
(git_dir_option):
Replace various combinations of [0-9a-fA-F] with [[:xdigit:]].
This patch is backported from Emacs (Bug#36167).

5 years agoerror: Fix documentation.
Bruno Haible [Sat, 6 Jul 2019 12:16:10 +0000 (14:16 +0200)]
error: Fix documentation.

* doc/glibc-functions/error_at_line.texi: Document what the 'error'
module provides.
* doc/glibc-functions/error_message_count.texi: Likewise.
* doc/glibc-functions/error_one_per_line.texi: Likewise.
* doc/glibc-functions/error_print_progname.texi: Likewise.

5 years agoautoupdate
Karl Berry [Sat, 6 Jul 2019 14:11:43 +0000 (07:11 -0700)]
autoupdate

5 years agodoc: Remove documentation of glibc <= 2.1.x as a supported platform.
Bruno Haible [Sat, 6 Jul 2019 12:02:27 +0000 (14:02 +0200)]
doc: Remove documentation of glibc <= 2.1.x as a supported platform.

* doc/gnulib-intro.texi (Target Platforms): Mention that glibc 2.1.x
and older is unsupported.
* doc/**/*.texi: Update.

5 years agodoc: Remove documentation of Linux libc5 as a supported platform.
Bruno Haible [Sat, 6 Jul 2019 11:54:23 +0000 (13:54 +0200)]
doc: Remove documentation of Linux libc5 as a supported platform.

5 years agodoc: Remove documentation of Linux libc5 as a supported platform.
Bruno Haible [Sat, 6 Jul 2019 11:45:38 +0000 (13:45 +0200)]
doc: Remove documentation of Linux libc5 as a supported platform.

* doc/posix-functions/iswalnum.texi: Don't mention workarounds specific
to Linux libc5.
* doc/posix-functions/iswalpha.texi: Likewise.
* doc/posix-functions/iswblank.texi: Likewise.
* doc/posix-functions/iswcntrl.texi: Likewise.
* doc/posix-functions/iswdigit.texi: Likewise.
* doc/posix-functions/iswgraph.texi: Likewise.
* doc/posix-functions/iswlower.texi: Likewise.
* doc/posix-functions/iswprint.texi: Likewise.
* doc/posix-functions/iswpunct.texi: Likewise.
* doc/posix-functions/iswspace.texi: Likewise.
* doc/posix-functions/iswupper.texi: Likewise.
* doc/posix-functions/iswxdigit.texi: Likewise.
* doc/posix-functions/snprintf.texi: Likewise.
* doc/posix-functions/vsnprintf.texi: Likewise.

5 years agodoc: Remove documentation of Tandem/NSK as a supported platform.
Bruno Haible [Sat, 6 Jul 2019 11:41:06 +0000 (13:41 +0200)]
doc: Remove documentation of Tandem/NSK as a supported platform.

* doc/posix-headers/stdlib.texi: Don't mention workarounds specific to
Tandem/NSK.
* doc/**/*.texi: Update.

5 years agodoc: Remove documentation of Mac OS X <= 10.4 as a supported platform.
Bruno Haible [Sat, 6 Jul 2019 11:36:42 +0000 (13:36 +0200)]
doc: Remove documentation of Mac OS X <= 10.4 as a supported platform.

* doc/gnulib-intro.texi (Target Platforms): Mention that Mac OS X 10.4
and older is unsupported.
* doc/posix-functions/acosl.texi: Don't mention workarounds specific to
Mac OS X 10.4 and older.
* doc/posix-functions/asinl.texi: Likewise.
* doc/posix-functions/atanl.texi: Likewise.
* doc/posix-functions/cosl.texi: Likewise.
* doc/posix-functions/expl.texi: Likewise.
* doc/posix-functions/frexpl.texi: Likewise.
* doc/posix-functions/gettimeofday.texi: Likewise.
* doc/posix-functions/logl.texi: Likewise.
* doc/posix-functions/mkstemp.texi: Likewise.
* doc/posix-functions/sinl.texi: Likewise.
* doc/posix-functions/sqrtl.texi: Likewise.
* doc/posix-functions/tanl.texi: Likewise.
* doc/posix-functions/wcswidth.texi: Likewise.
* doc/**/*.texi: Update.

5 years agodoc: Remove documentation of AIX 4 as a supported platform.
Bruno Haible [Sat, 6 Jul 2019 11:08:43 +0000 (13:08 +0200)]
doc: Remove documentation of AIX 4 as a supported platform.

* doc/gnulib-intro.texi (Target Platforms): Mention that AIX 4 is
unsupported.
* doc/posix-functions/nanosleep.texi: Don't mention AIX 4 specific
workarounds.
* doc/posix-functions/strnlen.texi: Likewise.
* doc/posix-headers/inttypes.texi: Likewise.
* doc/**/*.texi: Update.

5 years agodoc: Remove documentation of HP-UX 10 as a supported platform.
Bruno Haible [Sat, 6 Jul 2019 10:58:08 +0000 (12:58 +0200)]
doc: Remove documentation of HP-UX 10 as a supported platform.

* doc/gnulib-intro.texi (Target Platforms): Mention that HP-UX 10 is
unsupported.
* doc/*-functions/*printf.texi: Don't mention HP-UX 10 specific
workarounds.
* doc/posix-functions/gmtime_r.texi: Likewise.
* doc/posix-functions/localtime_r.texi: Likewise.
* doc/posix-functions/mkstemp.texi: Likewise.
* doc/**/*.texi: Update.

5 years agodoc: Remove documentation of Interix 3.5 as a supported platform.
Bruno Haible [Sat, 6 Jul 2019 10:46:09 +0000 (12:46 +0200)]
doc: Remove documentation of Interix 3.5 as a supported platform.

* doc/gnulib-intro.texi (Target Platforms): Mention that Interix is
unsupported.
* doc/posix-functions/select.texi: Don't mention Interix specific
workarounds.
* doc/posix-headers/signal.texi: Likewise.
* doc/**/*.texi: Update.

5 years agodoc: Remove documentation of IRIX 6.4 and older as supported platforms.
Bruno Haible [Sat, 6 Jul 2019 10:35:49 +0000 (12:35 +0200)]
doc: Remove documentation of IRIX 6.4 and older as supported platforms.

* doc/gnulib-intro.texi (Target Platforms): Mention that IRIX <= 6.4 is
unsupported.
* doc/pastposix-functions/usleep.texi: Don't mention IRIX specific
workarounds.
* doc/posix-functions/nl_langinfo.texi: Likewise.
* doc/posix-functions/remainder.texi: Likewise.
* doc/posix-functions/towlower.texi: Likewise.
* doc/posix-functions/towupper.texi: Likewise.
* doc/posix-functions/vsnprintf.texi: Likewise.
* doc/posix-functions/wcscat.texi: Likewise.
* doc/posix-functions/wcschr.texi: Likewise.
* doc/posix-functions/wcscmp.texi: Likewise.
* doc/posix-functions/wcscpy.texi: Likewise.
* doc/posix-functions/wcscspn.texi: Likewise.
* doc/posix-functions/wcslen.texi: Likewise.
* doc/posix-functions/wcsncat.texi: Likewise.
* doc/posix-functions/wcsncmp.texi: Likewise.
* doc/posix-functions/wcsncpy.texi: Likewise.
* doc/posix-functions/wcspbrk.texi: Likewise.
* doc/posix-functions/wcsrchr.texi: Likewise.
* doc/posix-functions/wcsspn.texi: Likewise.
* doc/posix-headers/langinfo.texi: Likewise.
* doc/posix-headers/signal.texi: Likewise.
* doc/posix-headers/wchar.texi: Likewise.
* doc/posix-headers/wctype.texi: Likewise.
* doc/**/*.texi: Update.

5 years agodoc: Remove documentation of OSF/1 as supported platform.
Bruno Haible [Sat, 6 Jul 2019 05:03:06 +0000 (07:03 +0200)]
doc: Remove documentation of OSF/1 as supported platform.

* doc/gnulib-intro.texi (Target Platforms): Mention that OSF/1 is
unsupported.
* doc/glibc-functions/getdomainname.texi: Don't mention OSF/1 specific
workarounds.
* doc/glibc-functions/pthread_setname_np.texi: Likewise.
* doc/glibc-functions/ptsname_r.texi: Likewise.
* doc/posix-functions/ceil.texi: Likewise.
* doc/posix-functions/ceilf.texi: Likewise.
* doc/posix-functions/ceill.texi: Likewise.
* doc/posix-functions/fchdir.texi: Likewise.
* doc/posix-functions/floor.texi: Likewise.
* doc/posix-functions/floorf.texi: Likewise.
* doc/posix-functions/fmod.texi: Likewise.
* doc/posix-functions/fmodf.texi: Likewise.
* doc/posix-functions/fmodl.texi: Likewise.
* doc/posix-functions/log.texi: Likewise.
* doc/posix-functions/logf.texi: Likewise.
* doc/posix-functions/logl.texi: Likewise.
* doc/posix-functions/log10.texi: Likewise.
* doc/posix-functions/log10f.texi: Likewise.
* doc/posix-functions/log10l.texi: Likewise.
* doc/posix-functions/log2.texi: Likewise.
* doc/posix-functions/log2f.texi: Likewise.
* doc/posix-functions/log2l.texi: Likewise.
* doc/posix-functions/mbrtowc.texi: Likewise.
* doc/posix-functions/recv.texi: Likewise.
* doc/posix-functions/recvfrom.texi: Likewise.
* doc/posix-functions/remainder.texi: Likewise.
* doc/posix-functions/remainderf.texi: Likewise.
* doc/posix-functions/remainderl.texi: Likewise.
* doc/posix-functions/round.texi: Likewise.
* doc/posix-functions/roundf.texi: Likewise.
* doc/posix-functions/roundl.texi: Likewise.
* doc/posix-functions/send.texi: Likewise.
* doc/posix-functions/sendto.texi: Likewise.
* doc/posix-functions/setenv.texi: Likewise.
* doc/posix-functions/snprintf.texi: Likewise.
* doc/posix-functions/tcgetsid.texi: Likewise.
* doc/posix-functions/trunc.texi: Likewise.
* doc/posix-functions/truncf.texi: Likewise.
* doc/posix-functions/truncl.texi: Likewise.
* doc/posix-functions/ttyname_r.texi: Likewise.
* doc/posix-functions/unsetenv.texi: Likewise.
* doc/posix-functions/wcsrtombs.texi: Likewise.
* doc/posix-headers/sys_select.texi: Likewise.
* doc/posix-headers/wchar.texi: Likewise.
* doc/posix-headers/wctype.texi: Likewise.
* doc/**/*.texi: Update.

5 years agodoc: Remove documentation of Interix as a supported platform.
Bruno Haible [Sat, 6 Jul 2019 04:54:32 +0000 (06:54 +0200)]
doc: Remove documentation of Interix as a supported platform.

5 years agodoc: Remove documentation of BSDI and BSD/OS as supported platforms.
Bruno Haible [Sat, 6 Jul 2019 03:16:14 +0000 (05:16 +0200)]
doc: Remove documentation of BSDI and BSD/OS as supported platforms.

* doc/**/*.texi: Update.

5 years agodoc: Remove documentation of Solaris 8 and older as supported platforms.
Bruno Haible [Sat, 6 Jul 2019 03:10:53 +0000 (05:10 +0200)]
doc: Remove documentation of Solaris 8 and older as supported platforms.

* doc/gnulib-intro.texi (Target Platforms): Mention that Solaris <= 8 is
unsupported.
* doc/posix-functions/mbrtowc.texi: Don't mention Solaris specific
workarounds.
* doc/posix-functions/memcmp.texi: Likewise.
* doc/posix-functions/rename.texi: Likewise.
* doc/posix-functions/tzset.texi: Likewise.
* doc/posix-headers/wctype.texi: Likewise.
* doc/**/*.texi: Update.

5 years agodoc: Remove documentation of Interix 3.5 as a supported platform.
Bruno Haible [Sat, 6 Jul 2019 02:41:05 +0000 (04:41 +0200)]
doc: Remove documentation of Interix 3.5 as a supported platform.

* doc/**/*.texi: Update.

5 years agodoc: Remove documentation of BeOS as a supported platform.
Bruno Haible [Sat, 6 Jul 2019 02:35:31 +0000 (04:35 +0200)]
doc: Remove documentation of BeOS as a supported platform.

* doc/gnulib-intro.texi (Target Platforms): Mention that BeOS is
unsupported.
* doc/*-functions/*printf.texi: Don't mention BeOS specific workarounds.
* doc/posix-functions/getdelim.texi: Likewise.
* doc/**/*.texi: Update.

5 years agothread, lock, cond, tls: Remove support for Pth threads.
Bruno Haible [Sat, 6 Jul 2019 01:56:55 +0000 (03:56 +0200)]
thread, lock, cond, tls: Remove support for Pth threads.

* m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Don't document
--enable-threads=pth any more.
(gl_THREADLIB_BODY): Don't set USE_PTH_THREADS any more.
* m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Update comment.
* m4/threads.m4 (gl_THREADS_H): Remove test for conflict between Pth
threads and ISO C11 threads.
* lib/glthread/thread.h: Remove code for USE_PTH_THREADS.
* lib/glthread/lock.h: Likewise.
* lib/glthread/lock.c: Likewise.
* lib/glthread/cond.h: Likewise.
* lib/glthread/cond.c: Likewise.
* lib/glthread/tls.h: Likewise.
* lib/glthread/tls.c: Likewise.
* lib/glthread/yield.h: Likewise.
* lib/regex_internal.h: Likewise.
* tests/test-thread_create.c: Likewise.
* tests/test-lock.c: Likewise.
* tests/test-cond.c: Likewise.
* tests/test-tls.c: Likewise.
* tests/test-rwlock1.c: Don't include glthread/yield.h.
(main): Sleep without calling gl_thread_yield.

5 years agothread, lock, cond, tls: Remove support for old Solaris threads.
Bruno Haible [Sat, 6 Jul 2019 01:36:45 +0000 (03:36 +0200)]
thread, lock, cond, tls: Remove support for old Solaris threads.

Solaris >= 2.5.1 has POSIX threads.

* m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Don't document
--enable-threads=solaris any more.
(gl_THREADLIB_BODY): Don't set USE_SOLARIS_THREADS any more.
* lib/glthread/thread.c: Update comment.
* lib/glthread/thread.h: Remove code for USE_SOLARIS_THREADS.
* lib/glthread/lock.h: Likewise.
* lib/glthread/lock.c: Likewise.
* lib/glthread/cond.h: Likewise.
* lib/glthread/cond.c: Likewise.
* lib/glthread/tls.h: Likewise.
* lib/glthread/tls.c: Likewise.
* lib/glthread/yield.h: Likewise.
* lib/regex_internal.h: Likewise.
* tests/test-thread_create.c: Likewise.
* tests/test-lock.c: Likewise.
* tests/test-cond.c: Likewise.
* tests/test-tls.c: Likewise.

5 years agogetcwd-lgpl, getcwd: Don't call realloc when it is pointless.
Bruno Haible [Fri, 5 Jul 2019 22:47:12 +0000 (00:47 +0200)]
getcwd-lgpl, getcwd: Don't call realloc when it is pointless.

* lib/getcwd-lgpl.c (rpl_getcwd): Don't call realloc if the result's
needed size is equal to the allocated size.
* lib/getcwd.c (__getcwd): Likewise.

5 years agoxgetdomainname: Don't return an excessive memory allocation.
Bruno Haible [Fri, 5 Jul 2019 22:43:59 +0000 (00:43 +0200)]
xgetdomainname: Don't return an excessive memory allocation.

* lib/xgetdomainname.c (xgetdomainname): Shrink the domainname buffer
before returning it.

5 years agoxgethostname: Don't return an excessive memory allocation.
Bruno Haible [Fri, 5 Jul 2019 22:43:01 +0000 (00:43 +0200)]
xgethostname: Don't return an excessive memory allocation.

* lib/xgethostname.c (xgethostname): Shrink the hostname buffer before
returning it.

5 years agoareadlinkat-with-size: Don't return an excessive memory allocation.
Bruno Haible [Fri, 5 Jul 2019 22:40:34 +0000 (00:40 +0200)]
areadlinkat-with-size: Don't return an excessive memory allocation.

* lib/areadlinkat-with-size.c (areadlinkat_with_size): Shrink the buffer
before returning it.

5 years agoareadlink-with-size: Don't return an excessive memory allocation.
Bruno Haible [Fri, 5 Jul 2019 22:39:07 +0000 (00:39 +0200)]
areadlink-with-size: Don't return an excessive memory allocation.

Reported by Andreas Dilger <adilger@whamcloud.com>.

* lib/areadlink-with-size.c (areadlink_with_size): Shrink the buffer
before returning it.

5 years agorenameatu: Fix test failure on MSVC.
Bruno Haible [Wed, 3 Jul 2019 00:49:27 +0000 (02:49 +0200)]
renameatu: Fix test failure on MSVC.

* lib/at-func2.c (at_func2): Fail with ENOENT if file1 or file2 is the
empty string.

5 years agoautoupdate
Karl Berry [Thu, 4 Jul 2019 15:23:14 +0000 (08:23 -0700)]
autoupdate

5 years agombrtowc: Fix invalid use of mbtowc() on MSVC.
Bruno Haible [Wed, 3 Jul 2019 17:25:09 +0000 (19:25 +0200)]
mbrtowc: Fix invalid use of mbtowc() on MSVC.

* lib/mbrtowc.c: Include glthread/lock.h.
(mbtowc_lock): New variable.
(mbrtowc): Treat UTF-8 encoding without locking. For the other
encodings, explicitly reset the internal state of mbtowc, and protect
this through a lock.
* modules/mbrtowc (Depends-on): Add lock.

5 years agoargmatch: don't define _ in the header
Akim Demaille [Wed, 3 Jul 2019 04:35:34 +0000 (06:35 +0200)]
argmatch: don't define _ in the header

Reported by Jim Meyering.

* lib/argmatch.h (N_, _): Don't define.
Use gettext instead.
* lib/argmatch.h (_): Define.
* tests/test-argmatch.c (N_): Define.

5 years agoverify: document ‘assume’ better
Paul Eggert [Tue, 2 Jul 2019 23:33:04 +0000 (16:33 -0700)]
verify: document ‘assume’ better

* lib/verify.h: Reword doc (Bug#36370).

5 years agolocalcharset, nl_langinfo: Fix return value for UTF-8 locales on MSVC.
Bruno Haible [Tue, 2 Jul 2019 18:56:26 +0000 (20:56 +0200)]
localcharset, nl_langinfo: Fix return value for UTF-8 locales on MSVC.

* lib/localcharset.c (locale_charset): Return "UTF-8" instead of
"CPutf8".
* lib/nl_langinfo.c (ctype_codeset): Likewise.

5 years agogetcwd: Fix crash when invoked with size = 0 on MSVC.
Bruno Haible [Tue, 2 Jul 2019 18:43:00 +0000 (20:43 +0200)]
getcwd: Fix crash when invoked with size = 0 on MSVC.

* lib/getcwd.c: Include msvc-inval.h.
(getcwd_nothrow): New function/macro.
(getcwd_system): New macro.
(__getcwd): Use it instead of getcwd.
* modules/getcwd (Depends-on): Add msvc-inval.
* doc/posix-functions/getcwd.texi: Mention the MSVC issue.

5 years agononblocking-pipe tests: Fix test failure on MSVC.
Bruno Haible [Tue, 2 Jul 2019 17:59:28 +0000 (19:59 +0200)]
nonblocking-pipe tests: Fix test failure on MSVC.

* tests/test-nonblocking-pipe.h (PIPE_DATA_BLOCK_SIZE): Set to 10000 on
native Windows.

5 years agousleep: Implement with millisecond resolution on native Windows.
Bruno Haible [Tue, 2 Jul 2019 17:57:03 +0000 (19:57 +0200)]
usleep: Implement with millisecond resolution on native Windows.

* lib/usleep.c (usleep): On native Windows, implement using Sleep().
* doc/pastposix-functions/usleep.texi: Update accordingly.

5 years agolstat tests: Fix test failure on MSVC.
Bruno Haible [Tue, 2 Jul 2019 17:48:14 +0000 (19:48 +0200)]
lstat tests: Fix test failure on MSVC.

* tests/test-lstat.h (test_lstat_func): Don't test SAME_INODE values on
native Windows, unless _GL_WINDOWS_STAT_INODES is defined.

5 years agostat tests: Fix test failure on MSVC.
Bruno Haible [Tue, 2 Jul 2019 17:44:52 +0000 (19:44 +0200)]
stat tests: Fix test failure on MSVC.

* tests/test-stat.h (test_stat_func): Don't test SAME_INODE values on
native Windows, unless _GL_WINDOWS_STAT_INODES is defined.

5 years agogetaddrinfo tests: Fix test failure on MSVC.
Bruno Haible [Tue, 2 Jul 2019 17:38:27 +0000 (19:38 +0200)]
getaddrinfo tests: Fix test failure on MSVC.

* tests/test-getaddrinfo.c: Include sockets.h.
(main): Invoke gl_sockets_startup.
* modules/getaddrinfo-tests (Depends-on): Add sockets.

5 years agopoll: Fix type of timeout pointer passed to select() on mingw x86_64.
Hannes Müller [Mon, 1 Jul 2019 14:59:45 +0000 (16:59 +0200)]
poll: Fix type of timeout pointer passed to select() on mingw x86_64.

* lib/poll.c: Call Windows native select() with Windows native timeval.

5 years agoargmatch: Fix compilation errors.
Bruno Haible [Sun, 30 Jun 2019 19:12:42 +0000 (21:12 +0200)]
argmatch: Fix compilation errors.

* lib/argmatch.h: Include <limits.h>, for INT_MAX.
* tests/test-argmatch.c (main): Update after last-minute function names
change.

5 years agoautoupdate
Karl Berry [Sun, 30 Jun 2019 15:45:19 +0000 (08:45 -0700)]
autoupdate

5 years agoInclude <stdlib.h> when needed.
Bruno Haible [Sun, 30 Jun 2019 14:11:08 +0000 (16:11 +0200)]
Include <stdlib.h> when needed.

* lib/cnd.c: Include <stdlib.h>, needed for abort().
* lib/fcntl.c: Likewise.
* lib/mbscasestr.c: Likewise.
* lib/mbssep.c: Likewise.
* lib/mbsstr.c: Likewise.
* lib/openat.c: Include <stdlib.h>, needed for free().
* lib/windows-tls.c: Include <stdlib.h>, needed for malloc(), free(),
abort().

5 years agoInclude <stdlib.h> when needed.
Bruno Haible [Sun, 30 Jun 2019 13:52:09 +0000 (15:52 +0200)]
Include <stdlib.h> when needed.

* lib/areadlinkat.c: Include <stdlib.h>, needed for free() in at-func.c.
* lib/faccessat.c: Likewise.
* lib/fchmodat.c: Likewise.
* lib/fchownat.c: Likewise.
* lib/fstatat.c: Likewise.
* lib/mkfifoat.c: Likewise.
* lib/mknodat.c: Likewise.
* lib/readlinkat.c: Likewise.
* lib/symlinkat.c: Likewise.
* lib/utimensat.c: Likewise.
* lib/mkdirat.c: Likewise. Include also the specification header.

5 years agoinet_ntop, inet_pton: Avoid conflict with native Windows functions.
Bruno Haible [Sun, 30 Jun 2019 13:20:24 +0000 (15:20 +0200)]
inet_ntop, inet_pton: Avoid conflict with native Windows functions.

* m4/sys_socket_h.m4 (gl_PREREQ_SYS_H_WS2TCPIP): New macro, extracted
from gl_PREREQ_SYS_H_SOCKET.
(gl_PREREQ_SYS_H_SOCKET): Invoke it.
* m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET): Invoke
gl_PREREQ_SYS_H_WS2TCPIP.
* modules/arpa_inet (Files): Add m4/sys_socket_h.m4, m4/socklen.m4.
(Makefile.am): Substitute HAVE_WS2TCPIP_H.
* lib/arpa_inet.in.h: Include <ws2tcpip.h>.

5 years agoinet_ntop, inet_pton: Forward-compatibility with newer Windows versions.
Bruno Haible [Sun, 30 Jun 2019 13:08:05 +0000 (15:08 +0200)]
inet_ntop, inet_pton: Forward-compatibility with newer Windows versions.

* m4/inet_ntop.m4 (gl_FUNC_INET_NTOP): On native Windows, set
REPLACE_INET_NTOP to 1 always.
* m4/inet_pton.m4 (gl_FUNC_INET_PTON): On native Windows, set
REPLACE_INET_PTON to 1 always.

5 years agoinet_pton: Fix link error on mingw with _WIN32_WINNT >= 0x0600.
Bruno Haible [Sun, 30 Jun 2019 12:54:40 +0000 (14:54 +0200)]
inet_pton: Fix link error on mingw with _WIN32_WINNT >= 0x0600.

* modules/inet_pton (Depends-on, configure.ac): Test REPLACE_INET_PTON,
not REPLACE_INET_NTOP.

5 years agopoll: Add comment.
Bruno Haible [Sun, 30 Jun 2019 12:48:50 +0000 (14:48 +0200)]
poll: Add comment.

* lib/poll.c: Add comment about WSAPoll.

5 years agopoll-h: Fix compilation error on mingw with _WIN32_WINNT >= 0x0600.
Bruno Haible [Sun, 30 Jun 2019 12:43:44 +0000 (14:43 +0200)]
poll-h: Fix compilation error on mingw with _WIN32_WINNT >= 0x0600.

Reported by Hannes Müller <h.c.f.mueller@gmx.de>.

* lib/poll.in.h: Include <winsock2.h>.
(POLL*, pollfd): Override on native Windows.
* m4/poll_h.m4 (gl_POLL_H): Invoke gl_PREREQ_SYS_H_WINSOCK2.
* modules/poll-h (Files): Add m4/sys_socket_h.m4.
(Makefile.am): Substitute HAVE_WINSOCK2_H.

5 years agoaccept4: Fix compilation error on OpenIndiana.
Bruno Haible [Sat, 29 Jun 2019 00:02:10 +0000 (02:02 +0200)]
accept4: Fix compilation error on OpenIndiana.

Reported by Michal Nowak <mnowak@startmail.com>
via Mark H Weaver <mhw@netris.org>.

* m4/accept.m4 (gl_FUNC_ACCEPT4): Test whether accept4 is declared, not
whether it exists as a function.

5 years agoautoupdate
Karl Berry [Thu, 27 Jun 2019 16:32:11 +0000 (09:32 -0700)]
autoupdate

5 years agostrverscmp: sync from glibc
Paul Eggert [Wed, 26 Jun 2019 19:46:32 +0000 (12:46 -0700)]
strverscmp: sync from glibc

* lib/strverscmp.c: Sync from glibc, except use UTF-8 encoding in
comments, include libc-config.h, define __strverscmp to be
strverscmp, and don’t assume types line uint8_t and int8_t that
that C99 doesn’t guarantee.
[!_LIBC]: Include libc-config.h; define __strverscmp.
Include stdint.h.
(__strverscmp): Assume C99.  Use uint_least8_t
and int_least8_t instead of unsigned char and signed char.
* modules/strverscmp (Depends-on): Add libc-config, stdint.

5 years agotss tests: Add tests for destructors and races.
Bruno Haible [Wed, 26 Jun 2019 01:32:57 +0000 (03:32 +0200)]
tss tests: Add tests for destructors and races.

* tests/test-tss.c (worker_thread): Fix typo in debug message.
(test_tss_dtorcheck1, test_tss_dtorcheck2, test_tss_racecheck): New
functions.
(main): Invoke them.
* modules/tls-tests (Depends-on): Add mtx.

5 years agotls tests: Add tests for destructors and races.
Bruno Haible [Wed, 26 Jun 2019 01:32:51 +0000 (03:32 +0200)]
tls tests: Add tests for destructors and races.

* tests/test-tls.c: Include glthread/lock.h.
(test_tls_dtorcheck1, test_tls_dtorcheck2, test_tls_racecheck): New
functions.
(main): Invoke them.
* modules/tls-tests (Depends-on): Add lock.

5 years agowindows-tls: Implement TLS key destructors for native Windows.
Bruno Haible [Wed, 26 Jun 2019 01:32:46 +0000 (03:32 +0200)]
windows-tls: Implement TLS key destructors for native Windows.

* lib/windows-tls.h (glwthread_tls_process_destructors): New
declaration.
(GLWTHREAD_DESTRUCTOR_ITERATIONS): New macro.
* lib/windows-tls.c: Include <limits.h>, windows-once.h.
(dtor_table_init_once, dtor_table_lock: New variables.
(struct dtor): New type.
(dtor_table, dtors_count, dtors_used, dtors_allocated,
dtor_processing_threads): New variables.
(dtor_table_initialize, dtor_table_ensure_initialized,
dtor_table_shrink_used, glwthread_tls_process_destructors): New
functions.
(glwthread_tls_key_create, glwthread_tls_key_delete): Rewritten to
handle non-NULL destructors.
* modules/windows-tls (Depends-on): Add windows-once.
* lib/glthread/tls.h (glthread_tls_key_init, glthread_tls_key_destroy):
Use the functions declared in windows-tls.h.
* lib/threads.in.h (TSS_DTOR_ITERATIONS): Define using
GLWTHREAD_DESTRUCTOR_ITERATIONS.
* lib/windows-thread.c: Include windows-tls.h.
(wrapper_func, glwthread_thread_exit): Invoke
glwthread_tls_process_destructors.
* modules/windows-thread (Depends-on): Add windows-tls.

5 years agothreadlib: Avoid autoconf warning "was expanded before it was required".
Bruno Haible [Wed, 26 Jun 2019 01:32:42 +0000 (03:32 +0200)]
threadlib: Avoid autoconf warning "was expanded before it was required".

* modules/threadlib (configure.ac): Require gl_THREADLIB.

5 years agoargmatch: remove duplicate const qualifier
Akim Demaille [Tue, 25 Jun 2019 06:11:34 +0000 (08:11 +0200)]
argmatch: remove duplicate const qualifier

* lib/argmatch.h (ARGMATCH_DEFINE_GROUP): Here.

5 years agounistd: stddef.h and sys/types.h namespace cleanup
Paul Eggert [Mon, 24 Jun 2019 18:54:00 +0000 (11:54 -0700)]
unistd: stddef.h and sys/types.h namespace cleanup

* lib/unistd.in.h [__GLIBC__]:
Do not include stddef.h or sys/types.h.
[!__GLIBC__]: Always include sys/types.h, since unistd.h is
supposed to declare off_t and ssize_t.  Problem found when looking
at why @GNULIB_PWRITE@ was different from the newly-added
@GNULIB_COPY_FILE_RANGE@ with respect to ssize_t.

5 years agomaintainer-makefile: restore portability to non-GNU awks
Akim Demaille [Sat, 22 Jun 2019 15:52:16 +0000 (17:52 +0200)]
maintainer-makefile: restore portability to non-GNU awks

Reported by Tim Rühsen.
* top/maint.mk (AWK): New variable.  Use it.
(sc_prohibit_gnu_make_extensions): Skip if $(AWK) is not gawk.

5 years agoDocument setvbuf _IOLBF problem
Paul Eggert [Sun, 23 Jun 2019 22:36:49 +0000 (15:36 -0700)]
Document setvbuf _IOLBF problem

* doc/posix-functions/setvbuf.texi (setvbuf):
Document MS-Windows portability problem with _IOLBF.

5 years agoDocument lseek SEEK_DATA/SEEK_HOLE
Paul Eggert [Sun, 23 Jun 2019 22:35:29 +0000 (15:35 -0700)]
Document lseek SEEK_DATA/SEEK_HOLE

* doc/posix-functions/lseek.texi (lseek):
Document some systems that do not support SEEK_DATA and SEEK_HOLE.

5 years agoautoupdate
Karl Berry [Sun, 23 Jun 2019 16:24:49 +0000 (09:24 -0700)]
autoupdate

5 years agoautoupdate
Karl Berry [Sun, 23 Jun 2019 16:11:38 +0000 (09:11 -0700)]
autoupdate