summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-01-18 18:25:25 +0100
committerLudovic Courtès <ludo@gnu.org>2023-01-18 22:50:18 +0100
commitaeb22f486139f457ae7fc44c2d931312aaae52d8 (patch)
tree0fbfe6d421e637553f9bca39f08577c0ddb990e8 /lib
parent4404b553a5a135aee5a606dedea9b6fa25363be4 (diff)
downloadguile-aeb22f486139f457ae7fc44c2d931312aaae52d8.tar.gz
Update Gnulib to v0.1-5703-g356a414e8c and add 'posix_spawn' module.
This is a followup to edfca3b7e5931b5b5a83112e2a9813b068be99c2, which added the 'posix_spawnp' module but not 'posix_spawn'. * m4/gnulib-cache.m4: Add 'posix_spawn' module. * gnulib-local/m4/clock_time.m4.diff: Adjust. * configure.ac: Move 'gl_EARLY' use right after 'AC_PROG_CC'.
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am223
-rw-r--r--lib/_Noreturn.h2
-rw-r--r--lib/accept.c2
-rw-r--r--lib/accept4.c2
-rw-r--r--lib/access.c2
-rw-r--r--lib/alignof.h7
-rw-r--r--lib/alloca.in.h2
-rw-r--r--lib/arg-nonnull.h2
-rw-r--r--lib/arpa_inet.in.h2
-rw-r--r--lib/asnprintf.c2
-rw-r--r--lib/assert.in.h27
-rw-r--r--lib/assure.h2
-rw-r--r--lib/attribute.h4
-rw-r--r--lib/basename-lgpl.c3
-rw-r--r--lib/basename-lgpl.h2
-rw-r--r--lib/binary-io.c2
-rw-r--r--lib/binary-io.h2
-rw-r--r--lib/bind.c2
-rw-r--r--lib/btowc.c2
-rw-r--r--lib/byteswap.in.h2
-rw-r--r--lib/c++defs.h2
-rw-r--r--lib/c-ctype.c2
-rw-r--r--lib/c-ctype.h4
-rw-r--r--lib/c-strcase.h2
-rw-r--r--lib/c-strcasecmp.c2
-rw-r--r--lib/c-strcaseeq.h2
-rw-r--r--lib/c-strncasecmp.c2
-rw-r--r--lib/canonicalize-lgpl.c125
-rw-r--r--lib/cdefs.h2
-rw-r--r--lib/ceil.c2
-rw-r--r--lib/cloexec.c2
-rw-r--r--lib/cloexec.h4
-rw-r--r--lib/close.c2
-rw-r--r--lib/concat-filename.c2
-rw-r--r--lib/concat-filename.h2
-rw-r--r--lib/connect.c2
-rw-r--r--lib/copysign.c2
-rw-r--r--lib/dirent.in.h2
-rw-r--r--lib/dirfd.c2
-rw-r--r--lib/dirname-lgpl.c2
-rw-r--r--lib/dirname.h3
-rw-r--r--lib/dup2.c2
-rw-r--r--lib/duplocale.c2
-rw-r--r--lib/dynarray.h2
-rw-r--r--lib/eloop-threshold.h2
-rw-r--r--lib/errno.in.h2
-rw-r--r--lib/fcntl.c2
-rw-r--r--lib/fcntl.in.h2
-rw-r--r--lib/fd-hook.c2
-rw-r--r--lib/fd-hook.h2
-rw-r--r--lib/filename.h2
-rw-r--r--lib/findprog-in.c3
-rw-r--r--lib/findprog.h4
-rw-r--r--lib/flexmember.h2
-rw-r--r--lib/float+.h2
-rw-r--r--lib/float.c2
-rw-r--r--lib/float.in.h2
-rw-r--r--lib/flock.c2
-rw-r--r--lib/floor.c2
-rw-r--r--lib/free.c2
-rw-r--r--lib/frexp.c2
-rw-r--r--lib/fstat.c2
-rw-r--r--lib/fsync.c2
-rw-r--r--lib/full-read.c2
-rw-r--r--lib/full-read.h2
-rw-r--r--lib/full-write.c2
-rw-r--r--lib/full-write.h2
-rw-r--r--lib/gai_strerror.c2
-rw-r--r--lib/getaddrinfo.c4
-rw-r--r--lib/getdtablesize.c2
-rw-r--r--lib/getlogin.c2
-rw-r--r--lib/getpeername.c2
-rw-r--r--lib/getrandom.c3
-rw-r--r--lib/getsockname.c2
-rw-r--r--lib/getsockopt.c2
-rw-r--r--lib/gettext.h2
-rw-r--r--lib/hard-locale.c16
-rw-r--r--lib/hard-locale.h4
-rw-r--r--lib/iconv.c2
-rw-r--r--lib/iconv.in.h2
-rw-r--r--lib/iconv_close.c2
-rw-r--r--lib/iconv_open-aix.gperf2
-rw-r--r--lib/iconv_open-hpux.gperf2
-rw-r--r--lib/iconv_open-irix.gperf2
-rw-r--r--lib/iconv_open-osf.gperf2
-rw-r--r--lib/iconv_open-solaris.gperf2
-rw-r--r--lib/iconv_open-zos.gperf2
-rw-r--r--lib/iconv_open.c2
-rw-r--r--lib/iconveh.h2
-rw-r--r--lib/idx.h2
-rw-r--r--lib/inet_ntop.c2
-rw-r--r--lib/inet_pton.c2
-rw-r--r--lib/intprops-internal.h2
-rw-r--r--lib/intprops.h2
-rw-r--r--lib/inttypes.in.h2
-rw-r--r--lib/isfinite.c2
-rw-r--r--lib/isinf.c2
-rw-r--r--lib/isnan.c2
-rw-r--r--lib/isnand-nolibm.h2
-rw-r--r--lib/isnand.c2
-rw-r--r--lib/isnanf-nolibm.h2
-rw-r--r--lib/isnanf.c2
-rw-r--r--lib/isnanl-nolibm.h2
-rw-r--r--lib/isnanl.c2
-rw-r--r--lib/itold.c2
-rw-r--r--lib/langinfo.in.h2
-rw-r--r--lib/lc-charset-dispatch.c2
-rw-r--r--lib/lc-charset-dispatch.h2
-rw-r--r--lib/libc-config.h2
-rw-r--r--lib/libunistring.valgrind2
-rw-r--r--lib/limits.in.h6
-rw-r--r--lib/link.c2
-rw-r--r--lib/listen.c2
-rw-r--r--lib/localcharset.c2
-rw-r--r--lib/localcharset.h2
-rw-r--r--lib/locale.in.h2
-rw-r--r--lib/localeconv.c2
-rw-r--r--lib/log.c2
-rw-r--r--lib/log1p.c2
-rw-r--r--lib/lstat.c2
-rw-r--r--lib/malloc.c2
-rw-r--r--lib/malloc/dynarray-skeleton.c2
-rw-r--r--lib/malloc/dynarray.h3
-rw-r--r--lib/malloc/dynarray_at_failure.c2
-rw-r--r--lib/malloc/dynarray_emplace_enlarge.c2
-rw-r--r--lib/malloc/dynarray_finalize.c2
-rw-r--r--lib/malloc/dynarray_resize.c2
-rw-r--r--lib/malloc/dynarray_resize_clear.c2
-rw-r--r--lib/malloc/scratch_buffer.h18
-rw-r--r--lib/malloc/scratch_buffer_dupfree.c41
-rw-r--r--lib/malloc/scratch_buffer_grow.c2
-rw-r--r--lib/malloc/scratch_buffer_grow_preserve.c2
-rw-r--r--lib/malloc/scratch_buffer_set_array_size.c2
-rw-r--r--lib/malloca.c5
-rw-r--r--lib/malloca.h2
-rw-r--r--lib/math.c2
-rw-r--r--lib/math.in.h36
-rw-r--r--lib/mbrtowc-impl-utf8.h2
-rw-r--r--lib/mbrtowc-impl.h2
-rw-r--r--lib/mbrtowc.c5
-rw-r--r--lib/mbsinit.c5
-rw-r--r--lib/mbtowc-impl.h2
-rw-r--r--lib/mbtowc-lock.c2
-rw-r--r--lib/mbtowc-lock.h2
-rw-r--r--lib/mbtowc.c2
-rw-r--r--lib/memchr.c2
-rw-r--r--lib/memchr.valgrind2
-rw-r--r--lib/mempcpy.c2
-rw-r--r--lib/minmax.h2
-rw-r--r--lib/mkdir.c2
-rw-r--r--lib/mkostemp.c2
-rw-r--r--lib/mktime-internal.h2
-rw-r--r--lib/mktime.c2
-rw-r--r--lib/msvc-inval.c2
-rw-r--r--lib/msvc-inval.h2
-rw-r--r--lib/msvc-nothrow.c2
-rw-r--r--lib/msvc-nothrow.h2
-rw-r--r--lib/netdb.in.h2
-rw-r--r--lib/netinet_in.in.h2
-rw-r--r--lib/nl_langinfo-lock.c2
-rw-r--r--lib/nl_langinfo.c2
-rw-r--r--lib/nproc.c2
-rw-r--r--lib/nproc.h2
-rw-r--r--lib/nstrftime.c3
-rw-r--r--lib/open.c2
-rw-r--r--lib/pathmax.h2
-rw-r--r--lib/pipe.c2
-rw-r--r--lib/pipe2.c5
-rw-r--r--lib/poll.c2
-rw-r--r--lib/poll.in.h2
-rw-r--r--lib/printf-args.c2
-rw-r--r--lib/printf-args.h2
-rw-r--r--lib/printf-parse.c2
-rw-r--r--lib/printf-parse.h2
-rw-r--r--lib/putenv.c2
-rw-r--r--lib/raise.c2
-rw-r--r--lib/rawmemchr.c6
-rw-r--r--lib/rawmemchr.valgrind2
-rw-r--r--lib/read.c2
-rw-r--r--lib/readlink.c2
-rw-r--r--lib/realloc.c2
-rw-r--r--lib/recv.c2
-rw-r--r--lib/recvfrom.c2
-rw-r--r--lib/regcomp.c2
-rw-r--r--lib/regex.c2
-rw-r--r--lib/regex.h2
-rw-r--r--lib/regex_internal.c2
-rw-r--r--lib/regex_internal.h3
-rw-r--r--lib/regexec.c2
-rw-r--r--lib/rename.c3
-rw-r--r--lib/rmdir.c2
-rw-r--r--lib/round.c2
-rw-r--r--lib/safe-read.c2
-rw-r--r--lib/safe-read.h2
-rw-r--r--lib/safe-write.c2
-rw-r--r--lib/safe-write.h2
-rw-r--r--lib/same-inode.h2
-rw-r--r--lib/sched.in.h2
-rw-r--r--lib/scratch_buffer.h12
-rw-r--r--lib/select.c2
-rw-r--r--lib/send.c2
-rw-r--r--lib/sendto.c2
-rw-r--r--lib/setenv.c2
-rw-r--r--lib/setlocale-lock.c2
-rw-r--r--lib/setlocale_null.c2
-rw-r--r--lib/setlocale_null.h2
-rw-r--r--lib/setsockopt.c2
-rw-r--r--lib/shutdown.c2
-rw-r--r--lib/signal.in.h16
-rw-r--r--lib/signbitd.c2
-rw-r--r--lib/signbitf.c2
-rw-r--r--lib/signbitl.c2
-rw-r--r--lib/size_max.h2
-rw-r--r--lib/snprintf.c2
-rw-r--r--lib/socket.c2
-rw-r--r--lib/sockets.c2
-rw-r--r--lib/sockets.h2
-rw-r--r--lib/spawn.c2
-rw-r--r--lib/spawn.in.h2
-rw-r--r--lib/spawn_int.h2
-rw-r--r--lib/spawni.c303
-rw-r--r--lib/spawnp.c2
-rw-r--r--lib/stat-time.c2
-rw-r--r--lib/stat-time.h7
-rw-r--r--lib/stat-w32.c5
-rw-r--r--lib/stat-w32.h2
-rw-r--r--lib/stat.c4
-rw-r--r--lib/stdalign.in.h127
-rw-r--r--lib/stdbool.in.h115
-rw-r--r--lib/stdckdint.in.h4
-rw-r--r--lib/stddef.in.h2
-rw-r--r--lib/stdint.in.h2
-rw-r--r--lib/stdio-read.c2
-rw-r--r--lib/stdio-write.c2
-rw-r--r--lib/stdio.in.h10
-rw-r--r--lib/stdlib.in.h8
-rw-r--r--lib/stpcpy.c2
-rw-r--r--lib/strchrnul.c2
-rw-r--r--lib/strchrnul.valgrind2
-rw-r--r--lib/strdup.c2
-rw-r--r--lib/streq.h2
-rw-r--r--lib/strftime.h2
-rw-r--r--lib/striconveh.c3
-rw-r--r--lib/striconveh.h2
-rw-r--r--lib/string.in.h41
-rw-r--r--lib/stripslash.c2
-rw-r--r--lib/sys-limits.h2
-rw-r--r--lib/sys_file.in.h2
-rw-r--r--lib/sys_random.in.h4
-rw-r--r--lib/sys_select.in.h11
-rw-r--r--lib/sys_socket.c2
-rw-r--r--lib/sys_socket.in.h3
-rw-r--r--lib/sys_stat.in.h78
-rw-r--r--lib/sys_time.in.h2
-rw-r--r--lib/sys_times.in.h2
-rw-r--r--lib/sys_types.in.h2
-rw-r--r--lib/sys_uio.in.h2
-rw-r--r--lib/tempname.c3
-rw-r--r--lib/tempname.h2
-rw-r--r--lib/time-internal.h2
-rw-r--r--lib/time.in.h7
-rw-r--r--lib/time_r.c2
-rw-r--r--lib/time_rz.c3
-rw-r--r--lib/timegm.c2
-rw-r--r--lib/times.c2
-rw-r--r--lib/trunc.c2
-rw-r--r--lib/tzset.c2
-rw-r--r--lib/unistd.c2
-rw-r--r--lib/unistd.in.h6
-rw-r--r--lib/unsetenv.c2
-rw-r--r--lib/vasnprintf.c13
-rw-r--r--lib/vasnprintf.h2
-rw-r--r--lib/verify.h55
-rw-r--r--lib/vsnprintf.c2
-rw-r--r--lib/w32sock.h2
-rw-r--r--lib/warn-on-use.h2
-rw-r--r--lib/wchar.in.h41
-rw-r--r--lib/wcrtomb.c2
-rw-r--r--lib/wctype-h.c2
-rw-r--r--lib/wctype.in.h2
-rw-r--r--lib/windows-initguard.h2
-rw-r--r--lib/windows-spawn.c108
-rw-r--r--lib/windows-spawn.h62
-rw-r--r--lib/write.c2
-rw-r--r--lib/xalloc-oversized.h2
-rw-r--r--lib/xsize.c2
-rw-r--r--lib/xsize.h2
287 files changed, 1055 insertions, 1033 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 0e7ed9b91..c3223052f 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2022 Free Software Foundation, Inc.
+# Copyright (C) 2002-2023 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
@@ -110,6 +110,7 @@
# pipe-posix \
# pipe2 \
# poll \
+# posix_spawn \
# posix_spawnp \
# putenv \
# readlink \
@@ -168,10 +169,15 @@ EXTRA_libgnu_la_SOURCES =
libgnu_la_LDFLAGS = $(AM_LDFLAGS)
libgnu_la_LDFLAGS += -no-undefined
libgnu_la_LDFLAGS += $(CEIL_LIBM)
+libgnu_la_LDFLAGS += $(CLOCK_TIME_LIB)
libgnu_la_LDFLAGS += $(COPYSIGN_LIBM)
+libgnu_la_LDFLAGS += $(DUPLOCALE_LIB)
libgnu_la_LDFLAGS += $(FLOOR_LIBM)
libgnu_la_LDFLAGS += $(FREXP_LIBM)
libgnu_la_LDFLAGS += $(GETADDRINFO_LIB)
+libgnu_la_LDFLAGS += $(GETLOGIN_LIB)
+libgnu_la_LDFLAGS += $(GETRANDOM_LIB)
+libgnu_la_LDFLAGS += $(HARD_LOCALE_LIB)
libgnu_la_LDFLAGS += $(HOSTENT_LIB)
libgnu_la_LDFLAGS += $(INET_NTOP_LIB)
libgnu_la_LDFLAGS += $(INET_PTON_LIB)
@@ -181,22 +187,18 @@ libgnu_la_LDFLAGS += $(ISNANL_LIBM)
libgnu_la_LDFLAGS += $(LDEXP_LIBM)
libgnu_la_LDFLAGS += $(LIBSOCKET)
libgnu_la_LDFLAGS += $(LIBTHREAD)
-libgnu_la_LDFLAGS += $(LIB_CLOCK_GETTIME)
-libgnu_la_LDFLAGS += $(LIB_DUPLOCALE)
-libgnu_la_LDFLAGS += $(LIB_GETLOGIN)
-libgnu_la_LDFLAGS += $(LIB_GETRANDOM)
-libgnu_la_LDFLAGS += $(LIB_HARD_LOCALE)
-libgnu_la_LDFLAGS += $(LIB_MBRTOWC)
-libgnu_la_LDFLAGS += $(LIB_POLL)
-libgnu_la_LDFLAGS += $(LIB_SELECT)
-libgnu_la_LDFLAGS += $(LIB_SETLOCALE_NULL)
libgnu_la_LDFLAGS += $(LOG1P_LIBM)
libgnu_la_LDFLAGS += $(LOG_LIBM)
libgnu_la_LDFLAGS += $(LTLIBICONV)
libgnu_la_LDFLAGS += $(LTLIBINTL)
libgnu_la_LDFLAGS += $(LTLIBUNISTRING)
+libgnu_la_LDFLAGS += $(MBRTOWC_LIB)
+libgnu_la_LDFLAGS += $(POLL_LIB)
+libgnu_la_LDFLAGS += $(POSIX_SPAWN_LIB)
libgnu_la_LDFLAGS += $(ROUND_LIBM)
+libgnu_la_LDFLAGS += $(SELECT_LIB)
libgnu_la_LDFLAGS += $(SERVENT_LIB)
+libgnu_la_LDFLAGS += $(SETLOCALE_NULL_LIB)
libgnu_la_LDFLAGS += $(TRUNC_LIBM)
## begin gnulib module absolute-header
@@ -318,6 +320,37 @@ EXTRA_DIST += arpa_inet.in.h
## end gnulib module arpa_inet
+## begin gnulib module assert-h
+
+BUILT_SOURCES += $(ASSERT_H)
+
+# We need the following in order to create <assert.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_ASSERT_H
+assert.h: assert.in.h verify.h $(top_builddir)/config.status
+ $(gl_V_at){ $(SED_HEADER_STDOUT) \
+ -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_ASSERT_H''@|$(NEXT_ASSERT_H)|g' \
+ < $(srcdir)/assert.in.h && \
+ sed -e '/@assert.h omit start@/,/@assert.h omit end@/d' \
+ -e 's|_gl_verify|_gl_static_assert|g' \
+ -e 's|_GL_VERIFY|_GL_STATIC_ASSERT|g' \
+ -e 's|_GL\(_STATIC_ASSERT_H\)|_GL\1|g' \
+ < $(srcdir)/verify.h; \
+ } > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+assert.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += assert.h assert.h-t
+
+EXTRA_DIST += assert.in.h verify.h
+
+## end gnulib module assert-h
+
## begin gnulib module assure
if gl_GNULIB_ENABLED_assure
@@ -549,41 +582,6 @@ endif
## end gnulib module duplocale
-## begin gnulib module dynarray
-
-if gl_GNULIB_ENABLED_dynarray
-BUILT_SOURCES += malloc/dynarray.gl.h malloc/dynarray-skeleton.gl.h
-
-malloc/dynarray.gl.h: malloc/dynarray.h
- $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
- $(AM_V_at)$(SED_HEADER_STDOUT) \
- -e '/libc_hidden_proto/d' \
- $(srcdir)/malloc/dynarray.h > $@-t
- $(AM_V_at)mv $@-t $@
-MOSTLYCLEANFILES += malloc/dynarray.gl.h malloc/dynarray.gl.h-t
-
-malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c
- $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
- $(AM_V_at)$(SED_HEADER_STDOUT) \
- -e 's|<malloc/dynarray\.h>|<malloc/dynarray.gl.h>|g' \
- -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \
- -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \
- -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \
- -e 's|__glibc_likely|_GL_LIKELY|g' \
- -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
- $(srcdir)/malloc/dynarray-skeleton.c > $@-t
- $(AM_V_at)mv $@-t $@
-MOSTLYCLEANFILES += malloc/dynarray-skeleton.gl.h malloc/dynarray-skeleton.gl.h-t
-
-libgnu_la_SOURCES += malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c malloc/dynarray_finalize.c malloc/dynarray_resize.c malloc/dynarray_resize_clear.c
-
-endif
-EXTRA_DIST += dynarray.h malloc/dynarray-skeleton.c malloc/dynarray.h
-
-EXTRA_libgnu_la_SOURCES += malloc/dynarray-skeleton.c
-
-## end gnulib module dynarray
-
## begin gnulib module eloop-threshold
if gl_GNULIB_ENABLED_925677f0343de64b89a9f0c790b4104c
@@ -924,6 +922,64 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gitlog-to-changelog
## end gnulib module gitlog-to-changelog
+## begin gnulib module glibc-internal/dynarray
+
+if gl_GNULIB_ENABLED_fd38c7e463b54744b77b98aeafb4fa7c
+BUILT_SOURCES += malloc/dynarray.gl.h malloc/dynarray-skeleton.gl.h
+
+malloc/dynarray.gl.h: malloc/dynarray.h
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e '/libc_hidden_proto/d' \
+ $(srcdir)/malloc/dynarray.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += malloc/dynarray.gl.h malloc/dynarray.gl.h-t
+
+malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|<malloc/dynarray\.h>|<malloc/dynarray.gl.h>|g' \
+ -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \
+ -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \
+ -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \
+ -e 's|__glibc_likely|_GL_LIKELY|g' \
+ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
+ $(srcdir)/malloc/dynarray-skeleton.c > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += malloc/dynarray-skeleton.gl.h malloc/dynarray-skeleton.gl.h-t
+
+libgnu_la_SOURCES += malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c malloc/dynarray_finalize.c malloc/dynarray_resize.c malloc/dynarray_resize_clear.c
+
+endif
+EXTRA_DIST += dynarray.h malloc/dynarray-skeleton.c malloc/dynarray.h
+
+EXTRA_libgnu_la_SOURCES += malloc/dynarray-skeleton.c
+
+## end gnulib module glibc-internal/dynarray
+
+## begin gnulib module glibc-internal/scratch_buffer
+
+if gl_GNULIB_ENABLED_8444034ea779b88768865bb60b4fb8c9
+BUILT_SOURCES += malloc/scratch_buffer.gl.h
+
+malloc/scratch_buffer.gl.h: malloc/scratch_buffer.h
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \
+ -e 's|__glibc_likely|_GL_LIKELY|g' \
+ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
+ -e '/libc_hidden_proto/d' \
+ $(srcdir)/malloc/scratch_buffer.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += malloc/scratch_buffer.gl.h malloc/scratch_buffer.gl.h-t
+
+libgnu_la_SOURCES += malloc/scratch_buffer_grow.c malloc/scratch_buffer_grow_preserve.c malloc/scratch_buffer_set_array_size.c
+
+endif
+EXTRA_DIST += malloc/scratch_buffer.h scratch_buffer.h
+
+## end gnulib module glibc-internal/scratch_buffer
+
## begin gnulib module gnu-web-doc-update
@@ -1992,6 +2048,14 @@ EXTRA_DIST += poll.in.h
## end gnulib module poll-h
+## begin gnulib module posix_spawn
+
+if GL_COND_OBJ_SPAWN
+libgnu_la_SOURCES += spawn.c
+endif
+
+## end gnulib module posix_spawn
+
## begin gnulib module posix_spawn-internal
if gl_GNULIB_ENABLED_332607f759618fb73dfc3076748afea7
@@ -2183,29 +2247,6 @@ EXTRA_DIST += sched.in.h
## end gnulib module sched
-## begin gnulib module scratch_buffer
-
-if gl_GNULIB_ENABLED_scratch_buffer
-BUILT_SOURCES += malloc/scratch_buffer.gl.h
-
-malloc/scratch_buffer.gl.h: malloc/scratch_buffer.h
- $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
- $(AM_V_at)$(SED_HEADER_STDOUT) \
- -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \
- -e 's|__glibc_likely|_GL_LIKELY|g' \
- -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
- -e '/libc_hidden_proto/d' \
- $(srcdir)/malloc/scratch_buffer.h > $@-t
- $(AM_V_at)mv $@-t $@
-MOSTLYCLEANFILES += malloc/scratch_buffer.gl.h malloc/scratch_buffer.gl.h-t
-
-libgnu_la_SOURCES += malloc/scratch_buffer_dupfree.c malloc/scratch_buffer_grow.c malloc/scratch_buffer_grow_preserve.c malloc/scratch_buffer_set_array_size.c
-
-endif
-EXTRA_DIST += malloc/scratch_buffer.h scratch_buffer.h
-
-## end gnulib module scratch_buffer
-
## begin gnulib module select
if GL_COND_OBJ_SELECT
@@ -2495,48 +2536,6 @@ EXTRA_DIST += stat-time.h
## end gnulib module stat-time
-## begin gnulib module stdalign
-
-BUILT_SOURCES += $(STDALIGN_H)
-
-# We need the following in order to create <stdalign.h> when the system
-# doesn't have one that works.
-if GL_GENERATE_STDALIGN_H
-stdalign.h: stdalign.in.h $(top_builddir)/config.status
- $(gl_V_at)$(SED_HEADER_TO_AT_t) $(srcdir)/stdalign.in.h
- $(AM_V_at)mv $@-t $@
-else
-stdalign.h: $(top_builddir)/config.status
- rm -f $@
-endif
-MOSTLYCLEANFILES += stdalign.h stdalign.h-t
-
-EXTRA_DIST += stdalign.in.h
-
-## end gnulib module stdalign
-
-## begin gnulib module stdbool
-
-BUILT_SOURCES += $(STDBOOL_H)
-
-# We need the following in order to create <stdbool.h> when the system
-# doesn't have one that works.
-if GL_GENERATE_STDBOOL_H
-stdbool.h: stdbool.in.h $(top_builddir)/config.status
- $(gl_V_at)$(SED_HEADER_STDOUT) \
- -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' \
- $(srcdir)/stdbool.in.h > $@-t
- $(AM_V_at)mv $@-t $@
-else
-stdbool.h: $(top_builddir)/config.status
- rm -f $@
-endif
-MOSTLYCLEANFILES += stdbool.h stdbool.h-t
-
-EXTRA_DIST += stdbool.in.h
-
-## end gnulib module stdbool
-
## begin gnulib module stdckdint
BUILT_SOURCES += $(STDCKDINT_H)
@@ -2715,7 +2714,9 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
-e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+ -e 's|@''HAVE_DECL_GETW''@|$(HAVE_DECL_GETW)|g' \
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
+ -e 's|@''HAVE_DECL_PUTW''@|$(HAVE_DECL_PUTW)|g' \
-e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
@@ -3013,6 +3014,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_MEMMEM''@/$(GL_GNULIB_MEMMEM)/g' \
-e 's/@''GNULIB_MEMPCPY''@/$(GL_GNULIB_MEMPCPY)/g' \
-e 's/@''GNULIB_MEMRCHR''@/$(GL_GNULIB_MEMRCHR)/g' \
+ -e 's/@''GNULIB_MEMSET_EXPLICIT''@/$(GL_GNULIB_MEMSET_EXPLICIT)/g' \
-e 's/@''GNULIB_RAWMEMCHR''@/$(GL_GNULIB_RAWMEMCHR)/g' \
-e 's/@''GNULIB_STPCPY''@/$(GL_GNULIB_STPCPY)/g' \
-e 's/@''GNULIB_STPNCPY''@/$(GL_GNULIB_STPNCPY)/g' \
@@ -3044,6 +3046,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
-e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
-e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+ -e 's|@''HAVE_MEMSET_EXPLICIT''@|$(HAVE_MEMSET_EXPLICIT)|g' \
-e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
-e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
-e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
diff --git a/lib/_Noreturn.h b/lib/_Noreturn.h
index e914627a8..fa15b1b25 100644
--- a/lib/_Noreturn.h
+++ b/lib/_Noreturn.h
@@ -1,5 +1,5 @@
/* A C macro for declaring that a function does not return.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
diff --git a/lib/accept.c b/lib/accept.c
index 5c4d1f352..2641cedb6 100644
--- a/lib/accept.c
+++ b/lib/accept.c
@@ -1,6 +1,6 @@
/* accept.c --- wrappers for Windows accept function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/accept4.c b/lib/accept4.c
index 61ab6c77c..4bd4a4893 100644
--- a/lib/accept4.c
+++ b/lib/accept4.c
@@ -1,5 +1,5 @@
/* Accept a connection on a socket, with specific opening flags.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/access.c b/lib/access.c
index e39c158ec..e2c12b1f1 100644
--- a/lib/access.c
+++ b/lib/access.c
@@ -1,5 +1,5 @@
/* Test the access rights of a file.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/alignof.h b/lib/alignof.h
index 3f4a54257..2ded1c788 100644
--- a/lib/alignof.h
+++ b/lib/alignof.h
@@ -1,5 +1,5 @@
/* Determine alignment of types.
- Copyright (C) 2003-2004, 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003-2004, 2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -22,15 +22,14 @@
/* alignof_slot (TYPE)
Determine the alignment of a structure slot (field) of a given type,
at compile time. Note that the result depends on the ABI.
- This is the same as alignof (TYPE) and _Alignof (TYPE), defined in
- <stdalign.h> if __alignof_is_defined is 1.
+ This is the same as alignof (TYPE).
Note: The result cannot be used as a value for an 'enum' constant,
due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */
#if defined __cplusplus
template <class type> struct alignof_helper { char __slot1; type __slot2; };
# define alignof_slot(type) offsetof (alignof_helper<type>, __slot2)
#else
-# define alignof_slot(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
+# define alignof_slot(type) alignof (type)
#endif
/* alignof_type (TYPE)
diff --git a/lib/alloca.in.h b/lib/alloca.in.h
index e2b146138..a1bb3d758 100644
--- a/lib/alloca.in.h
+++ b/lib/alloca.in.h
@@ -1,6 +1,6 @@
/* Memory allocation on the stack.
- Copyright (C) 1995, 1999, 2001-2004, 2006-2022 Free Software Foundation,
+ Copyright (C) 1995, 1999, 2001-2004, 2006-2023 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/arg-nonnull.h b/lib/arg-nonnull.h
index e4513efe9..9498ae1f7 100644
--- a/lib/arg-nonnull.h
+++ b/lib/arg-nonnull.h
@@ -1,5 +1,5 @@
/* A C macro for declaring that specific arguments must not be NULL.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
diff --git a/lib/arpa_inet.in.h b/lib/arpa_inet.in.h
index f5d7db2df..80e6713fd 100644
--- a/lib/arpa_inet.in.h
+++ b/lib/arpa_inet.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <arpa/inet.h>.
- Copyright (C) 2005-2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/asnprintf.c b/lib/asnprintf.c
index 0c5c76ea5..f4861bf84 100644
--- a/lib/asnprintf.c
+++ b/lib/asnprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/assert.in.h b/lib/assert.in.h
new file mode 100644
index 000000000..b0ab99c77
--- /dev/null
+++ b/lib/assert.in.h
@@ -0,0 +1,27 @@
+/* Substitute for and wrapper around <assert.h>
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Do not guard the include, since <assert.h> is supposed to define
+ the assert macro each time it is included. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#@INCLUDE_NEXT@ @NEXT_ASSERT_H@
+
+/* The definition of static_assert is copied here. */
diff --git a/lib/assure.h b/lib/assure.h
index 20e806aa4..e31076d96 100644
--- a/lib/assure.h
+++ b/lib/assure.h
@@ -1,6 +1,6 @@
/* Run-time assert-like macros.
- Copyright (C) 2014-2022 Free Software Foundation, Inc.
+ Copyright (C) 2014-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/attribute.h b/lib/attribute.h
index 378d4f0a8..130644d87 100644
--- a/lib/attribute.h
+++ b/lib/attribute.h
@@ -1,6 +1,6 @@
/* ATTRIBUTE_* macros for using attributes in GCC and similar compilers
- Copyright 2020-2022 Free Software Foundation, Inc.
+ Copyright 2020-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -32,7 +32,7 @@
/* This file defines two types of attributes:
- * C2x standard attributes. These have macro names that do not begin with
+ * C23 standard attributes. These have macro names that do not begin with
'ATTRIBUTE_'.
* Selected GCC attributes; see:
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
diff --git a/lib/basename-lgpl.c b/lib/basename-lgpl.c
index eb07e2541..6de60aa67 100644
--- a/lib/basename-lgpl.c
+++ b/lib/basename-lgpl.c
@@ -1,6 +1,6 @@
/* basename.c -- return the last element in a file name
- Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2022 Free Software
+ Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -21,7 +21,6 @@
/* Specification. */
#include "basename-lgpl.h"
-#include <stdbool.h>
#include <string.h>
#include "filename.h"
diff --git a/lib/basename-lgpl.h b/lib/basename-lgpl.h
index 5569f2193..5d996c1da 100644
--- a/lib/basename-lgpl.h
+++ b/lib/basename-lgpl.h
@@ -1,6 +1,6 @@
/* Extract the last component (base name) of a file name.
- Copyright (C) 1998, 2001, 2003-2006, 2009-2022 Free Software Foundation,
+ Copyright (C) 1998, 2001, 2003-2006, 2009-2023 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/binary-io.c b/lib/binary-io.c
index ea407fd74..28a9e6ed6 100644
--- a/lib/binary-io.c
+++ b/lib/binary-io.c
@@ -1,5 +1,5 @@
/* Binary mode I/O.
- Copyright 2017-2022 Free Software Foundation, Inc.
+ Copyright 2017-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/binary-io.h b/lib/binary-io.h
index 5b7661e23..6f4db2533 100644
--- a/lib/binary-io.h
+++ b/lib/binary-io.h
@@ -1,5 +1,5 @@
/* Binary mode I/O.
- Copyright (C) 2001, 2003, 2005, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003, 2005, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/bind.c b/lib/bind.c
index 199e0ba99..c67badecd 100644
--- a/lib/bind.c
+++ b/lib/bind.c
@@ -1,6 +1,6 @@
/* bind.c --- wrappers for Windows bind function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/btowc.c b/lib/btowc.c
index 4af58bb02..caadbd760 100644
--- a/lib/btowc.c
+++ b/lib/btowc.c
@@ -1,5 +1,5 @@
/* Convert unibyte character to wide character.
- Copyright (C) 2008, 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/byteswap.in.h b/lib/byteswap.in.h
index f4746d399..e61be27e9 100644
--- a/lib/byteswap.in.h
+++ b/lib/byteswap.in.h
@@ -1,5 +1,5 @@
/* byteswap.h - Byte swapping
- Copyright (C) 2005, 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc.
Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/c++defs.h b/lib/c++defs.h
index ad181558f..8ad46951a 100644
--- a/lib/c++defs.h
+++ b/lib/c++defs.h
@@ -1,5 +1,5 @@
/* C++ compatible function declaration macros.
- Copyright (C) 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2010-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
diff --git a/lib/c-ctype.c b/lib/c-ctype.c
index a247514cd..a4343f445 100644
--- a/lib/c-ctype.c
+++ b/lib/c-ctype.c
@@ -1,6 +1,6 @@
/* Character handling in C locale.
- Copyright (C) 2003-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/c-ctype.h b/lib/c-ctype.h
index 1a4f60389..35ca83d7d 100644
--- a/lib/c-ctype.h
+++ b/lib/c-ctype.h
@@ -5,7 +5,7 @@
<ctype.h> functions' behaviour depends on the current locale set via
setlocale.
- Copyright (C) 2000-2003, 2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2003, 2006, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -23,8 +23,6 @@
#ifndef C_CTYPE_H
#define C_CTYPE_H
-#include <stdbool.h>
-
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
#endif
diff --git a/lib/c-strcase.h b/lib/c-strcase.h
index 3e874b5ea..9bcca01b2 100644
--- a/lib/c-strcase.h
+++ b/lib/c-strcase.h
@@ -1,5 +1,5 @@
/* Case-insensitive string comparison functions in C locale.
- Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2022 Free Software
+ Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/c-strcasecmp.c b/lib/c-strcasecmp.c
index 87b993cb2..8a958dc4f 100644
--- a/lib/c-strcasecmp.c
+++ b/lib/c-strcasecmp.c
@@ -1,5 +1,5 @@
/* c-strcasecmp.c -- case insensitive string comparator in C locale
- Copyright (C) 1998-1999, 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1998-1999, 2005-2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/c-strcaseeq.h b/lib/c-strcaseeq.h
index 1c4607cc9..1d0759a56 100644
--- a/lib/c-strcaseeq.h
+++ b/lib/c-strcaseeq.h
@@ -1,5 +1,5 @@
/* Optimized case-insensitive string comparison in C locale.
- Copyright (C) 2001-2002, 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/c-strncasecmp.c b/lib/c-strncasecmp.c
index 5a5d30b6e..4ca8c5f40 100644
--- a/lib/c-strncasecmp.c
+++ b/lib/c-strncasecmp.c
@@ -1,5 +1,5 @@
/* c-strncasecmp.c -- case insensitive string comparator in C locale
- Copyright (C) 1998-1999, 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1998-1999, 2005-2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c
index a7fa7feb6..e701297d8 100644
--- a/lib/canonicalize-lgpl.c
+++ b/lib/canonicalize-lgpl.c
@@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file.
- Copyright (C) 1996-2022 Free Software Foundation, Inc.
+ Copyright (C) 1996-2023 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
@@ -30,7 +30,6 @@
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
-#include <stdbool.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -48,6 +47,7 @@
#else
# define __canonicalize_file_name canonicalize_file_name
# define __realpath realpath
+# define __strdup strdup
# include "pathmax.h"
# define __faccessat faccessat
# if defined _WIN32 && !defined __CYGWIN__
@@ -180,27 +180,16 @@ get_path_max (void)
return path_max < 0 ? 1024 : path_max <= IDX_MAX ? path_max : IDX_MAX;
}
-/* Act like __realpath (see below), with an additional argument
- rname_buf that can be used as temporary storage.
-
- If GCC_LINT is defined, do not inline this function with GCC 10.1
- and later, to avoid creating a pointer to the stack that GCC
- -Wreturn-local-addr incorrectly complains about. See:
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644
- Although the noinline attribute can hurt performance a bit, no better way
- to pacify GCC is known; even an explicit #pragma does not pacify GCC.
- When the GCC bug is fixed this workaround should be limited to the
- broken GCC versions. */
-# if __GNUC_PREREQ (10, 1)
-# if defined GCC_LINT || defined lint
-__attribute__ ((__noinline__))
-# elif __OPTIMIZE__ && !__NO_INLINE__
-# define GCC_BOGUS_WRETURN_LOCAL_ADDR
-# endif
-# endif
+/* Scratch buffers used by realpath_stk and managed by __realpath. */
+struct realpath_bufs
+{
+ struct scratch_buffer rname;
+ struct scratch_buffer extra;
+ struct scratch_buffer link;
+};
+
static char *
-realpath_stk (const char *name, char *resolved,
- struct scratch_buffer *rname_buf)
+realpath_stk (const char *name, char *resolved, struct realpath_bufs *bufs)
{
char *dest;
char const *start;
@@ -225,12 +214,7 @@ realpath_stk (const char *name, char *resolved,
return NULL;
}
- struct scratch_buffer extra_buffer, link_buffer;
- scratch_buffer_init (&extra_buffer);
- scratch_buffer_init (&link_buffer);
- scratch_buffer_init (rname_buf);
- char *rname_on_stack = rname_buf->data;
- char *rname = rname_on_stack;
+ char *rname = bufs->rname.data;
bool end_in_extra_buffer = false;
bool failed = true;
@@ -240,16 +224,16 @@ realpath_stk (const char *name, char *resolved,
if (!IS_ABSOLUTE_FILE_NAME (name))
{
- while (!__getcwd (rname, rname_buf->length))
+ while (!__getcwd (bufs->rname.data, bufs->rname.length))
{
if (errno != ERANGE)
{
dest = rname;
goto error;
}
- if (!scratch_buffer_grow (rname_buf))
- goto error_nomem;
- rname = rname_buf->data;
+ if (!scratch_buffer_grow (&bufs->rname))
+ return NULL;
+ rname = bufs->rname.data;
}
dest = __rawmemchr (rname, '\0');
start = name;
@@ -303,13 +287,13 @@ realpath_stk (const char *name, char *resolved,
if (!ISSLASH (dest[-1]))
*dest++ = '/';
- while (rname + rname_buf->length - dest
+ while (rname + bufs->rname.length - dest
< startlen + sizeof dir_suffix)
{
idx_t dest_offset = dest - rname;
- if (!scratch_buffer_grow_preserve (rname_buf))
- goto error_nomem;
- rname = rname_buf->data;
+ if (!scratch_buffer_grow_preserve (&bufs->rname))
+ return NULL;
+ rname = bufs->rname.data;
dest = rname + dest_offset;
}
@@ -320,13 +304,13 @@ realpath_stk (const char *name, char *resolved,
ssize_t n;
while (true)
{
- buf = link_buffer.data;
- idx_t bufsize = link_buffer.length;
+ buf = bufs->link.data;
+ idx_t bufsize = bufs->link.length;
n = __readlink (rname, buf, bufsize - 1);
if (n < bufsize - 1)
break;
- if (!scratch_buffer_grow (&link_buffer))
- goto error_nomem;
+ if (!scratch_buffer_grow (&bufs->link))
+ return NULL;
}
if (0 <= n)
{
@@ -338,7 +322,7 @@ realpath_stk (const char *name, char *resolved,
buf[n] = '\0';
- char *extra_buf = extra_buffer.data;
+ char *extra_buf = bufs->extra.data;
idx_t end_idx IF_LINT (= 0);
if (end_in_extra_buffer)
end_idx = end - extra_buf;
@@ -346,13 +330,13 @@ realpath_stk (const char *name, char *resolved,
if (INT_ADD_OVERFLOW (len, n))
{
__set_errno (ENOMEM);
- goto error_nomem;
+ return NULL;
}
- while (extra_buffer.length <= len + n)
+ while (bufs->extra.length <= len + n)
{
- if (!scratch_buffer_grow_preserve (&extra_buffer))
- goto error_nomem;
- extra_buf = extra_buffer.data;
+ if (!scratch_buffer_grow_preserve (&bufs->extra))
+ return NULL;
+ extra_buf = bufs->extra.data;
}
if (end_in_extra_buffer)
end = extra_buf + end_idx;
@@ -404,20 +388,30 @@ realpath_stk (const char *name, char *resolved,
error:
*dest++ = '\0';
- if (resolved != NULL && dest - rname <= get_path_max ())
- rname = strcpy (resolved, rname);
-
-error_nomem:
- scratch_buffer_free (&extra_buffer);
- scratch_buffer_free (&link_buffer);
-
- if (failed || rname == resolved)
+ if (resolved != NULL)
+ {
+ /* Copy the full result on success or partial result if failure was due
+ to the path not existing or not being accessible. */
+ if ((!failed || errno == ENOENT || errno == EACCES)
+ && dest - rname <= get_path_max ())
+ {
+ strcpy (resolved, rname);
+ if (failed)
+ return NULL;
+ else
+ return resolved;
+ }
+ if (!failed)
+ __set_errno (ENAMETOOLONG);
+ return NULL;
+ }
+ else
{
- scratch_buffer_free (rname_buf);
- return failed ? NULL : resolved;
+ if (failed)
+ return NULL;
+ else
+ return __strdup (bufs->rname.data);
}
-
- return scratch_buffer_dupfree (rname_buf, dest - rname);
}
/* Return the canonical absolute name of file NAME. A canonical name
@@ -434,12 +428,15 @@ error_nomem:
char *
__realpath (const char *name, char *resolved)
{
- #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR
- #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
- #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
- #endif
- struct scratch_buffer rname_buffer;
- return realpath_stk (name, resolved, &rname_buffer);
+ struct realpath_bufs bufs;
+ scratch_buffer_init (&bufs.rname);
+ scratch_buffer_init (&bufs.extra);
+ scratch_buffer_init (&bufs.link);
+ char *result = realpath_stk (name, resolved, &bufs);
+ scratch_buffer_free (&bufs.link);
+ scratch_buffer_free (&bufs.extra);
+ scratch_buffer_free (&bufs.rname);
+ return result;
}
libc_hidden_def (__realpath)
versioned_symbol (libc, __realpath, realpath, GLIBC_2_3);
diff --git a/lib/cdefs.h b/lib/cdefs.h
index 7b8ed5b34..09a3d19b2 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
Copyright The GNU Toolchain Authors.
This file is part of the GNU C Library.
diff --git a/lib/ceil.c b/lib/ceil.c
index 4ab192a54..aef0d34c6 100644
--- a/lib/ceil.c
+++ b/lib/ceil.c
@@ -1,5 +1,5 @@
/* Round towards positive infinity.
- Copyright (C) 2007, 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2010-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/cloexec.c b/lib/cloexec.c
index 812be01a0..e4cecbd2e 100644
--- a/lib/cloexec.c
+++ b/lib/cloexec.c
@@ -1,6 +1,6 @@
/* cloexec.c - set or clear the close-on-exec descriptor flag
- Copyright (C) 1991, 2004-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1991, 2004-2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/cloexec.h b/lib/cloexec.h
index 7a22d7753..057fd668c 100644
--- a/lib/cloexec.h
+++ b/lib/cloexec.h
@@ -1,6 +1,6 @@
/* cloexec.c - set or clear the close-on-exec descriptor flag
- Copyright (C) 2004, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -15,8 +15,6 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
-#include <stdbool.h>
-
/* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true,
or clear the flag if VALUE is false.
Return 0 on success, or -1 on error with 'errno' set.
diff --git a/lib/close.c b/lib/close.c
index 44990ba71..3c1b09ea5 100644
--- a/lib/close.c
+++ b/lib/close.c
@@ -1,5 +1,5 @@
/* close replacement.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/concat-filename.c b/lib/concat-filename.c
index f05484904..62842a69c 100644
--- a/lib/concat-filename.c
+++ b/lib/concat-filename.c
@@ -1,5 +1,5 @@
/* Construct a full filename from a directory and a relative filename.
- Copyright (C) 2001-2004, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/concat-filename.h b/lib/concat-filename.h
index 0348b0d93..091222638 100644
--- a/lib/concat-filename.h
+++ b/lib/concat-filename.h
@@ -1,5 +1,5 @@
/* Construct a full filename from a directory and a relative filename.
- Copyright (C) 2001-2004, 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/connect.c b/lib/connect.c
index d1600634e..1ac4a74bd 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -1,6 +1,6 @@
/* connect.c --- wrappers for Windows connect function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/copysign.c b/lib/copysign.c
index 613346574..c99b2ed88 100644
--- a/lib/copysign.c
+++ b/lib/copysign.c
@@ -1,5 +1,5 @@
/* Copy sign into another 'double' number.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/dirent.in.h b/lib/dirent.in.h
index f28288d1a..2aaabd054 100644
--- a/lib/dirent.in.h
+++ b/lib/dirent.in.h
@@ -1,5 +1,5 @@
/* A GNU-like <dirent.h>.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/dirfd.c b/lib/dirfd.c
index 4104683fb..b2b1d25cd 100644
--- a/lib/dirfd.c
+++ b/lib/dirfd.c
@@ -1,6 +1,6 @@
/* dirfd.c -- return the file descriptor associated with an open DIR*
- Copyright (C) 2001, 2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2006, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/dirname-lgpl.c b/lib/dirname-lgpl.c
index d54f6a910..e9454af39 100644
--- a/lib/dirname-lgpl.c
+++ b/lib/dirname-lgpl.c
@@ -1,6 +1,6 @@
/* dirname.c -- return all but the last element in a file name
- Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2022 Free Software
+ Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/dirname.h b/lib/dirname.h
index e18a97ea1..f98e83bd4 100644
--- a/lib/dirname.h
+++ b/lib/dirname.h
@@ -1,6 +1,6 @@
/* Take file names apart into directory and base names.
- Copyright (C) 1998, 2001, 2003-2006, 2009-2022 Free Software Foundation,
+ Copyright (C) 1998, 2001, 2003-2006, 2009-2023 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
@@ -19,7 +19,6 @@
#ifndef DIRNAME_H_
# define DIRNAME_H_ 1
-# include <stdbool.h>
# include <stdlib.h>
# include "filename.h"
# include "basename-lgpl.h"
diff --git a/lib/dup2.c b/lib/dup2.c
index 1c766ab38..7d197ca31 100644
--- a/lib/dup2.c
+++ b/lib/dup2.c
@@ -1,6 +1,6 @@
/* Duplicate an open file descriptor to a specified file descriptor.
- Copyright (C) 1999, 2004-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004-2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/duplocale.c b/lib/duplocale.c
index 0ecd989cd..fcb2c5876 100644
--- a/lib/duplocale.c
+++ b/lib/duplocale.c
@@ -1,5 +1,5 @@
/* Duplicate a locale object.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/dynarray.h b/lib/dynarray.h
index ca6439d3a..915591093 100644
--- a/lib/dynarray.h
+++ b/lib/dynarray.h
@@ -1,5 +1,5 @@
/* Type-safe arrays which grow dynamically.
- Copyright 2021-2022 Free Software Foundation, Inc.
+ Copyright 2021-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/eloop-threshold.h b/lib/eloop-threshold.h
index 8b3145711..510f26179 100644
--- a/lib/eloop-threshold.h
+++ b/lib/eloop-threshold.h
@@ -1,5 +1,5 @@
/* Threshold at which to diagnose ELOOP. Generic version.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 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
diff --git a/lib/errno.in.h b/lib/errno.in.h
index 3ec184569..3dda9c260 100644
--- a/lib/errno.in.h
+++ b/lib/errno.in.h
@@ -1,6 +1,6 @@
/* A POSIX-like <errno.h>.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/fcntl.c b/lib/fcntl.c
index f9753c403..e22080084 100644
--- a/lib/fcntl.c
+++ b/lib/fcntl.c
@@ -1,6 +1,6 @@
/* Provide file descriptor control.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index 9270ced89..e034eaf9f 100644
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -1,6 +1,6 @@
/* Like <fcntl.h>, but with non-working flags defined to 0.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/fd-hook.c b/lib/fd-hook.c
index 64a7a80c0..362611507 100644
--- a/lib/fd-hook.c
+++ b/lib/fd-hook.c
@@ -1,5 +1,5 @@
/* Hook for making file descriptor functions close(), ioctl() extensible.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/fd-hook.h b/lib/fd-hook.h
index d6c4964d1..6bf3c24da 100644
--- a/lib/fd-hook.h
+++ b/lib/fd-hook.h
@@ -1,5 +1,5 @@
/* Hook for making file descriptor functions close(), ioctl() extensible.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/filename.h b/lib/filename.h
index ab77ca2df..a2400a9df 100644
--- a/lib/filename.h
+++ b/lib/filename.h
@@ -1,5 +1,5 @@
/* Basic filename support macros.
- Copyright (C) 2001-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2023 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
diff --git a/lib/findprog-in.c b/lib/findprog-in.c
index 72a05dbf5..c0768c29e 100644
--- a/lib/findprog-in.c
+++ b/lib/findprog-in.c
@@ -1,5 +1,5 @@
/* Locating a program in a given path.
- Copyright (C) 2001-2004, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2023 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001, 2019.
This file is free software: you can redistribute it and/or modify
@@ -22,7 +22,6 @@
#include "findprog.h"
#include <errno.h>
-#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
diff --git a/lib/findprog.h b/lib/findprog.h
index e47acc5e4..6223394a4 100644
--- a/lib/findprog.h
+++ b/lib/findprog.h
@@ -1,5 +1,5 @@
/* Locating a program in PATH.
- Copyright (C) 2001-2003, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This file is free software: you can redistribute it and/or modify
@@ -18,8 +18,6 @@
#ifndef _FINDPROG_H
#define _FINDPROG_H
-#include <stdbool.h>
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/lib/flexmember.h b/lib/flexmember.h
index 1545639f7..a6cc876a6 100644
--- a/lib/flexmember.h
+++ b/lib/flexmember.h
@@ -1,6 +1,6 @@
/* Sizes of structs with flexible array members.
- Copyright 2016-2022 Free Software Foundation, Inc.
+ Copyright 2016-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/lib/float+.h b/lib/float+.h
index 9ab45208d..e7531e46a 100644
--- a/lib/float+.h
+++ b/lib/float+.h
@@ -1,5 +1,5 @@
/* Supplemental information about the floating-point formats.
- Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/float.c b/lib/float.c
index de8506450..f81ff33d3 100644
--- a/lib/float.c
+++ b/lib/float.c
@@ -1,5 +1,5 @@
/* Auxiliary definitions for <float.h>.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/float.in.h b/lib/float.in.h
index a4183765d..bf2c502c7 100644
--- a/lib/float.in.h
+++ b/lib/float.in.h
@@ -1,6 +1,6 @@
/* A correct <float.h>.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/flock.c b/lib/flock.c
index 28773d5c3..85433e72b 100644
--- a/lib/flock.c
+++ b/lib/flock.c
@@ -6,7 +6,7 @@
Written by Richard W.M. Jones <rjones.at.redhat.com>
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/lib/floor.c b/lib/floor.c
index 3e4f8d058..238f48799 100644
--- a/lib/floor.c
+++ b/lib/floor.c
@@ -1,5 +1,5 @@
/* Round towards negative infinity.
- Copyright (C) 2007, 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2010-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/free.c b/lib/free.c
index 86ebe6c63..372a6b0fe 100644
--- a/lib/free.c
+++ b/lib/free.c
@@ -1,6 +1,6 @@
/* Make free() preserve errno.
- Copyright (C) 2003, 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/frexp.c b/lib/frexp.c
index 2c15733e2..78d627b58 100644
--- a/lib/frexp.c
+++ b/lib/frexp.c
@@ -1,5 +1,5 @@
/* Split a double into fraction and mantissa.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/fstat.c b/lib/fstat.c
index 3928c8602..6a235002e 100644
--- a/lib/fstat.c
+++ b/lib/fstat.c
@@ -1,5 +1,5 @@
/* fstat() replacement.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/fsync.c b/lib/fsync.c
index 9b561ab96..513146628 100644
--- a/lib/fsync.c
+++ b/lib/fsync.c
@@ -7,7 +7,7 @@
Written by Richard W.M. Jones <rjones.at.redhat.com>
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/full-read.c b/lib/full-read.c
index 7b5308771..9a7597122 100644
--- a/lib/full-read.c
+++ b/lib/full-read.c
@@ -1,5 +1,5 @@
/* An interface to read that retries after partial reads and interrupts.
- Copyright (C) 2002-2003, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/full-read.h b/lib/full-read.h
index b30c68ad5..416378e35 100644
--- a/lib/full-read.h
+++ b/lib/full-read.h
@@ -1,6 +1,6 @@
/* An interface to read() that reads all it is asked to read.
- Copyright (C) 2002, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/full-write.c b/lib/full-write.c
index 2d593727c..830bcf882 100644
--- a/lib/full-write.c
+++ b/lib/full-write.c
@@ -1,6 +1,6 @@
/* An interface to read and write that retries (if necessary) until complete.
- Copyright (C) 1993-1994, 1997-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1993-1994, 1997-2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/full-write.h b/lib/full-write.h
index 7e006d1f4..1bedb018e 100644
--- a/lib/full-write.h
+++ b/lib/full-write.h
@@ -1,6 +1,6 @@
/* An interface to write() that writes all it is asked to write.
- Copyright (C) 2002-2003, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/gai_strerror.c b/lib/gai_strerror.c
index c7eedb2f3..3436c07ac 100644
--- a/lib/gai_strerror.c
+++ b/lib/gai_strerror.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2022 Free Software
+/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2023 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
diff --git a/lib/getaddrinfo.c b/lib/getaddrinfo.c
index 392289858..6586ee58b 100644
--- a/lib/getaddrinfo.c
+++ b/lib/getaddrinfo.c
@@ -1,5 +1,5 @@
/* Get address information (partial implementation).
- Copyright (C) 1997, 2001-2002, 2004-2022 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2001-2002, 2004-2023 Free Software Foundation, Inc.
Contributed by Simon Josefsson <simon@josefsson.org>.
This file is free software: you can redistribute it and/or modify
@@ -39,8 +39,6 @@
/* Get snprintf. */
#include <stdio.h>
-#include <stdbool.h>
-
#include "gettext.h"
#define _(String) gettext (String)
#define N_(String) String
diff --git a/lib/getdtablesize.c b/lib/getdtablesize.c
index 793e0f889..ac2d1753a 100644
--- a/lib/getdtablesize.c
+++ b/lib/getdtablesize.c
@@ -1,5 +1,5 @@
/* getdtablesize() function: Return maximum possible file descriptor value + 1.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/getlogin.c b/lib/getlogin.c
index 97b6ed659..2baf826f2 100644
--- a/lib/getlogin.c
+++ b/lib/getlogin.c
@@ -1,6 +1,6 @@
/* Provide a working getlogin for systems which lack it.
- Copyright (C) 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2010-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/getpeername.c b/lib/getpeername.c
index ac4926f38..70ffc0b61 100644
--- a/lib/getpeername.c
+++ b/lib/getpeername.c
@@ -1,6 +1,6 @@
/* getpeername.c --- wrappers for Windows getpeername function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/getrandom.c b/lib/getrandom.c
index e14687309..19bb3429b 100644
--- a/lib/getrandom.c
+++ b/lib/getrandom.c
@@ -1,6 +1,6 @@
/* Obtain a series of random bytes.
- Copyright 2020-2022 Free Software Foundation, Inc.
+ Copyright 2020-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -23,7 +23,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <stdbool.h>
#include <unistd.h>
#if defined _WIN32 && ! defined __CYGWIN__
diff --git a/lib/getsockname.c b/lib/getsockname.c
index 3ab3a7545..263b91220 100644
--- a/lib/getsockname.c
+++ b/lib/getsockname.c
@@ -1,6 +1,6 @@
/* getsockname.c --- wrappers for Windows getsockname function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/getsockopt.c b/lib/getsockopt.c
index 9c87afadb..565c38ef0 100644
--- a/lib/getsockopt.c
+++ b/lib/getsockopt.c
@@ -1,6 +1,6 @@
/* getsockopt.c --- wrappers for Windows getsockopt function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/gettext.h b/lib/gettext.h
index b3577a043..d0462c47e 100644
--- a/lib/gettext.h
+++ b/lib/gettext.h
@@ -1,5 +1,5 @@
/* Convenience header for conditional use of GNU <libintl.h>.
- Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2022 Free Software
+ Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/hard-locale.c b/lib/hard-locale.c
index f7fbc470b..c01fce534 100644
--- a/lib/hard-locale.c
+++ b/lib/hard-locale.c
@@ -1,6 +1,6 @@
/* hard-locale.c -- Determine whether a locale is hard.
- Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2022 Free Software
+ Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
@@ -21,6 +21,7 @@
#include "hard-locale.h"
#include <locale.h>
+#include <stdlib.h>
#include <string.h>
bool
@@ -31,5 +32,16 @@ hard_locale (int category)
if (setlocale_null_r (category, locale, sizeof (locale)))
return false;
- return !(strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0);
+ if (!(strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0))
+ return true;
+
+#if defined __ANDROID__
+ /* On Android 5.0 or newer, it is possible to set a locale that has the same
+ name as the "C" locale but in fact uses UTF-8 encoding. Cf. test case 2 in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2023-01/msg00141.html>. */
+ if (MB_CUR_MAX > 1)
+ return true;
+#endif
+
+ return false;
}
diff --git a/lib/hard-locale.h b/lib/hard-locale.h
index 6066f4ed4..880c9e85d 100644
--- a/lib/hard-locale.h
+++ b/lib/hard-locale.h
@@ -1,6 +1,6 @@
/* Determine whether a locale is hard.
- Copyright (C) 1999, 2003-2004, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2003-2004, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -18,8 +18,6 @@
#ifndef HARD_LOCALE_H_
# define HARD_LOCALE_H_ 1
-# include <stdbool.h>
-
/* Return true if the specified CATEGORY of the current locale is hard, i.e.
different from the C or POSIX locale that has a fixed behavior.
CATEGORY must be one of the LC_* values, but not LC_ALL. */
diff --git a/lib/iconv.c b/lib/iconv.c
index efab53d88..9f6f7a90f 100644
--- a/lib/iconv.c
+++ b/lib/iconv.c
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 1999-2001, 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999-2001, 2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/iconv.in.h b/lib/iconv.in.h
index 4c5a31c3b..09943a72c 100644
--- a/lib/iconv.in.h
+++ b/lib/iconv.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <iconv.h>.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/iconv_close.c b/lib/iconv_close.c
index 2d7fb17ef..41ea96e79 100644
--- a/lib/iconv_close.c
+++ b/lib/iconv_close.c
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/iconv_open-aix.gperf b/lib/iconv_open-aix.gperf
index 024da2158..c1625d1d5 100644
--- a/lib/iconv_open-aix.gperf
+++ b/lib/iconv_open-aix.gperf
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2020-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2020-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/iconv_open-hpux.gperf b/lib/iconv_open-hpux.gperf
index 12057505d..691995c83 100644
--- a/lib/iconv_open-hpux.gperf
+++ b/lib/iconv_open-hpux.gperf
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2020-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2020-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/iconv_open-irix.gperf b/lib/iconv_open-irix.gperf
index 92a2689df..a6b84f91f 100644
--- a/lib/iconv_open-irix.gperf
+++ b/lib/iconv_open-irix.gperf
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2020-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2020-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/iconv_open-osf.gperf b/lib/iconv_open-osf.gperf
index 746f56302..9cffd4802 100644
--- a/lib/iconv_open-osf.gperf
+++ b/lib/iconv_open-osf.gperf
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2020-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2020-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/iconv_open-solaris.gperf b/lib/iconv_open-solaris.gperf
index fbd6f9d74..c52268335 100644
--- a/lib/iconv_open-solaris.gperf
+++ b/lib/iconv_open-solaris.gperf
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2009, 2020-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009, 2020-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/iconv_open-zos.gperf b/lib/iconv_open-zos.gperf
index 6912485e1..f188e1392 100644
--- a/lib/iconv_open-zos.gperf
+++ b/lib/iconv_open-zos.gperf
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/iconv_open.c b/lib/iconv_open.c
index 02c240ee9..be70de2b7 100644
--- a/lib/iconv_open.c
+++ b/lib/iconv_open.c
@@ -1,5 +1,5 @@
/* Character set conversion.
- Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/iconveh.h b/lib/iconveh.h
index 058f68ca2..2220d36e1 100644
--- a/lib/iconveh.h
+++ b/lib/iconveh.h
@@ -1,5 +1,5 @@
/* Character set conversion handler type.
- Copyright (C) 2001-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2007, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/idx.h b/lib/idx.h
index c3669ddac..23020b7ec 100644
--- a/lib/idx.h
+++ b/lib/idx.h
@@ -1,5 +1,5 @@
/* A type for indices and sizes.
- Copyright (C) 2020-2022 Free Software Foundation, Inc.
+ Copyright (C) 2020-2023 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
diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c
index 2d401d22b..9e2d412e7 100644
--- a/lib/inet_ntop.c
+++ b/lib/inet_ntop.c
@@ -1,6 +1,6 @@
/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
- Copyright (C) 2005-2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/inet_pton.c b/lib/inet_pton.c
index a239b7d1e..49a27bb5b 100644
--- a/lib/inet_pton.c
+++ b/lib/inet_pton.c
@@ -1,6 +1,6 @@
/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
- Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/intprops-internal.h b/lib/intprops-internal.h
index f6455f785..0467a9ca8 100644
--- a/lib/intprops-internal.h
+++ b/lib/intprops-internal.h
@@ -1,6 +1,6 @@
/* intprops-internal.h -- properties of integer types not visible to users
- Copyright (C) 2001-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
diff --git a/lib/intprops.h b/lib/intprops.h
index f182ddc1f..44b5e60fb 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -1,6 +1,6 @@
/* intprops.h -- properties of integer types
- Copyright (C) 2001-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h
index 853eca087..50a2bbfcd 100644
--- a/lib/inttypes.in.h
+++ b/lib/inttypes.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2023 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Derek Price.
This file is part of gnulib.
diff --git a/lib/isfinite.c b/lib/isfinite.c
index c3a0da57c..a81b9385e 100644
--- a/lib/isfinite.c
+++ b/lib/isfinite.c
@@ -1,5 +1,5 @@
/* Test for finite value (zero, subnormal, or normal, and not infinite or NaN).
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/isinf.c b/lib/isinf.c
index c3a505304..2be6c68a4 100644
--- a/lib/isinf.c
+++ b/lib/isinf.c
@@ -1,5 +1,5 @@
/* Test for positive or negative infinity.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/isnan.c b/lib/isnan.c
index bd119f691..7119bb298 100644
--- a/lib/isnan.c
+++ b/lib/isnan.c
@@ -1,5 +1,5 @@
/* Test for NaN that does not need libm.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/isnand-nolibm.h b/lib/isnand-nolibm.h
index aad139159..9c75a8c47 100644
--- a/lib/isnand-nolibm.h
+++ b/lib/isnand-nolibm.h
@@ -1,5 +1,5 @@
/* Test for NaN that does not need libm.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/isnand.c b/lib/isnand.c
index 26501b5d6..e14d2e6fb 100644
--- a/lib/isnand.c
+++ b/lib/isnand.c
@@ -1,5 +1,5 @@
/* Test for NaN that does not need libm.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/isnanf-nolibm.h b/lib/isnanf-nolibm.h
index 4ce81d6cd..cc6b4198f 100644
--- a/lib/isnanf-nolibm.h
+++ b/lib/isnanf-nolibm.h
@@ -1,5 +1,5 @@
/* Test for NaN that does not need libm.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/isnanf.c b/lib/isnanf.c
index e8b721acf..55252ca6d 100644
--- a/lib/isnanf.c
+++ b/lib/isnanf.c
@@ -1,5 +1,5 @@
/* Test for NaN that does not need libm.
- Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/isnanl-nolibm.h b/lib/isnanl-nolibm.h
index a4374e70d..f04c489bb 100644
--- a/lib/isnanl-nolibm.h
+++ b/lib/isnanl-nolibm.h
@@ -1,5 +1,5 @@
/* Test for NaN that does not need libm.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/isnanl.c b/lib/isnanl.c
index 2f71d6c3e..286f24509 100644
--- a/lib/isnanl.c
+++ b/lib/isnanl.c
@@ -1,5 +1,5 @@
/* Test for NaN that does not need libm.
- Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/itold.c b/lib/itold.c
index fe4a38423..0ef4464ee 100644
--- a/lib/itold.c
+++ b/lib/itold.c
@@ -1,5 +1,5 @@
/* Replacement for 'int' to 'long double' conversion routine.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/langinfo.in.h b/lib/langinfo.in.h
index 98aea6a84..c7555a6a5 100644
--- a/lib/langinfo.in.h
+++ b/lib/langinfo.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <langinfo.h>.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/lc-charset-dispatch.c b/lib/lc-charset-dispatch.c
index 66d78fd3e..cd74466b4 100644
--- a/lib/lc-charset-dispatch.c
+++ b/lib/lc-charset-dispatch.c
@@ -1,5 +1,5 @@
/* Dispatching based on the current locale's character encoding.
- Copyright (C) 2018-2022 Free Software Foundation, Inc.
+ Copyright (C) 2018-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/lc-charset-dispatch.h b/lib/lc-charset-dispatch.h
index 3867c3232..c82b6a609 100644
--- a/lib/lc-charset-dispatch.h
+++ b/lib/lc-charset-dispatch.h
@@ -1,5 +1,5 @@
/* Dispatching based on the current locale's character encoding.
- Copyright (C) 2018-2022 Free Software Foundation, Inc.
+ Copyright (C) 2018-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/libc-config.h b/lib/libc-config.h
index a56665b1c..1d28e58c9 100644
--- a/lib/libc-config.h
+++ b/lib/libc-config.h
@@ -1,6 +1,6 @@
/* System definitions for code taken from the GNU C Library
- Copyright 2017-2022 Free Software Foundation, Inc.
+ Copyright 2017-2023 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/lib/libunistring.valgrind b/lib/libunistring.valgrind
index 630ded08b..c2c58208d 100644
--- a/lib/libunistring.valgrind
+++ b/lib/libunistring.valgrind
@@ -1,6 +1,6 @@
# Suppress valgrind messages in an installed libunistring.
-# Copyright (C) 2010-2022 Free Software Foundation, Inc.
+# Copyright (C) 2010-2023 Free Software Foundation, Inc.
#
# This file is free software.
# It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+".
diff --git a/lib/limits.in.h b/lib/limits.in.h
index b77bf75c5..eaeac4722 100644
--- a/lib/limits.in.h
+++ b/lib/limits.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <limits.h>.
- Copyright 2016-2022 Free Software Foundation, Inc.
+ Copyright 2016-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -99,7 +99,7 @@
# endif
#endif
-/* Macros specified by C2x and by ISO/IEC TS 18661-1:2014. */
+/* Macros specified by C23 and by ISO/IEC TS 18661-1:2014. */
#if (! defined ULLONG_WIDTH \
&& (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__ \
@@ -117,7 +117,7 @@
# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX)
#endif
-/* Macros specified by C2x. */
+/* Macros specified by C23. */
#if (! defined BOOL_WIDTH \
&& (defined _GNU_SOURCE \
diff --git a/lib/link.c b/lib/link.c
index 2023d75bc..2c81e2f2e 100644
--- a/lib/link.c
+++ b/lib/link.c
@@ -1,6 +1,6 @@
/* Emulate link on platforms that lack it, namely native Windows platforms.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/listen.c b/lib/listen.c
index e67bdc9e9..85600fa8d 100644
--- a/lib/listen.c
+++ b/lib/listen.c
@@ -1,6 +1,6 @@
/* listen.c --- wrappers for Windows listen function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/localcharset.c b/lib/localcharset.c
index 383e50f70..efaa2a8a1 100644
--- a/lib/localcharset.c
+++ b/lib/localcharset.c
@@ -1,6 +1,6 @@
/* Determine a canonical name for the current locale's character encoding.
- Copyright (C) 2000-2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2006, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/localcharset.h b/lib/localcharset.h
index 14b4c7ef4..ce677f1e3 100644
--- a/lib/localcharset.h
+++ b/lib/localcharset.h
@@ -1,5 +1,5 @@
/* Determine a canonical name for the current locale's character encoding.
- Copyright (C) 2000-2003, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2003, 2009-2023 Free Software Foundation, Inc.
This file is part of the GNU CHARSET Library.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/locale.in.h b/lib/locale.in.h
index 4aef74d48..538b83412 100644
--- a/lib/locale.in.h
+++ b/lib/locale.in.h
@@ -1,5 +1,5 @@
/* A POSIX <locale.h>.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/localeconv.c b/lib/localeconv.c
index ef261205d..60c050f48 100644
--- a/lib/localeconv.c
+++ b/lib/localeconv.c
@@ -1,5 +1,5 @@
/* Query locale dependent information for formatting numbers.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/log.c b/lib/log.c
index 84ff5e9f7..9289cf018 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -1,5 +1,5 @@
/* Logarithm.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/log1p.c b/lib/log1p.c
index 31070a37b..056808307 100644
--- a/lib/log1p.c
+++ b/lib/log1p.c
@@ -1,5 +1,5 @@
/* Natural logarithm of 1 plus argument.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/lstat.c b/lib/lstat.c
index 472bfbceb..00a4ce2ab 100644
--- a/lib/lstat.c
+++ b/lib/lstat.c
@@ -1,6 +1,6 @@
/* Work around a bug of lstat on some systems
- Copyright (C) 1997-2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 1997-2006, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/malloc.c b/lib/malloc.c
index f334dd6e9..3ade35cb6 100644
--- a/lib/malloc.c
+++ b/lib/malloc.c
@@ -1,6 +1,6 @@
/* malloc() function that is glibc compatible.
- Copyright (C) 1997-1998, 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 1997-1998, 2006-2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/malloc/dynarray-skeleton.c b/lib/malloc/dynarray-skeleton.c
index bad548a49..580c278b7 100644
--- a/lib/malloc/dynarray-skeleton.c
+++ b/lib/malloc/dynarray-skeleton.c
@@ -1,5 +1,5 @@
/* Type-safe arrays which grow dynamically.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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
diff --git a/lib/malloc/dynarray.h b/lib/malloc/dynarray.h
index f16fd950d..a9a3b0859 100644
--- a/lib/malloc/dynarray.h
+++ b/lib/malloc/dynarray.h
@@ -1,5 +1,5 @@
/* Type-safe arrays which grow dynamically. Shared definitions.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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
@@ -94,7 +94,6 @@
#ifndef _DYNARRAY_H
#define _DYNARRAY_H
-#include <stdbool.h>
#include <stddef.h>
#include <string.h>
diff --git a/lib/malloc/dynarray_at_failure.c b/lib/malloc/dynarray_at_failure.c
index 062ab7062..ebc931098 100644
--- a/lib/malloc/dynarray_at_failure.c
+++ b/lib/malloc/dynarray_at_failure.c
@@ -1,5 +1,5 @@
/* Report an dynamic array index out of bounds condition.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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
diff --git a/lib/malloc/dynarray_emplace_enlarge.c b/lib/malloc/dynarray_emplace_enlarge.c
index 0cff2e705..7da539316 100644
--- a/lib/malloc/dynarray_emplace_enlarge.c
+++ b/lib/malloc/dynarray_emplace_enlarge.c
@@ -1,5 +1,5 @@
/* Increase the size of a dynamic array in preparation of an emplace operation.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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
diff --git a/lib/malloc/dynarray_finalize.c b/lib/malloc/dynarray_finalize.c
index 3f360c3aa..673595a5f 100644
--- a/lib/malloc/dynarray_finalize.c
+++ b/lib/malloc/dynarray_finalize.c
@@ -1,5 +1,5 @@
/* Copy the dynamically-allocated area to an explicitly-sized heap allocation.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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
diff --git a/lib/malloc/dynarray_resize.c b/lib/malloc/dynarray_resize.c
index 8d1922e5c..7ecd4de63 100644
--- a/lib/malloc/dynarray_resize.c
+++ b/lib/malloc/dynarray_resize.c
@@ -1,5 +1,5 @@
/* Increase the size of a dynamic array.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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
diff --git a/lib/malloc/dynarray_resize_clear.c b/lib/malloc/dynarray_resize_clear.c
index 8cf1b0d02..bb23c522a 100644
--- a/lib/malloc/dynarray_resize_clear.c
+++ b/lib/malloc/dynarray_resize_clear.c
@@ -1,5 +1,5 @@
/* Increase the size of a dynamic array and clear the new part.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 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
diff --git a/lib/malloc/scratch_buffer.h b/lib/malloc/scratch_buffer.h
index e4c5c8a85..33fd2b29c 100644
--- a/lib/malloc/scratch_buffer.h
+++ b/lib/malloc/scratch_buffer.h
@@ -1,5 +1,5 @@
/* Variable-sized buffer with on-stack default allocation.
- Copyright (C) 2015-2022 Free Software Foundation, Inc.
+ Copyright (C) 2015-2023 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
@@ -132,20 +132,4 @@ scratch_buffer_set_array_size (struct scratch_buffer *buffer,
(buffer, nelem, size));
}
-/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block,
- deallocating *BUFFER if it was heap-allocated. SIZE must be at
- most *BUFFER's size. Return NULL (setting errno) on memory
- exhaustion. */
-void *__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer,
- size_t size);
-libc_hidden_proto (__libc_scratch_buffer_dupfree)
-
-/* Alias for __libc_scratch_dupfree. */
-static __always_inline void *
-scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size)
-{
- void *r = __libc_scratch_buffer_dupfree (buffer, size);
- return __glibc_likely (r != NULL) ? r : NULL;
-}
-
#endif /* _SCRATCH_BUFFER_H */
diff --git a/lib/malloc/scratch_buffer_dupfree.c b/lib/malloc/scratch_buffer_dupfree.c
deleted file mode 100644
index eb3b95c1b..000000000
--- a/lib/malloc/scratch_buffer_dupfree.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Variable-sized buffer with on-stack default allocation.
- Copyright (C) 2020-2022 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 Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU 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
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
-
-#ifndef _LIBC
-# include <libc-config.h>
-#endif
-
-#include <scratch_buffer.h>
-#include <string.h>
-
-void *
-__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size)
-{
- void *data = buffer->data;
- if (data == buffer->__space.__c)
- {
- void *copy = malloc (size);
- return copy != NULL ? memcpy (copy, data, size) : NULL;
- }
- else
- {
- void *copy = realloc (data, size);
- return copy != NULL ? copy : data;
- }
-}
-libc_hidden_def (__libc_scratch_buffer_dupfree)
diff --git a/lib/malloc/scratch_buffer_grow.c b/lib/malloc/scratch_buffer_grow.c
index 9a5e4dbb1..a5e8f2f72 100644
--- a/lib/malloc/scratch_buffer_grow.c
+++ b/lib/malloc/scratch_buffer_grow.c
@@ -1,5 +1,5 @@
/* Variable-sized buffer with on-stack default allocation.
- Copyright (C) 2015-2022 Free Software Foundation, Inc.
+ Copyright (C) 2015-2023 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
diff --git a/lib/malloc/scratch_buffer_grow_preserve.c b/lib/malloc/scratch_buffer_grow_preserve.c
index 3fe5a0720..c0b5d87b7 100644
--- a/lib/malloc/scratch_buffer_grow_preserve.c
+++ b/lib/malloc/scratch_buffer_grow_preserve.c
@@ -1,5 +1,5 @@
/* Variable-sized buffer with on-stack default allocation.
- Copyright (C) 2015-2022 Free Software Foundation, Inc.
+ Copyright (C) 2015-2023 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
diff --git a/lib/malloc/scratch_buffer_set_array_size.c b/lib/malloc/scratch_buffer_set_array_size.c
index 89c37a950..24c39350a 100644
--- a/lib/malloc/scratch_buffer_set_array_size.c
+++ b/lib/malloc/scratch_buffer_set_array_size.c
@@ -1,5 +1,5 @@
/* Variable-sized buffer with on-stack default allocation.
- Copyright (C) 2015-2022 Free Software Foundation, Inc.
+ Copyright (C) 2015-2023 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
diff --git a/lib/malloca.c b/lib/malloca.c
index 183783a71..f055b1e5c 100644
--- a/lib/malloca.c
+++ b/lib/malloca.c
@@ -1,5 +1,5 @@
/* Safe automatic memory allocation.
- Copyright (C) 2003, 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2007, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003, 2018.
This file is free software: you can redistribute it and/or modify
@@ -24,7 +24,6 @@
#include <stdckdint.h>
#include "idx.h"
-#include "verify.h"
/* The speed critical point in this file is freea() applied to an alloca()
result: it must be fast, to match the speed of alloca(). The speed of
@@ -40,7 +39,7 @@
/* Type for holding very small pointer differences. */
typedef unsigned char small_t;
/* Verify that it is wide enough. */
-verify (2 * sa_alignment_max - 1 <= (small_t) -1);
+static_assert (2 * sa_alignment_max - 1 <= (small_t) -1);
void *
mmalloca (size_t n)
diff --git a/lib/malloca.h b/lib/malloca.h
index 7ec235f37..325c72771 100644
--- a/lib/malloca.h
+++ b/lib/malloca.h
@@ -1,5 +1,5 @@
/* Safe automatic memory allocation.
- Copyright (C) 2003-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003-2007, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/math.c b/lib/math.c
index 1502a1fd6..67cabbcf8 100644
--- a/lib/math.c
+++ b/lib/math.c
@@ -1,6 +1,6 @@
/* Inline functions for <math.h>.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/math.in.h b/lib/math.in.h
index a74a95da3..a1cb22936 100644
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <math.h>.
- Copyright (C) 2002-2003, 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -15,6 +15,11 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+/* On Android, in C++ mode, when /usr/include/c++/v1/math.h is being included
+ and /usr/include/math.h has not yet been included, skip this file, since it
+ would lead to many syntax errors. */
+#if !(defined __ANDROID__ && defined _LIBCPP_MATH_H && !defined INFINITY)
+
#ifndef _@GUARD_PREFIX@_MATH_H
#if __GNUC__ >= 3
@@ -454,7 +459,9 @@ _GL_FUNCDECL_SYS (cbrtl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (cbrtl, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (cbrtl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef cbrtl
# if HAVE_RAW_DECL_CBRTL
@@ -567,7 +574,9 @@ _GL_WARN_ON_USE (copysign, "copysign is unportable - "
_GL_FUNCDECL_SYS (copysignl, long double, (long double x, long double y));
# endif
_GL_CXXALIAS_SYS (copysignl, long double, (long double x, long double y));
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (copysignl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef copysignl
# if HAVE_RAW_DECL_COPYSIGNL
@@ -749,7 +758,9 @@ _GL_FUNCDECL_SYS (exp2l, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (exp2l, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (exp2l);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef exp2l
# if HAVE_RAW_DECL_EXP2L
@@ -824,7 +835,9 @@ _GL_FUNCDECL_SYS (expm1l, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (expm1l, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (expm1l);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef expm1l
# if HAVE_RAW_DECL_EXPM1L
@@ -1016,7 +1029,9 @@ _GL_FUNCDECL_SYS (fmal, long double,
_GL_CXXALIAS_SYS (fmal, long double,
(long double x, long double y, long double z));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (fmal);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef fmal
# if HAVE_RAW_DECL_FMAL
@@ -1337,7 +1352,9 @@ _GL_FUNCDECL_SYS (ilogbl, int, (long double x));
# endif
_GL_CXXALIAS_SYS (ilogbl, int, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (ilogbl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef ilogbl
# if HAVE_RAW_DECL_ILOGBL
@@ -1652,7 +1669,9 @@ _GL_FUNCDECL_SYS (log1pl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (log1pl, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (log1pl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef log1pl
# if HAVE_RAW_DECL_LOG1PL
@@ -1726,7 +1745,9 @@ _GL_FUNCDECL_SYS (log2l, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (log2l, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (log2l);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef log2l
# if HAVE_RAW_DECL_LOG2L
@@ -1798,7 +1819,9 @@ _GL_FUNCDECL_SYS (logbl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (logbl, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (logbl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef logbl
# if HAVE_RAW_DECL_LOGBL
@@ -1964,7 +1987,9 @@ _GL_FUNCDECL_SYS (remainderl, long double, (long double x, long double y));
# endif
_GL_CXXALIAS_SYS (remainderl, long double, (long double x, long double y));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (remainderl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef remainderl
# if HAVE_RAW_DECL_REMAINDERL
@@ -2018,7 +2043,9 @@ _GL_FUNCDECL_SYS (rintl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (rintl, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (rintl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef rintl
# if HAVE_RAW_DECL_RINTL
@@ -2093,7 +2120,9 @@ _GL_FUNCDECL_SYS (roundl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (roundl, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (roundl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef roundl
# if HAVE_RAW_DECL_ROUNDL
@@ -2350,7 +2379,9 @@ _GL_FUNCDECL_SYS (truncl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (truncl, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (truncl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef truncl
# if HAVE_RAW_DECL_TRUNCL
@@ -2591,7 +2622,7 @@ _GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
# if defined isnan || defined GNULIB_NAMESPACE
_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan)
# undef isnan
-# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__ && __clang_major__ < 12) || (defined __FreeBSD__ && __clang_major__ < 7) || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__)))
+# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__ && __clang_major__ < 12) || (defined __FreeBSD__ && (__clang_major__ < 7 || __clang_major__ >= 11)) || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__)))
/* This platform's <cmath> possibly defines isnan through a set of inline
functions. */
_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, rpl_isnan, bool)
@@ -2699,3 +2730,4 @@ _GL_INLINE_HEADER_END
#endif /* _@GUARD_PREFIX@_MATH_H */
#endif /* _GL_INCLUDING_MATH_H */
#endif /* _@GUARD_PREFIX@_MATH_H */
+#endif
diff --git a/lib/mbrtowc-impl-utf8.h b/lib/mbrtowc-impl-utf8.h
index 8e5ac14ea..4fdd65d84 100644
--- a/lib/mbrtowc-impl-utf8.h
+++ b/lib/mbrtowc-impl-utf8.h
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 1999-2002, 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2005-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/mbrtowc-impl.h b/lib/mbrtowc-impl.h
index 65538e744..e9c04ed77 100644
--- a/lib/mbrtowc-impl.h
+++ b/lib/mbrtowc-impl.h
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 1999-2002, 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2005-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/mbrtowc.c b/lib/mbrtowc.c
index 4b164edd4..c1a689a27 100644
--- a/lib/mbrtowc.c
+++ b/lib/mbrtowc.c
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 1999-2002, 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2005-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
@@ -51,11 +51,10 @@
# endif
# include "attribute.h"
-# include "verify.h"
# include "lc-charset-dispatch.h"
# include "mbtowc-lock.h"
-verify (sizeof (mbstate_t) >= 4);
+static_assert (sizeof (mbstate_t) >= 4);
static char internal_state[4];
size_t
diff --git a/lib/mbsinit.c b/lib/mbsinit.c
index 9621defc7..6e600798d 100644
--- a/lib/mbsinit.c
+++ b/lib/mbsinit.c
@@ -1,5 +1,5 @@
/* Test for initial conversion state.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
@@ -20,7 +20,6 @@
/* Specification. */
#include <wchar.h>
-#include "verify.h"
#if GNULIB_defined_mbstate_t
@@ -39,7 +38,7 @@
- In wc -> mb direction, mbstate_t contains no information. In other
words, it is always in the initial state. */
-verify (sizeof (mbstate_t) >= 4);
+static_assert (sizeof (mbstate_t) >= 4);
int
mbsinit (const mbstate_t *ps)
diff --git a/lib/mbtowc-impl.h b/lib/mbtowc-impl.h
index 2b27bafd6..39b977beb 100644
--- a/lib/mbtowc-impl.h
+++ b/lib/mbtowc-impl.h
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/mbtowc-lock.c b/lib/mbtowc-lock.c
index 06d32246d..6ca6e10f9 100644
--- a/lib/mbtowc-lock.c
+++ b/lib/mbtowc-lock.c
@@ -1,5 +1,5 @@
/* Return the internal lock used by mbrtowc and mbrtoc32.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/mbtowc-lock.h b/lib/mbtowc-lock.h
index ecfd44e8d..2dc22ace7 100644
--- a/lib/mbtowc-lock.h
+++ b/lib/mbtowc-lock.h
@@ -1,5 +1,5 @@
/* Use the internal lock used by mbrtowc and mbrtoc32.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/mbtowc.c b/lib/mbtowc.c
index a9a799510..8d9b06d24 100644
--- a/lib/mbtowc.c
+++ b/lib/mbtowc.c
@@ -1,5 +1,5 @@
/* Convert multibyte character to wide character.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/memchr.c b/lib/memchr.c
index 0ca7b30a4..8e9557937 100644
--- a/lib/memchr.c
+++ b/lib/memchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2022
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2023
Free Software Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
diff --git a/lib/memchr.valgrind b/lib/memchr.valgrind
index cb0f351cc..97690f2c5 100644
--- a/lib/memchr.valgrind
+++ b/lib/memchr.valgrind
@@ -1,6 +1,6 @@
# Suppress a valgrind message about use of uninitialized memory in memchr().
-# Copyright (C) 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2009-2023 Free Software Foundation, Inc.
#
# This file is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
diff --git a/lib/mempcpy.c b/lib/mempcpy.c
index 9aae418ef..24a313598 100644
--- a/lib/mempcpy.c
+++ b/lib/mempcpy.c
@@ -1,5 +1,5 @@
/* Copy memory area and return pointer after last written byte.
- Copyright (C) 2003, 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/minmax.h b/lib/minmax.h
index b4b1345bb..1fbfc6616 100644
--- a/lib/minmax.h
+++ b/lib/minmax.h
@@ -1,5 +1,5 @@
/* MIN, MAX macros.
- Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2022 Free Software
+ Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/mkdir.c b/lib/mkdir.c
index 490170181..f94aba173 100644
--- a/lib/mkdir.c
+++ b/lib/mkdir.c
@@ -1,7 +1,7 @@
/* On some systems, mkdir ("foo/", 0700) fails because of the trailing
slash. On those systems, this wrapper removes the trailing slash.
- Copyright (C) 2001, 2003, 2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003, 2006, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/mkostemp.c b/lib/mkostemp.c
index eae289aff..5cd5b3ac5 100644
--- a/lib/mkostemp.c
+++ b/lib/mkostemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2022 Free Software
+/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2023 Free Software
Foundation, Inc.
This file is derived from the one in the GNU C Library.
diff --git a/lib/mktime-internal.h b/lib/mktime-internal.h
index 170764eab..709c36bdf 100644
--- a/lib/mktime-internal.h
+++ b/lib/mktime-internal.h
@@ -1,5 +1,5 @@
/* Internals of mktime and related functions
- Copyright 2016-2022 Free Software Foundation, Inc.
+ Copyright 2016-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Eggert <eggert@cs.ucla.edu>.
diff --git a/lib/mktime.c b/lib/mktime.c
index 7dc9d67ef..94a4320e6 100644
--- a/lib/mktime.c
+++ b/lib/mktime.c
@@ -1,5 +1,5 @@
/* Convert a 'struct tm' to a time_t value.
- Copyright (C) 1993-2022 Free Software Foundation, Inc.
+ Copyright (C) 1993-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Eggert <eggert@twinsun.com>.
diff --git a/lib/msvc-inval.c b/lib/msvc-inval.c
index d6651caa8..c5149a8fd 100644
--- a/lib/msvc-inval.c
+++ b/lib/msvc-inval.c
@@ -1,5 +1,5 @@
/* Invalid parameter handler for MSVC runtime libraries.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/msvc-inval.h b/lib/msvc-inval.h
index 1230b8994..ed00461ff 100644
--- a/lib/msvc-inval.h
+++ b/lib/msvc-inval.h
@@ -1,5 +1,5 @@
/* Invalid parameter handler for MSVC runtime libraries.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/msvc-nothrow.c b/lib/msvc-nothrow.c
index aa069643f..f729fe66f 100644
--- a/lib/msvc-nothrow.c
+++ b/lib/msvc-nothrow.c
@@ -1,6 +1,6 @@
/* Wrappers that don't throw invalid parameter notifications
with MSVC runtime libraries.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/msvc-nothrow.h b/lib/msvc-nothrow.h
index 53451557e..82d3f6a2d 100644
--- a/lib/msvc-nothrow.h
+++ b/lib/msvc-nothrow.h
@@ -1,6 +1,6 @@
/* Wrappers that don't throw invalid parameter notifications
with MSVC runtime libraries.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/netdb.in.h b/lib/netdb.in.h
index e05cf4b13..9549cd732 100644
--- a/lib/netdb.in.h
+++ b/lib/netdb.in.h
@@ -1,5 +1,5 @@
/* Provide a netdb.h header file for systems lacking it (read: MinGW).
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
Written by Simon Josefsson.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/netinet_in.in.h b/lib/netinet_in.in.h
index e23807cac..f88923a3f 100644
--- a/lib/netinet_in.in.h
+++ b/lib/netinet_in.in.h
@@ -1,5 +1,5 @@
/* Substitute for <netinet/in.h>.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/nl_langinfo-lock.c b/lib/nl_langinfo-lock.c
index c36882d5c..e5cdcd3e7 100644
--- a/lib/nl_langinfo-lock.c
+++ b/lib/nl_langinfo-lock.c
@@ -1,5 +1,5 @@
/* Return the internal lock used by nl_langinfo.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/nl_langinfo.c b/lib/nl_langinfo.c
index 3fa478223..131166fd7 100644
--- a/lib/nl_langinfo.c
+++ b/lib/nl_langinfo.c
@@ -1,6 +1,6 @@
/* nl_langinfo() replacement: query locale dependent information.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/nproc.c b/lib/nproc.c
index 378d3ff3f..2740c458c 100644
--- a/lib/nproc.c
+++ b/lib/nproc.c
@@ -1,6 +1,6 @@
/* Detect the number of processors.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/nproc.h b/lib/nproc.h
index 505351d95..7b8b16d37 100644
--- a/lib/nproc.h
+++ b/lib/nproc.h
@@ -1,6 +1,6 @@
/* Detect the number of processors.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/nstrftime.c b/lib/nstrftime.c
index c1dd55424..68bb56091 100644
--- a/lib/nstrftime.c
+++ b/lib/nstrftime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify
@@ -65,7 +65,6 @@ extern char *tzname[];
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
-#include <stdbool.h>
#include "attribute.h"
#include <intprops.h>
diff --git a/lib/open.c b/lib/open.c
index 170bff108..7ec8fdc35 100644
--- a/lib/open.c
+++ b/lib/open.c
@@ -1,5 +1,5 @@
/* Open a descriptor to a file.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/pathmax.h b/lib/pathmax.h
index 19b93d7ea..0dd8f3bc5 100644
--- a/lib/pathmax.h
+++ b/lib/pathmax.h
@@ -1,5 +1,5 @@
/* Define PATH_MAX somehow. Requires sys/types.h.
- Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2022 Free Software
+ Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/pipe.c b/lib/pipe.c
index ce909b9f0..e8573ed97 100644
--- a/lib/pipe.c
+++ b/lib/pipe.c
@@ -1,5 +1,5 @@
/* Create a pipe.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/pipe2.c b/lib/pipe2.c
index 400aff001..8f06575a1 100644
--- a/lib/pipe2.c
+++ b/lib/pipe2.c
@@ -1,5 +1,5 @@
/* Create a pipe, with specific opening flags.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -23,7 +23,6 @@
#include <fcntl.h>
#include "binary-io.h"
-#include "verify.h"
#if GNULIB_defined_O_NONBLOCK
# include "nonblocking.h"
@@ -95,7 +94,7 @@ pipe2 (int fd[2], int flags)
}
# else
{
- verify (O_NONBLOCK == 0);
+ static_assert (O_NONBLOCK == 0);
}
# endif
diff --git a/lib/poll.c b/lib/poll.c
index 9cfde5f81..a0dc2c522 100644
--- a/lib/poll.c
+++ b/lib/poll.c
@@ -1,7 +1,7 @@
/* Emulation for poll(2)
Contributed by Paolo Bonzini.
- Copyright 2001-2003, 2006-2022 Free Software Foundation, Inc.
+ Copyright 2001-2003, 2006-2023 Free Software Foundation, Inc.
This file is part of gnulib.
diff --git a/lib/poll.in.h b/lib/poll.in.h
index 1af6a232f..9a15ef673 100644
--- a/lib/poll.in.h
+++ b/lib/poll.in.h
@@ -1,7 +1,7 @@
/* Header for poll(2) emulation
Contributed by Paolo Bonzini.
- Copyright 2001-2003, 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright 2001-2003, 2007, 2009-2023 Free Software Foundation, Inc.
This file is part of gnulib.
diff --git a/lib/printf-args.c b/lib/printf-args.c
index 669c24a40..5e14f6547 100644
--- a/lib/printf-args.c
+++ b/lib/printf-args.c
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2022 Free Software
+ Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/printf-args.h b/lib/printf-args.h
index 553fe9619..f303cb19e 100644
--- a/lib/printf-args.h
+++ b/lib/printf-args.h
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2022 Free Software
+ Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/printf-parse.c b/lib/printf-parse.c
index aab02dc5b..3040749ab 100644
--- a/lib/printf-parse.c
+++ b/lib/printf-parse.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999-2000, 2002-2003, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999-2000, 2002-2003, 2006-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/printf-parse.h b/lib/printf-parse.h
index b12ccea3c..1f86e32c9 100644
--- a/lib/printf-parse.h
+++ b/lib/printf-parse.h
@@ -1,5 +1,5 @@
/* Parse printf format string.
- Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2022 Free Software
+ Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/putenv.c b/lib/putenv.c
index b0d27e2f6..5d339407a 100644
--- a/lib/putenv.c
+++ b/lib/putenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2022 Free Software
+/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2023 Free Software
Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C
diff --git a/lib/raise.c b/lib/raise.c
index 385ddd384..506e20b48 100644
--- a/lib/raise.c
+++ b/lib/raise.c
@@ -1,6 +1,6 @@
/* Provide a non-threads replacement for the POSIX raise function.
- Copyright (C) 2002-2003, 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/rawmemchr.c b/lib/rawmemchr.c
index ea68c1bfc..45c6cd352 100644
--- a/lib/rawmemchr.c
+++ b/lib/rawmemchr.c
@@ -1,5 +1,5 @@
/* Searching in a string.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -23,10 +23,8 @@
#if !HAVE_RAWMEMCHR
# include <limits.h>
-# include <stdalign.h>
# include <stdint.h>
-# include "verify.h"
/* Find the first occurrence of C in S. */
void *
@@ -36,7 +34,7 @@ rawmemchr (const void *s, int c_in)
typedef uintptr_t longword;
/* If you change the "uintptr_t", you should change UINTPTR_WIDTH to match.
This verifies that the type does not have padding bits. */
- verify (UINTPTR_WIDTH == UCHAR_WIDTH * sizeof (longword));
+ static_assert (UINTPTR_WIDTH == UCHAR_WIDTH * sizeof (longword));
const unsigned char *char_ptr;
unsigned char c = c_in;
diff --git a/lib/rawmemchr.valgrind b/lib/rawmemchr.valgrind
index 64cf86c84..f3e4cb0f6 100644
--- a/lib/rawmemchr.valgrind
+++ b/lib/rawmemchr.valgrind
@@ -1,6 +1,6 @@
# Suppress a valgrind message about use of uninitialized memory in rawmemchr().
-# Copyright (C) 2008-2022 Free Software Foundation, Inc.
+# Copyright (C) 2008-2023 Free Software Foundation, Inc.
#
# This file is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
diff --git a/lib/read.c b/lib/read.c
index 1bb7d90ce..a0bdf06f0 100644
--- a/lib/read.c
+++ b/lib/read.c
@@ -1,5 +1,5 @@
/* POSIX compatible read() function.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/readlink.c b/lib/readlink.c
index ed03cc8de..14bbb7f10 100644
--- a/lib/readlink.c
+++ b/lib/readlink.c
@@ -1,5 +1,5 @@
/* Read the contents of a symbolic link.
- Copyright (C) 2003-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003-2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/realloc.c b/lib/realloc.c
index c87838157..1063eb098 100644
--- a/lib/realloc.c
+++ b/lib/realloc.c
@@ -1,6 +1,6 @@
/* realloc() function that is glibc compatible.
- Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2022 Free Software
+ Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/recv.c b/lib/recv.c
index 4910731ed..b41ae13cf 100644
--- a/lib/recv.c
+++ b/lib/recv.c
@@ -1,6 +1,6 @@
/* recv.c --- wrappers for Windows recv function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/recvfrom.c b/lib/recvfrom.c
index 3c9f5b21d..e8959c0da 100644
--- a/lib/recvfrom.c
+++ b/lib/recvfrom.c
@@ -1,6 +1,6 @@
/* recvfrom.c --- wrappers for Windows recvfrom function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/regcomp.c b/lib/regcomp.c
index 122c3de58..894783968 100644
--- a/lib/regcomp.c
+++ b/lib/regcomp.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
diff --git a/lib/regex.c b/lib/regex.c
index ff1176782..3beb0deb9 100644
--- a/lib/regex.c
+++ b/lib/regex.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
diff --git a/lib/regex.h b/lib/regex.h
index a7e0bd027..9ef0252ff 100644
--- a/lib/regex.h
+++ b/lib/regex.h
@@ -1,6 +1,6 @@
/* Definitions for data structures and routines for the regular
expression library.
- Copyright (C) 1985, 1989-2022 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1989-2023 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
diff --git a/lib/regex_internal.c b/lib/regex_internal.c
index 0e6919f34..998a19b72 100644
--- a/lib/regex_internal.c
+++ b/lib/regex_internal.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index 57a455b1f..149ec2e86 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -29,7 +29,6 @@
#include <locale.h>
#include <wchar.h>
#include <wctype.h>
-#include <stdbool.h>
#include <stdint.h>
#ifndef _LIBC
diff --git a/lib/regexec.c b/lib/regexec.c
index 521cb0284..13e0349e7 100644
--- a/lib/regexec.c
+++ b/lib/regexec.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
diff --git a/lib/rename.c b/lib/rename.c
index 119abe5c2..4722f13a1 100644
--- a/lib/rename.c
+++ b/lib/rename.c
@@ -1,6 +1,6 @@
/* Work around rename bugs in some systems.
- Copyright (C) 2001-2003, 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2005-2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -29,7 +29,6 @@
existing files. */
# include <errno.h>
-# include <stdbool.h>
# include <stdlib.h>
# include <sys/stat.h>
# include <unistd.h>
diff --git a/lib/rmdir.c b/lib/rmdir.c
index 8c8b75e04..bd1d8197d 100644
--- a/lib/rmdir.c
+++ b/lib/rmdir.c
@@ -1,6 +1,6 @@
/* Work around rmdir bugs.
- Copyright (C) 1988, 1990, 1999, 2003-2006, 2009-2022 Free Software
+ Copyright (C) 1988, 1990, 1999, 2003-2006, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/round.c b/lib/round.c
index 7e62feeb5..e01f3a4a5 100644
--- a/lib/round.c
+++ b/lib/round.c
@@ -1,5 +1,5 @@
/* Round toward nearest, breaking ties away from zero.
- Copyright (C) 2007, 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2010-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/safe-read.c b/lib/safe-read.c
index 04ffa7b84..7f6dc0958 100644
--- a/lib/safe-read.c
+++ b/lib/safe-read.c
@@ -1,6 +1,6 @@
/* An interface to read and write that retries after interrupts.
- Copyright (C) 1993-1994, 1998, 2002-2006, 2009-2022 Free Software
+ Copyright (C) 1993-1994, 1998, 2002-2006, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/safe-read.h b/lib/safe-read.h
index a39bb984c..d08744776 100644
--- a/lib/safe-read.h
+++ b/lib/safe-read.h
@@ -1,5 +1,5 @@
/* An interface to read() that retries after interrupts.
- Copyright (C) 2002, 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/safe-write.c b/lib/safe-write.c
index b779b36e7..9d6a578d8 100644
--- a/lib/safe-write.c
+++ b/lib/safe-write.c
@@ -1,5 +1,5 @@
/* An interface to write that retries after interrupts.
- Copyright (C) 2002, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/safe-write.h b/lib/safe-write.h
index a5a6c90bc..31df322b1 100644
--- a/lib/safe-write.h
+++ b/lib/safe-write.h
@@ -1,5 +1,5 @@
/* An interface to write() that retries after interrupts.
- Copyright (C) 2002, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/same-inode.h b/lib/same-inode.h
index f65f3d039..10964f00f 100644
--- a/lib/same-inode.h
+++ b/lib/same-inode.h
@@ -1,6 +1,6 @@
/* Determine whether two stat buffers are known to refer to the same file.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/sched.in.h b/lib/sched.in.h
index d19c5022a..2e035b554 100644
--- a/lib/sched.in.h
+++ b/lib/sched.in.h
@@ -1,5 +1,5 @@
/* A GNU-like <sched.h>.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/scratch_buffer.h b/lib/scratch_buffer.h
index f4fe5e8d3..4cf60d232 100644
--- a/lib/scratch_buffer.h
+++ b/lib/scratch_buffer.h
@@ -1,5 +1,5 @@
/* Variable-sized buffer with on-stack default allocation.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -98,20 +98,10 @@ extern bool scratch_buffer_set_array_size (struct scratch_buffer *buffer,
size_t nelem, size_t size);
#endif
-/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block,
- deallocating *BUFFER if it was heap-allocated. SIZE must be at
- most *BUFFER's size. Return NULL (setting errno) on memory
- exhaustion. */
-#if 0
-extern void *scratch_buffer_dupfree (struct scratch_buffer *buffer,
- size_t size);
-#endif
-
/* The implementation is imported from glibc. */
/* Avoid possible conflicts with symbols exported by the GNU libc. */
-#define __libc_scratch_buffer_dupfree gl_scratch_buffer_dupfree
#define __libc_scratch_buffer_grow gl_scratch_buffer_grow
#define __libc_scratch_buffer_grow_preserve gl_scratch_buffer_grow_preserve
#define __libc_scratch_buffer_set_array_size gl_scratch_buffer_set_array_size
diff --git a/lib/select.c b/lib/select.c
index c24249822..3d3efff3d 100644
--- a/lib/select.c
+++ b/lib/select.c
@@ -1,7 +1,7 @@
/* Emulation for select(2)
Contributed by Paolo Bonzini.
- Copyright 2008-2022 Free Software Foundation, Inc.
+ Copyright 2008-2023 Free Software Foundation, Inc.
This file is part of gnulib.
diff --git a/lib/send.c b/lib/send.c
index 5510c0c04..0ccb06392 100644
--- a/lib/send.c
+++ b/lib/send.c
@@ -1,6 +1,6 @@
/* send.c --- wrappers for Windows send function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/sendto.c b/lib/sendto.c
index 01163a633..537eabefb 100644
--- a/lib/sendto.c
+++ b/lib/sendto.c
@@ -1,6 +1,6 @@
/* sendto.c --- wrappers for Windows sendto function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/setenv.c b/lib/setenv.c
index ebfd4e550..f0b889969 100644
--- a/lib/setenv.c
+++ b/lib/setenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2003, 2005-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2003, 2005-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/setlocale-lock.c b/lib/setlocale-lock.c
index 4e7540e1f..b70ba09b0 100644
--- a/lib/setlocale-lock.c
+++ b/lib/setlocale-lock.c
@@ -1,5 +1,5 @@
/* Return the internal lock used by setlocale_null_r.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/setlocale_null.c b/lib/setlocale_null.c
index 778429b94..6ac563db1 100644
--- a/lib/setlocale_null.c
+++ b/lib/setlocale_null.c
@@ -1,5 +1,5 @@
/* Query the name of the current global locale.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/setlocale_null.h b/lib/setlocale_null.h
index d1921b09b..c740fa0ff 100644
--- a/lib/setlocale_null.h
+++ b/lib/setlocale_null.h
@@ -1,5 +1,5 @@
/* Query the name of the current global locale.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/setsockopt.c b/lib/setsockopt.c
index 2811c19af..d435741a0 100644
--- a/lib/setsockopt.c
+++ b/lib/setsockopt.c
@@ -1,6 +1,6 @@
/* setsockopt.c --- wrappers for Windows setsockopt function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/shutdown.c b/lib/shutdown.c
index 170d8710e..530d9e691 100644
--- a/lib/shutdown.c
+++ b/lib/shutdown.c
@@ -1,6 +1,6 @@
/* shutdown.c --- wrappers for Windows shutdown function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/signal.in.h b/lib/signal.in.h
index 640b5022f..fea12e657 100644
--- a/lib/signal.in.h
+++ b/lib/signal.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <signal.h>.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -55,13 +55,21 @@
#ifndef _@GUARD_PREFIX@_SIGNAL_H
#define _@GUARD_PREFIX@_SIGNAL_H
-/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android,
+/* For testing the OpenBSD version. */
+#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
+ && defined __OpenBSD__
+# include <sys/param.h>
+#endif
+
+/* Mac OS X 10.3, FreeBSD < 8.0, OpenBSD < 5.1, OSF/1 4.0, Solaris 2.6, Android,
OS/2 kLIBC declare pthread_sigmask in <pthread.h>, not in <signal.h>.
But avoid namespace pollution on glibc systems.*/
#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
&& ((defined __APPLE__ && defined __MACH__) \
- || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ \
- || defined __sun || defined __ANDROID__ || defined __KLIBC__) \
+ || (defined __FreeBSD__ && __FreeBSD__ < 8) \
+ || (defined __OpenBSD__ && OpenBSD < 201205) \
+ || defined __osf__ || defined __sun || defined __ANDROID__ \
+ || defined __KLIBC__) \
&& ! defined __GLIBC__
# include <pthread.h>
#endif
diff --git a/lib/signbitd.c b/lib/signbitd.c
index 776dd732b..706ea3944 100644
--- a/lib/signbitd.c
+++ b/lib/signbitd.c
@@ -1,5 +1,5 @@
/* signbit() macro: Determine the sign bit of a floating-point number.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/signbitf.c b/lib/signbitf.c
index 0adf0011a..c25bb64a0 100644
--- a/lib/signbitf.c
+++ b/lib/signbitf.c
@@ -1,5 +1,5 @@
/* signbit() macro: Determine the sign bit of a floating-point number.
- Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/signbitl.c b/lib/signbitl.c
index 865d27652..9d459caf8 100644
--- a/lib/signbitl.c
+++ b/lib/signbitl.c
@@ -1,5 +1,5 @@
/* signbit() macro: Determine the sign bit of a floating-point number.
- Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/size_max.h b/lib/size_max.h
index dee2b8eea..48af02505 100644
--- a/lib/size_max.h
+++ b/lib/size_max.h
@@ -1,5 +1,5 @@
/* size_max.h -- declare SIZE_MAX through system headers
- Copyright (C) 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2023 Free Software Foundation, Inc.
Written by Simon Josefsson.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/snprintf.c b/lib/snprintf.c
index 3d87854e9..cdff31499 100644
--- a/lib/snprintf.c
+++ b/lib/snprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 2004, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006-2023 Free Software Foundation, Inc.
Written by Simon Josefsson and Paul Eggert.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/socket.c b/lib/socket.c
index 49e013c7a..7ad6eb95f 100644
--- a/lib/socket.c
+++ b/lib/socket.c
@@ -1,6 +1,6 @@
/* socket.c --- wrappers for Windows socket function
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/sockets.c b/lib/sockets.c
index 31b430296..ca99db8b2 100644
--- a/lib/sockets.c
+++ b/lib/sockets.c
@@ -1,6 +1,6 @@
/* sockets.c --- wrappers for Windows socket functions
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/sockets.h b/lib/sockets.h
index 75e49fce0..a0b1601d6 100644
--- a/lib/sockets.h
+++ b/lib/sockets.h
@@ -1,6 +1,6 @@
/* sockets.h - wrappers for Windows socket functions
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/spawn.c b/lib/spawn.c
index bb2308dfc..fc7800022 100644
--- a/lib/spawn.c
+++ b/lib/spawn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2009-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/spawn.in.h b/lib/spawn.in.h
index c1acf6043..38cdf0991 100644
--- a/lib/spawn.in.h
+++ b/lib/spawn.in.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX spawn interface.
- Copyright (C) 2000, 2003-2004, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2003-2004, 2008-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/spawn_int.h b/lib/spawn_int.h
index 93f2b751f..1cf23f0f8 100644
--- a/lib/spawn_int.h
+++ b/lib/spawn_int.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2008-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2008-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/spawni.c b/lib/spawni.c
index 9bca2002b..cc9511fdd 100644
--- a/lib/spawni.c
+++ b/lib/spawni.c
@@ -1,5 +1,5 @@
/* Guts of POSIX spawn interface. Generic POSIX.1 version.
- Copyright (C) 2000-2006, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2006, 2008-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify
@@ -89,11 +89,16 @@
#if defined _WIN32 && ! defined __CYGWIN__
/* Native Windows API. */
+/* Define to 1 to enable DuplicateHandle optimization.
+ Define to 0 to disable this optimization. */
+# ifndef SPAWN_INTERNAL_OPTIMIZE_DUPLICATEHANDLE
+# define SPAWN_INTERNAL_OPTIMIZE_DUPLICATEHANDLE 1
+# endif
+
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
-# include <stdbool.h>
# include <stdio.h>
# include "filename.h"
@@ -121,60 +126,121 @@ grow_inheritable_handles (struct inheritable_handles *inh_handles, int newfd)
size_t new_allocated = 2 * inh_handles->allocated + 1;
if (new_allocated <= newfd)
new_allocated = newfd + 1;
- HANDLE *new_handles_array =
- (HANDLE *)
- realloc (inh_handles->handles, new_allocated * sizeof (HANDLE));
- if (new_handles_array == NULL)
+ struct IHANDLE *new_ih =
+ (struct IHANDLE *)
+ realloc (inh_handles->ih, new_allocated * sizeof (struct IHANDLE));
+ if (new_ih == NULL)
{
errno = ENOMEM;
return -1;
}
- unsigned char *new_flags_array =
- (unsigned char *)
- realloc (inh_handles->flags, new_allocated * sizeof (unsigned char));
- if (new_flags_array == NULL)
- {
- free (new_handles_array);
- errno = ENOMEM;
- return -1;
- }
inh_handles->allocated = new_allocated;
- inh_handles->handles = new_handles_array;
- inh_handles->flags = new_flags_array;
+ inh_handles->ih = new_ih;
}
- HANDLE *handles = inh_handles->handles;
+ struct IHANDLE *ih = inh_handles->ih;
for (; inh_handles->count <= newfd; inh_handles->count++)
- handles[inh_handles->count] = INVALID_HANDLE_VALUE;
+ ih[inh_handles->count].handle = INVALID_HANDLE_VALUE;
+
+ return 0;
+}
+
+# if SPAWN_INTERNAL_OPTIMIZE_DUPLICATEHANDLE
+
+/* Assuming inh_handles->ih[newfd].handle != INVALID_HANDLE_VALUE
+ and (inh_handles->ih[newfd].flags & DELAYED_DUP2_NEWFD) != 0,
+ actually performs the delayed dup2 (oldfd, newfd).
+ Returns 0 upon success. In case of failure, -1 is returned, with errno set.
+ */
+static int
+do_delayed_dup2 (int newfd, struct inheritable_handles *inh_handles,
+ HANDLE curr_process)
+{
+ int oldfd = inh_handles->ih[newfd].linked_fd;
+ /* Check invariants. */
+ if (!((inh_handles->ih[oldfd].flags & DELAYED_DUP2_OLDFD) != 0
+ && newfd == inh_handles->ih[oldfd].linked_fd
+ && inh_handles->ih[newfd].handle == inh_handles->ih[oldfd].handle))
+ abort ();
+ /* Duplicate the handle now. */
+ if (!DuplicateHandle (curr_process, inh_handles->ih[oldfd].handle,
+ curr_process, &inh_handles->ih[newfd].handle,
+ 0, TRUE, DUPLICATE_SAME_ACCESS))
+ {
+ errno = EBADF; /* arbitrary */
+ return -1;
+ }
+ inh_handles->ih[oldfd].flags &= ~DELAYED_DUP2_OLDFD;
+ inh_handles->ih[newfd].flags =
+ (unsigned char) inh_handles->ih[oldfd].flags | KEEP_OPEN_IN_CHILD;
+ return 0;
+}
+
+/* Performs the remaining delayed dup2 (oldfd, newfd).
+ Returns 0 upon success. In case of failure, -1 is returned, with errno set.
+ */
+static int
+do_remaining_delayed_dup2 (struct inheritable_handles *inh_handles,
+ HANDLE curr_process)
+{
+ size_t handles_count = inh_handles->count;
+ int newfd;
+ for (newfd = 0; newfd < handles_count; newfd++)
+ if (inh_handles->ih[newfd].handle != INVALID_HANDLE_VALUE
+ && (inh_handles->ih[newfd].flags & DELAYED_DUP2_NEWFD) != 0)
+ if (do_delayed_dup2 (newfd, inh_handles, curr_process) < 0)
+ return -1;
return 0;
}
-/* Reduces inh_handles->count to the minimum needed. */
+# endif
+
+/* Closes the handles in inh_handles that are not meant to be preserved in the
+ child process, and reduces inh_handles->count to the minimum needed. */
static void
shrink_inheritable_handles (struct inheritable_handles *inh_handles)
{
- HANDLE *handles = inh_handles->handles;
+ struct IHANDLE *ih = inh_handles->ih;
+ size_t handles_count = inh_handles->count;
+ unsigned int fd;
+
+ for (fd = 0; fd < handles_count; fd++)
+ {
+ HANDLE handle = ih[fd].handle;
- while (inh_handles->count > 3
- && handles[inh_handles->count - 1] == INVALID_HANDLE_VALUE)
- inh_handles->count--;
+ if (handle != INVALID_HANDLE_VALUE
+ && (ih[fd].flags & KEEP_OPEN_IN_CHILD) == 0)
+ {
+ if (!(ih[fd].flags & KEEP_OPEN_IN_PARENT))
+ CloseHandle (handle);
+ ih[fd].handle = INVALID_HANDLE_VALUE;
+ }
+ }
+
+ while (handles_count > 3
+ && ih[handles_count - 1].handle == INVALID_HANDLE_VALUE)
+ handles_count--;
+
+ inh_handles->count = handles_count;
}
/* Closes all handles in inh_handles. */
static void
close_inheritable_handles (struct inheritable_handles *inh_handles)
{
- HANDLE *handles = inh_handles->handles;
+ struct IHANDLE *ih = inh_handles->ih;
size_t handles_count = inh_handles->count;
unsigned int fd;
for (fd = 0; fd < handles_count; fd++)
{
- HANDLE handle = handles[fd];
+ HANDLE handle = ih[fd].handle;
- if (handle != INVALID_HANDLE_VALUE)
+ if (handle != INVALID_HANDLE_VALUE
+ && !(ih[fd].flags & DELAYED_DUP2_NEWFD)
+ && !(ih[fd].flags & KEEP_OPEN_IN_PARENT))
CloseHandle (handle);
}
}
@@ -198,7 +264,65 @@ sigisempty (const sigset_t *s)
return memiszero (s, sizeof (sigset_t));
}
-/* Opens a HANDLE to a file.
+/* Executes a 'close' action.
+ Returns 0 upon success. In case of failure, -1 is returned, with errno set.
+ */
+static int
+do_close (struct inheritable_handles *inh_handles, int fd, bool ignore_EBADF)
+{
+ if (!(fd >= 0 && fd < inh_handles->count
+ && inh_handles->ih[fd].handle != INVALID_HANDLE_VALUE))
+ {
+ if (ignore_EBADF)
+ return 0;
+ else
+ {
+ errno = EBADF;
+ return -1;
+ }
+ }
+
+# if SPAWN_INTERNAL_OPTIMIZE_DUPLICATEHANDLE
+ if ((inh_handles->ih[fd].flags & DELAYED_DUP2_NEWFD) != 0)
+ {
+ int dup2_oldfd = inh_handles->ih[fd].linked_fd;
+ /* Check invariants. */
+ if (!((inh_handles->ih[dup2_oldfd].flags & DELAYED_DUP2_OLDFD) != 0
+ && fd == inh_handles->ih[dup2_oldfd].linked_fd
+ && inh_handles->ih[fd].handle == inh_handles->ih[dup2_oldfd].handle))
+ abort ();
+ /* Annihilate a delayed dup2 (..., fd) call. */
+ inh_handles->ih[dup2_oldfd].flags &= ~DELAYED_DUP2_OLDFD;
+ }
+ else if ((inh_handles->ih[fd].flags & DELAYED_DUP2_OLDFD) != 0)
+ {
+ int dup2_newfd = inh_handles->ih[fd].linked_fd;
+ /* Check invariants. */
+ if (!((inh_handles->ih[dup2_newfd].flags & DELAYED_DUP2_NEWFD) != 0
+ && fd == inh_handles->ih[dup2_newfd].linked_fd
+ && inh_handles->ih[fd].handle == inh_handles->ih[dup2_newfd].handle))
+ abort ();
+ /* Optimize a delayed dup2 (fd, ...) call. */
+ inh_handles->ih[dup2_newfd].flags =
+ (inh_handles->ih[fd].flags & ~DELAYED_DUP2_OLDFD) | KEEP_OPEN_IN_CHILD;
+ }
+ else
+# endif
+ {
+ if (!(inh_handles->ih[fd].flags & KEEP_OPEN_IN_PARENT)
+ && !CloseHandle (inh_handles->ih[fd].handle))
+ {
+ inh_handles->ih[fd].handle = INVALID_HANDLE_VALUE;
+ errno = EIO;
+ return -1;
+ }
+ }
+ inh_handles->ih[fd].handle = INVALID_HANDLE_VALUE;
+
+ return 0;
+}
+
+/* Opens an inheritable HANDLE to a file.
Upon failure, returns INVALID_HANDLE_VALUE with errno set. */
static HANDLE
open_handle (const char *name, int flags, mode_t mode)
@@ -274,13 +398,17 @@ open_handle (const char *name, int flags, mode_t mode)
CreateFile
<https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilea>
<https://docs.microsoft.com/en-us/windows/desktop/FileIO/creating-and-opening-files> */
+ SECURITY_ATTRIBUTES sec_attr;
+ sec_attr.nLength = sizeof (SECURITY_ATTRIBUTES);
+ sec_attr.lpSecurityDescriptor = NULL;
+ sec_attr.bInheritHandle = TRUE;
HANDLE handle =
CreateFile (rname,
((flags & (O_WRONLY | O_RDWR)) != 0
? GENERIC_READ | GENERIC_WRITE
: GENERIC_READ),
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- NULL,
+ &sec_attr,
((flags & O_CREAT) != 0
? ((flags & O_EXCL) != 0
? CREATE_NEW
@@ -363,7 +491,7 @@ open_handle (const char *name, int flags, mode_t mode)
static int
do_open (struct inheritable_handles *inh_handles, int newfd,
const char *filename, const char *directory,
- int flags, mode_t mode, HANDLE curr_process)
+ int flags, mode_t mode)
{
if (!(newfd >= 0 && newfd < _getmaxstdio ()))
{
@@ -372,12 +500,8 @@ do_open (struct inheritable_handles *inh_handles, int newfd,
}
if (grow_inheritable_handles (inh_handles, newfd) < 0)
return -1;
- if (inh_handles->handles[newfd] != INVALID_HANDLE_VALUE
- && !CloseHandle (inh_handles->handles[newfd]))
- {
- errno = EIO;
- return -1;
- }
+ if (do_close (inh_handles, newfd, true) < 0)
+ return -1;
if (filename == NULL)
{
errno = EINVAL;
@@ -402,16 +526,9 @@ do_open (struct inheritable_handles *inh_handles, int newfd,
return -1;
}
free (filename_to_free);
- /* Duplicate the handle, so that it becomes inheritable. */
- if (!DuplicateHandle (curr_process, handle,
- curr_process, &inh_handles->handles[newfd],
- 0, TRUE,
- DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS))
- {
- errno = EBADF; /* arbitrary */
- return -1;
- }
- inh_handles->flags[newfd] = ((flags & O_APPEND) != 0 ? 32 : 0);
+ inh_handles->ih[newfd].handle = handle;
+ inh_handles->ih[newfd].flags =
+ ((flags & O_APPEND) != 0 ? 32 : 0) | KEEP_OPEN_IN_CHILD;
return 0;
}
@@ -423,7 +540,7 @@ do_dup2 (struct inheritable_handles *inh_handles, int oldfd, int newfd,
HANDLE curr_process)
{
if (!(oldfd >= 0 && oldfd < inh_handles->count
- && inh_handles->handles[oldfd] != INVALID_HANDLE_VALUE))
+ && inh_handles->ih[oldfd].handle != INVALID_HANDLE_VALUE))
{
errno = EBADF;
return -1;
@@ -437,44 +554,56 @@ do_dup2 (struct inheritable_handles *inh_handles, int oldfd, int newfd,
{
if (grow_inheritable_handles (inh_handles, newfd) < 0)
return -1;
- if (inh_handles->handles[newfd] != INVALID_HANDLE_VALUE
- && !CloseHandle (inh_handles->handles[newfd]))
- {
- errno = EIO;
+ if (do_close (inh_handles, newfd, true) < 0)
+ return -1;
+ /* We may need to duplicate the handle, so that a forthcoming do_close
+ action on oldfd has no effect on newfd. */
+# if SPAWN_INTERNAL_OPTIMIZE_DUPLICATEHANDLE
+ /* But try to not do it now; delay it if possible. In many cases, the
+ DuplicateHandle call can be optimized away. */
+ if ((inh_handles->ih[oldfd].flags & DELAYED_DUP2_NEWFD) != 0)
+ if (do_delayed_dup2 (oldfd, inh_handles, curr_process) < 0)
return -1;
+ if ((inh_handles->ih[oldfd].flags & DELAYED_DUP2_OLDFD) != 0)
+ {
+ /* Check invariants. */
+ int dup2_newfd = inh_handles->ih[oldfd].linked_fd;
+ if (!((inh_handles->ih[dup2_newfd].flags & DELAYED_DUP2_NEWFD) != 0
+ && oldfd == inh_handles->ih[dup2_newfd].linked_fd
+ && inh_handles->ih[oldfd].handle == inh_handles->ih[dup2_newfd].handle))
+ abort ();
+ /* We can't delay two or more dup2 calls from the same oldfd. */
+ if (!DuplicateHandle (curr_process, inh_handles->ih[oldfd].handle,
+ curr_process, &inh_handles->ih[newfd].handle,
+ 0, TRUE, DUPLICATE_SAME_ACCESS))
+ {
+ errno = EBADF; /* arbitrary */
+ return -1;
+ }
+ inh_handles->ih[newfd].flags =
+ (unsigned char) inh_handles->ih[oldfd].flags | KEEP_OPEN_IN_CHILD;
}
- /* Duplicate the handle, so that it a forthcoming do_close action on oldfd
- has no effect on newfd. */
- if (!DuplicateHandle (curr_process, inh_handles->handles[oldfd],
- curr_process, &inh_handles->handles[newfd],
+ else
+ {
+ /* Delay the dup2 (oldfd, newfd) action. */
+ inh_handles->ih[oldfd].flags |= DELAYED_DUP2_OLDFD;
+ inh_handles->ih[oldfd].linked_fd = newfd;
+ inh_handles->ih[newfd].handle = inh_handles->ih[oldfd].handle;
+ inh_handles->ih[newfd].flags = DELAYED_DUP2_NEWFD;
+ inh_handles->ih[newfd].linked_fd = oldfd;
+ }
+# else
+ if (!DuplicateHandle (curr_process, inh_handles->ih[oldfd].handle,
+ curr_process, &inh_handles->ih[newfd].handle,
0, TRUE, DUPLICATE_SAME_ACCESS))
{
errno = EBADF; /* arbitrary */
return -1;
}
- inh_handles->flags[newfd] = 0;
- }
- return 0;
-}
-
-/* Executes a 'close' action.
- Returns 0 upon success. In case of failure, -1 is returned, with errno set.
- */
-static int
-do_close (struct inheritable_handles *inh_handles, int fd)
-{
- if (!(fd >= 0 && fd < inh_handles->count
- && inh_handles->handles[fd] != INVALID_HANDLE_VALUE))
- {
- errno = EBADF;
- return -1;
- }
- if (!CloseHandle (inh_handles->handles[fd]))
- {
- errno = EIO;
- return -1;
+ inh_handles->ih[newfd].flags =
+ (unsigned char) inh_handles->ih[oldfd].flags | KEEP_OPEN_IN_CHILD;
+# endif
}
- inh_handles->handles[fd] = INVALID_HANDLE_VALUE;
return 0;
}
@@ -573,7 +702,7 @@ __spawni (pid_t *pid, const char *prog_filename,
case spawn_do_close:
{
int fd = action->action.close_action.fd;
- if (do_close (&inh_handles, fd) < 0)
+ if (do_close (&inh_handles, fd, false) < 0)
goto failed_2;
}
break;
@@ -585,7 +714,7 @@ __spawni (pid_t *pid, const char *prog_filename,
int flags = action->action.open_action.oflag;
mode_t mode = action->action.open_action.mode;
if (do_open (&inh_handles, newfd, filename, directory,
- flags, mode, curr_process)
+ flags, mode)
< 0)
goto failed_2;
}
@@ -622,9 +751,16 @@ __spawni (pid_t *pid, const char *prog_filename,
goto failed_2;
}
}
+
+# if SPAWN_INTERNAL_OPTIMIZE_DUPLICATEHANDLE
+ /* Do the remaining delayed dup2 invocations. */
+ if (do_remaining_delayed_dup2 (&inh_handles, curr_process) < 0)
+ goto failed_2;
+# endif
}
- /* Reduce inh_handles.count to the minimum needed. */
+ /* Close the handles in inh_handles that are not meant to be preserved in the
+ child process, and reduce inh_handles.count to the minimum needed. */
shrink_inheritable_handles (&inh_handles);
/* CreateProcess
@@ -718,6 +854,13 @@ __spawni (pid_t *pid, const char *prog_filename,
#else
+/* The warning "warning: 'vfork' is deprecated: Use posix_spawn or fork" seen
+ on macOS 12 is pointless, as we use vfork only when it is safe or when the
+ user has explicitly requested it. Silence this warning. */
+#if __GNUC__ >= 3
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
/* Spawn a new process executing PATH with the attributes describes in *ATTRP.
Before running the process perform the actions described in FILE-ACTIONS. */
int
diff --git a/lib/spawnp.c b/lib/spawnp.c
index 27d9e1692..f8af667eb 100644
--- a/lib/spawnp.c
+++ b/lib/spawnp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2009-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/stat-time.c b/lib/stat-time.c
index 3d48a2b5b..bc282232a 100644
--- a/lib/stat-time.c
+++ b/lib/stat-time.c
@@ -1,6 +1,6 @@
/* stat-related time functions.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/stat-time.h b/lib/stat-time.h
index 6b0088e32..92aa1e64e 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -1,6 +1,6 @@
/* stat-related time functions.
- Copyright (C) 2005, 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -20,9 +20,8 @@
#ifndef STAT_TIME_H
#define STAT_TIME_H 1
-#include "intprops.h"
-
#include <errno.h>
+#include <stdckdint.h>
#include <stddef.h>
#include <sys/stat.h>
#include <time.h>
@@ -232,7 +231,7 @@ stat_time_normalize (int result, _GL_UNUSED struct stat *st)
/* Overflow is possible, as Solaris 11 stat can yield
tv_sec == TYPE_MINIMUM (time_t) && tv_nsec == -1000000000.
INT_ADD_WRAPV is OK, since time_t is signed on Solaris. */
- if (INT_ADD_WRAPV (q, ts->tv_sec, &ts->tv_sec))
+ if (ckd_add (&ts->tv_sec, q, ts->tv_sec))
{
errno = EOVERFLOW;
return -1;
diff --git a/lib/stat-w32.c b/lib/stat-w32.c
index c1a292397..2f0119758 100644
--- a/lib/stat-w32.c
+++ b/lib/stat-w32.c
@@ -1,5 +1,5 @@
/* Core of implementation of fstat and stat for native Windows.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -50,7 +50,6 @@
#include "stat-w32.h"
#include "pathmax.h"
-#include "verify.h"
/* Don't assume that UNICODE is not defined. */
#undef LoadLibrary
@@ -228,7 +227,7 @@ _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf)
if (GetFileInformationByHandleExFunc (h, FileIdInfo, &id, sizeof (id)))
{
buf->st_dev = id.VolumeSerialNumber;
- verify (sizeof (ino_t) == sizeof (id.FileId));
+ static_assert (sizeof (ino_t) == sizeof (id.FileId));
memcpy (&buf->st_ino, &id.FileId, sizeof (ino_t));
goto ino_done;
}
diff --git a/lib/stat-w32.h b/lib/stat-w32.h
index 0f79d6141..c6738749d 100644
--- a/lib/stat-w32.h
+++ b/lib/stat-w32.h
@@ -1,5 +1,5 @@
/* Core of implementation of fstat and stat for native Windows.
- Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ Copyright (C) 2017-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/stat.c b/lib/stat.c
index 574489ac7..7987e2658 100644
--- a/lib/stat.c
+++ b/lib/stat.c
@@ -1,5 +1,5 @@
/* Work around platform bugs in stat.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -55,11 +55,9 @@ orig_stat (const char *filename, struct stat *buf)
#include <errno.h>
#include <limits.h>
-#include <stdbool.h>
#include <string.h>
#include "filename.h"
#include "malloca.h"
-#include "verify.h"
#ifdef WINDOWS_NATIVE
# define WIN32_LEAN_AND_MEAN
diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h
deleted file mode 100644
index 3b117df11..000000000
--- a/lib/stdalign.in.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* A substitute for ISO C11 <stdalign.h>.
-
- Copyright 2011-2022 Free Software Foundation, Inc.
-
- This file is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version.
-
- This file is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>. */
-
-/* Written by Paul Eggert and Bruno Haible. */
-
-#ifndef _GL_STDALIGN_H
-#define _GL_STDALIGN_H
-
-/* ISO C11 <stdalign.h> for platforms that lack it.
-
- References:
- ISO C11 (latest free draft
- <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>)
- sections 6.5.3.4, 6.7.5, 7.15.
- C++11 (latest free draft
- <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>)
- section 18.10. */
-
-/* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment
- requirement of a structure member (i.e., slot or field) that is of
- type TYPE, as an integer constant expression.
-
- This differs from GCC's and clang's __alignof__ operator, which can
- yield a better-performing alignment for an object of that type. For
- example, on x86 with GCC and on Linux/x86 with clang,
- __alignof__ (double) and __alignof__ (long long) are 8, whereas
- alignof (double) and alignof (long long) are 4 unless the option
- '-malign-double' is used.
-
- The result cannot be used as a value for an 'enum' constant, if you
- want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc.
-
- Include <stddef.h> for offsetof. */
-#include <stddef.h>
-
-/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
- standard headers, defines conflicting implementations of _Alignas
- and _Alignof that are no better than ours; override them. */
-#undef _Alignas
-#undef _Alignof
-
-/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
- clang versions < 8.0.0 have the same bug. */
-#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
- || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
- && !defined __clang__) \
- || (defined __clang__ && __clang_major__ < 8))
-# ifdef __cplusplus
-# if 201103 <= __cplusplus
-# define _Alignof(type) alignof (type)
-# else
- template <class __t> struct __alignof_helper { char __a; __t __b; };
-# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
-# endif
-# else
-# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
-# endif
-#endif
-#if ! (defined __cplusplus && 201103 <= __cplusplus)
-# define alignof _Alignof
-#endif
-#define __alignof_is_defined 1
-
-/* alignas (A), also known as _Alignas (A), aligns a variable or type
- to the alignment A, where A is an integer constant expression. For
- example:
-
- int alignas (8) foo;
- struct s { int a; int alignas (8) bar; };
-
- aligns the address of FOO and the offset of BAR to be multiples of 8.
-
- A should be a power of two that is at least the type's alignment
- and at most the implementation's alignment limit. This limit is
- 2**28 on typical GNUish hosts, and 2**13 on MSVC. To be portable
- to MSVC through at least version 10.0, A should be an integer
- constant, as MSVC does not support expressions such as 1 << 3.
- To be portable to Sun C 5.11, do not align auto variables to
- anything stricter than their default alignment.
-
- The following C11 requirements are not supported here:
-
- - If A is zero, alignas has no effect.
- - alignas can be used multiple times; the strictest one wins.
- - alignas (TYPE) is equivalent to alignas (alignof (TYPE)).
-
- */
-
-#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
-# if defined __cplusplus && 201103 <= __cplusplus
-# define _Alignas(a) alignas (a)
-# elif (!defined __attribute__ \
- && ((defined __APPLE__ && defined __MACH__ \
- ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
- : __GNUC__ && !defined __ibmxl__) \
- || (4 <= __clang_major__) \
- || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
- || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__))
-# define _Alignas(a) __attribute__ ((__aligned__ (a)))
-# elif 1300 <= _MSC_VER
-# define _Alignas(a) __declspec (align (a))
-# endif
-#endif
-#if ((defined _Alignas && ! (defined __cplusplus && 201103 <= __cplusplus)) \
- || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
-# define alignas _Alignas
-#endif
-#if defined alignas || (defined __cplusplus && 201103 <= __cplusplus)
-# define __alignas_is_defined 1
-#endif
-
-#endif /* _GL_STDALIGN_H */
diff --git a/lib/stdbool.in.h b/lib/stdbool.in.h
deleted file mode 100644
index 2fa46724b..000000000
--- a/lib/stdbool.in.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
- Written by Bruno Haible <haible@clisp.cons.org>, 2001.
-
- This file is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version.
-
- This file is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>. */
-
-#ifndef _GL_STDBOOL_H
-#define _GL_STDBOOL_H
-
-/* ISO C 99 <stdbool.h> for platforms that lack it. */
-
-/* Usage suggestions:
-
- Programs that use <stdbool.h> should be aware of some limitations
- and standards compliance issues.
-
- Standards compliance:
-
- - <stdbool.h> must be #included before 'bool', 'false', 'true'
- can be used.
-
- - You cannot assume that sizeof (bool) == 1.
-
- - Programs should not undefine the macros bool, true, and false,
- as C99 lists that as an "obsolescent feature".
-
- Limitations of this substitute, when used in a C89 environment:
-
- - <stdbool.h> must be #included before the '_Bool' type can be used.
-
- - You cannot assume that _Bool is a typedef; it might be a macro.
-
- - Bit-fields of type 'bool' are not supported. Portable code
- should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
-
- - In C99, casts and automatic conversions to '_Bool' or 'bool' are
- performed in such a way that every nonzero value gets converted
- to 'true', and zero gets converted to 'false'. This doesn't work
- with this substitute. With this substitute, only the values 0 and 1
- give the expected result when converted to _Bool' or 'bool'.
-
- - C99 allows the use of (_Bool)0.0 in constant expressions, but
- this substitute cannot always provide this property.
-
- Also, it is suggested that programs use 'bool' rather than '_Bool';
- this isn't required, but 'bool' is more common. */
-
-
-/* 7.16. Boolean type and values */
-
-#ifdef __cplusplus
-# define _Bool bool
-# define bool bool
-#else
-# if !defined __GNUC__
- /* If @HAVE__BOOL@:
- Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
- the built-in _Bool type is used. See
- https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
- https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
- https://lists.gnu.org/r/bug-coreutils/2005-10/msg00086.html
- Similar bugs are likely with other compilers as well; this file
- wouldn't be used if <stdbool.h> was working.
- So we override the _Bool type.
- If !@HAVE__BOOL@:
- Need to define _Bool ourselves. As 'signed char' or as an enum type?
- Use of a typedef, with SunPRO C, leads to a stupid
- "warning: _Bool is a keyword in ISO C99".
- Use of an enum type, with IRIX cc, leads to a stupid
- "warning(1185): enumerated type mixed with another type".
- Even the existence of an enum type, without a typedef,
- "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
- The only benefit of the enum, debuggability, is not important
- with these compilers. So use 'signed char' and no enum. */
-# define _Bool signed char
-# else
- /* With this compiler, trust the _Bool type if the compiler has it. */
-# if !@HAVE__BOOL@
- /* For the sake of symbolic names in gdb, define true and false as
- enum constants, not only as macros.
- It is tempting to write
- typedef enum { false = 0, true = 1 } _Bool;
- so that gdb prints values of type 'bool' symbolically. But then
- values of type '_Bool' might promote to 'int' or 'unsigned int'
- (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
- (see ISO C 99 6.3.1.1.(2)). So add a negative value to the
- enum; this ensures that '_Bool' promotes to 'int'. */
-typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
-# endif
-# endif
-# define bool _Bool
-#endif
-
-/* The other macros must be usable in preprocessor directives. */
-#ifdef __cplusplus
-# define false false
-# define true true
-#else
-# define false 0
-# define true 1
-#endif
-
-#define __bool_true_false_are_defined 1
-
-#endif /* _GL_STDBOOL_H */
diff --git a/lib/stdckdint.in.h b/lib/stdckdint.in.h
index 90fa62e59..71bab5f0c 100644
--- a/lib/stdckdint.in.h
+++ b/lib/stdckdint.in.h
@@ -1,6 +1,6 @@
/* stdckdint.h -- checked integer arithmetic
- Copyright 2022 Free Software Foundation, Inc.
+ Copyright 2022-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
@@ -20,8 +20,6 @@
#include "intprops-internal.h"
-#include <stdbool.h>
-
/* Store into *R the low-order bits of A + B, A - B, A * B, respectively.
Return 1 if the result overflows, 0 otherwise.
A, B, and *R can have any integer type other than char, bool, a
diff --git a/lib/stddef.in.h b/lib/stddef.in.h
index 5c9a747d7..6eadcc3d5 100644
--- a/lib/stddef.in.h
+++ b/lib/stddef.in.h
@@ -1,6 +1,6 @@
/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
index eaa7874f5..5ddc644b8 100644
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2023 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
This file is part of gnulib.
diff --git a/lib/stdio-read.c b/lib/stdio-read.c
index 85efa0d44..6e2984c5e 100644
--- a/lib/stdio-read.c
+++ b/lib/stdio-read.c
@@ -1,5 +1,5 @@
/* POSIX compatible FILE stream read function.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/stdio-write.c b/lib/stdio-write.c
index 82facf545..9cf36cca4 100644
--- a/lib/stdio-write.c
+++ b/lib/stdio-write.c
@@ -1,5 +1,5 @@
/* POSIX compatible FILE stream write function.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index 7b36dac2f..8b5ef4bd2 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdio.h>.
- Copyright (C) 2004, 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -951,9 +951,13 @@ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
# endif
_GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream));
# else
+# if @HAVE_DECL_GETW@
_GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream));
+# endif
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getw);
+# endif
#endif
#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
@@ -1190,9 +1194,13 @@ _GL_CXXALIASWARN (puts);
# endif
_GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream));
# else
+# if @HAVE_DECL_PUTW@
_GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream));
+# endif
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (putw);
+# endif
#endif
#if @GNULIB_REMOVE@
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index a86643c3c..b79e5f709 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdlib.h>.
- Copyright (C) 1995, 2001-2004, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2004, 2006-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -226,7 +226,7 @@ _GL_FUNCDECL_SYS (aligned_alloc, void *,
_GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
# endif
# endif
-# if @HAVE_ALIGNED_ALLOC@
+# if (__GLIBC__ >= 2) && @HAVE_ALIGNED_ALLOC@
_GL_CXXALIASWARN (aligned_alloc);
# endif
#else
@@ -1363,7 +1363,9 @@ _GL_CXXALIAS_SYS (strtol, long,
(const char *restrict string, char **restrict endptr,
int base));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (strtol);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef strtol
# if HAVE_RAW_DECL_STRTOL
@@ -1444,7 +1446,9 @@ _GL_CXXALIAS_SYS (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr,
int base));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (strtoul);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef strtoul
# if HAVE_RAW_DECL_STRTOUL
diff --git a/lib/stpcpy.c b/lib/stpcpy.c
index 434f84ae7..73c1eb786 100644
--- a/lib/stpcpy.c
+++ b/lib/stpcpy.c
@@ -1,5 +1,5 @@
/* stpcpy.c -- copy a string and return pointer to end of new string
- Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2022 Free Software
+ Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2023 Free Software
Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
diff --git a/lib/strchrnul.c b/lib/strchrnul.c
index 2141b3e19..8724427b5 100644
--- a/lib/strchrnul.c
+++ b/lib/strchrnul.c
@@ -1,5 +1,5 @@
/* Searching in a string.
- Copyright (C) 2003, 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/strchrnul.valgrind b/lib/strchrnul.valgrind
index 1cf50ec8d..d998366eb 100644
--- a/lib/strchrnul.valgrind
+++ b/lib/strchrnul.valgrind
@@ -1,6 +1,6 @@
# Suppress a valgrind message about use of uninitialized memory in strchrnul().
-# Copyright (C) 2008-2022 Free Software Foundation, Inc.
+# Copyright (C) 2008-2023 Free Software Foundation, Inc.
#
# This file is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
diff --git a/lib/strdup.c b/lib/strdup.c
index 2a0df023c..08c40d57a 100644
--- a/lib/strdup.c
+++ b/lib/strdup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2022 Free Software
+/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2023 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/lib/streq.h b/lib/streq.h
index 49f73c1b9..712948eba 100644
--- a/lib/streq.h
+++ b/lib/streq.h
@@ -1,5 +1,5 @@
/* Optimized string comparison.
- Copyright (C) 2001-2002, 2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/strftime.h b/lib/strftime.h
index a9847084f..88c1f7392 100644
--- a/lib/strftime.h
+++ b/lib/strftime.h
@@ -1,6 +1,6 @@
/* declarations for strftime.c
- Copyright (C) 2002, 2004, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/striconveh.c b/lib/striconveh.c
index 5b60a7e0a..0209dc6cf 100644
--- a/lib/striconveh.c
+++ b/lib/striconveh.c
@@ -1,5 +1,5 @@
/* Character set conversion with error handling.
- Copyright (C) 2001-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2023 Free Software Foundation, Inc.
Written by Bruno Haible and Simon Josefsson.
This file is free software: you can redistribute it and/or modify
@@ -21,7 +21,6 @@
#include "striconveh.h"
#include <errno.h>
-#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/striconveh.h b/lib/striconveh.h
index e152a046f..7858b03ef 100644
--- a/lib/striconveh.h
+++ b/lib/striconveh.h
@@ -1,5 +1,5 @@
/* Character set conversion with error handling.
- Copyright (C) 2001-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2007, 2009-2023 Free Software Foundation, Inc.
Written by Bruno Haible and Simon Josefsson.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/string.in.h b/lib/string.in.h
index 3996da9fc..b227a1788 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <string.h>.
- Copyright (C) 1995-1996, 2001-2022 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 2001-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -59,10 +59,11 @@
# include <unistd.h>
#endif
-/* AIX 7.2 declares ffsl and ffsll in <strings.h>, not in <string.h>. */
+/* AIX 7.2 and Android 13 declare ffsl and ffsll in <strings.h>, not in
+ <string.h>. */
/* But in any case avoid namespace pollution on glibc systems. */
#if ((@GNULIB_FFSL@ || @GNULIB_FFSLL@ || defined GNULIB_POSIXCHECK) \
- && defined _AIX) \
+ && (defined _AIX || defined __ANDROID__)) \
&& ! defined __GLIBC__
# include <strings.h>
#endif
@@ -82,7 +83,14 @@
can be freed via 'free'; it can be used only after declaring 'free'. */
/* Applies to: functions. Cannot be used on inline functions. */
#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
-# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+# if defined __cplusplus && defined __GNUC__ && !defined __clang__
+/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
+# else
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC (free, 1)
+# endif
#endif
/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
@@ -336,7 +344,7 @@ _GL_CXXALIAS_SYS_CAST2 (memrchr,
|| defined __clang__)
_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t) throw ());
_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t) throw ());
-# else
+# elif __GLIBC__ >= 2
_GL_CXXALIASWARN (memrchr);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -347,6 +355,23 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
# endif
#endif
+/* Overwrite a block of memory. The compiler will not optimize
+ effects away, even if the block is dead after the call. */
+#if @GNULIB_MEMSET_EXPLICIT@
+# if ! @HAVE_MEMSET_EXPLICIT@
+_GL_FUNCDECL_SYS (memset_explicit, void *,
+ (void *__dest, int __c, size_t __n) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n));
+_GL_CXXALIASWARN (memset_explicit);
+#elif defined GNULIB_POSIXCHECK
+# undef memset_explicit
+# if HAVE_RAW_DECL_MEMSET_EXPLICIT
+_GL_WARN_ON_USE (memset_explicit, "memset_explicit is unportable - "
+ "use gnulib module memset_explicit for portability");
+# endif
+#endif
+
/* Find the first occurrence of C in S. More efficient than
memchr(S,C,N), at the expense of undefined behavior if C does not
occur within N bytes. */
@@ -474,7 +499,7 @@ _GL_CXXALIAS_SYS_CAST2 (strchrnul,
_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in) throw ());
_GL_CXXALIASWARN1 (strchrnul, char const *,
(char const *__s, int __c_in) throw ());
-# else
+# elif __GLIBC__ >= 2
_GL_CXXALIASWARN (strchrnul);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -839,7 +864,7 @@ _GL_CXXALIASWARN1 (strcasestr, char *,
(char *haystack, const char *needle) throw ());
_GL_CXXALIASWARN1 (strcasestr, const char *,
(const char *haystack, const char *needle) throw ());
-# else
+# elif __GLIBC__ >= 2
_GL_CXXALIASWARN (strcasestr);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -943,7 +968,9 @@ _GL_FUNCDECL_SYS (mbslen, size_t, (const char *string)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (mbslen);
+# endif
#endif
#if @GNULIB_MBSNLEN@
diff --git a/lib/stripslash.c b/lib/stripslash.c
index aee89b78d..fe46a9c10 100644
--- a/lib/stripslash.c
+++ b/lib/stripslash.c
@@ -1,6 +1,6 @@
/* stripslash.c -- remove redundant trailing slashes from a file name
- Copyright (C) 1990, 2001, 2003-2006, 2009-2022 Free Software Foundation,
+ Copyright (C) 1990, 2001, 2003-2006, 2009-2023 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/sys-limits.h b/lib/sys-limits.h
index d154f0b23..0e9556d64 100644
--- a/lib/sys-limits.h
+++ b/lib/sys-limits.h
@@ -1,6 +1,6 @@
/* System call limits
- Copyright 2018-2022 Free Software Foundation, Inc.
+ Copyright 2018-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/sys_file.in.h b/lib/sys_file.in.h
index 1ae54f85a..d05337ad4 100644
--- a/lib/sys_file.in.h
+++ b/lib/sys_file.in.h
@@ -1,6 +1,6 @@
/* Provide a more complete sys/file.h.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/sys_random.in.h b/lib/sys_random.in.h
index e730e6139..8dca13268 100644
--- a/lib/sys_random.in.h
+++ b/lib/sys_random.in.h
@@ -1,5 +1,5 @@
/* Substitute for <sys/random.h>.
- Copyright (C) 2020-2022 Free Software Foundation, Inc.
+ Copyright (C) 2020-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -84,7 +84,9 @@ _GL_FUNCDECL_SYS (getrandom, ssize_t,
_GL_CXXALIAS_SYS (getrandom, ssize_t,
(void *buffer, size_t length, unsigned int flags));
# endif
+# if __GLIBC__ + (__GLIBC_MINOR__ >= 25) > 2
_GL_CXXALIASWARN (getrandom);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef getrandom
# if HAVE_RAW_DECL_GETRANDOM
diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h
index 2bd0e0f79..13440fa6f 100644
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -1,5 +1,5 @@
/* Substitute for <sys/select.h>.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -82,9 +82,10 @@
of 'struct timeval', and no definition of this type.
Also, Mac OS X, AIX, HP-UX, IRIX, Solaris, Interix declare select()
in <sys/time.h>.
- But avoid namespace pollution on glibc systems and "unknown type
- name" problems on Cygwin. */
-# if !(defined __GLIBC__ || defined __CYGWIN__)
+ But avoid namespace pollution on glibc systems, a circular include
+ <sys/select.h> -> <sys/time.h> -> <sys/select.h> on FreeBSD 13.1, and
+ "unknown type name" problems on Cygwin. */
+# if !(defined __GLIBC__ || defined __FreeBSD__ || defined __CYGWIN__)
# include <sys/time.h>
# endif
@@ -287,7 +288,9 @@ _GL_CXXALIAS_SYS_CAST (pselect, int,
struct timespec const *restrict,
const sigset_t *restrict));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (pselect);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef pselect
# if HAVE_RAW_DECL_PSELECT
diff --git a/lib/sys_socket.c b/lib/sys_socket.c
index 0bfd60f2f..b7388cecc 100644
--- a/lib/sys_socket.c
+++ b/lib/sys_socket.c
@@ -1,6 +1,6 @@
/* Inline functions for <sys/socket.h>.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h
index acdf7eee5..6705593f4 100644
--- a/lib/sys_socket.in.h
+++ b/lib/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-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
Written by Simon Josefsson.
This file is free software: you can redistribute it and/or modify
@@ -97,7 +97,6 @@ typedef unsigned char sa_family_t;
# endif
# endif
#else
-# include <stdalign.h>
/* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
# define __ss_aligntype unsigned long int
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 714c3cb18..096887c01 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -1,5 +1,5 @@
/* Provide a more complete sys/stat.h header file.
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -596,44 +596,6 @@ _GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
#endif
-#if @GNULIB_LSTAT@
-# if ! @HAVE_LSTAT@
-/* mingw does not support symlinks, therefore it does not have lstat. But
- without links, stat does just fine. */
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define lstat stat
-# endif
-_GL_CXXALIAS_RPL_1 (lstat, stat, int,
- (const char *restrict name, struct stat *restrict buf));
-# elif @REPLACE_LSTAT@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef lstat
-# define lstat rpl_lstat
-# endif
-_GL_FUNCDECL_RPL (lstat, int,
- (const char *restrict name, struct stat *restrict buf)
- _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_RPL (lstat, int,
- (const char *restrict name, struct stat *restrict buf));
-# else
-_GL_CXXALIAS_SYS (lstat, int,
- (const char *restrict name, struct stat *restrict buf));
-# endif
-# if @HAVE_LSTAT@
-_GL_CXXALIASWARN (lstat);
-# endif
-#elif @GNULIB_OVERRIDES_STRUCT_STAT@
-# undef lstat
-# define lstat lstat_used_without_requesting_gnulib_module_lstat
-#elif defined GNULIB_POSIXCHECK
-# undef lstat
-# if HAVE_RAW_DECL_LSTAT
-_GL_WARN_ON_USE (lstat, "lstat is unportable - "
- "use gnulib module lstat for portability");
-# endif
-#endif
-
-
#if @GNULIB_MKDIR@
# if @REPLACE_MKDIR@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -895,6 +857,44 @@ _GL_WARN_ON_USE (stat, "stat is unportable - "
#endif
+#if @GNULIB_LSTAT@
+# if ! @HAVE_LSTAT@
+/* mingw does not support symlinks, therefore it does not have lstat. But
+ without links, stat does just fine. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define lstat stat
+# endif
+_GL_CXXALIAS_RPL_1 (lstat, stat, int,
+ (const char *restrict name, struct stat *restrict buf));
+# elif @REPLACE_LSTAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef lstat
+# define lstat rpl_lstat
+# endif
+_GL_FUNCDECL_RPL (lstat, int,
+ (const char *restrict name, struct stat *restrict buf)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (lstat, int,
+ (const char *restrict name, struct stat *restrict buf));
+# else
+_GL_CXXALIAS_SYS (lstat, int,
+ (const char *restrict name, struct stat *restrict buf));
+# endif
+# if @HAVE_LSTAT@
+_GL_CXXALIASWARN (lstat);
+# endif
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+# undef lstat
+# define lstat lstat_used_without_requesting_gnulib_module_lstat
+#elif defined GNULIB_POSIXCHECK
+# undef lstat
+# if HAVE_RAW_DECL_LSTAT
+_GL_WARN_ON_USE (lstat, "lstat is unportable - "
+ "use gnulib module lstat for portability");
+# endif
+#endif
+
+
#if @GNULIB_MDA_UMASK@
/* On native Windows, map 'umask' to '_umask', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h
index 87db1a887..e833d5516 100644
--- a/lib/sys_time.in.h
+++ b/lib/sys_time.in.h
@@ -1,6 +1,6 @@
/* Provide a more complete sys/time.h.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/sys_times.in.h b/lib/sys_times.in.h
index 01b58a4ac..148dc60db 100644
--- a/lib/sys_times.in.h
+++ b/lib/sys_times.in.h
@@ -1,5 +1,5 @@
/* Provide a sys/times.h header file.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/sys_types.in.h b/lib/sys_types.in.h
index 698e88d63..082a6c674 100644
--- a/lib/sys_types.in.h
+++ b/lib/sys_types.in.h
@@ -1,6 +1,6 @@
/* Provide a more complete sys/types.h.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/sys_uio.in.h b/lib/sys_uio.in.h
index 788d461f1..64c4fb6dc 100644
--- a/lib/sys_uio.in.h
+++ b/lib/sys_uio.in.h
@@ -1,5 +1,5 @@
/* Substitute for <sys/uio.h>.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/tempname.c b/lib/tempname.c
index 11b4796b3..bf362db6e 100644
--- a/lib/tempname.c
+++ b/lib/tempname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2023 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
@@ -20,7 +20,6 @@
# include "tempname.h"
#endif
-#include <stdbool.h>
#include <errno.h>
#include <stdio.h>
diff --git a/lib/tempname.h b/lib/tempname.h
index 5e3c5e155..36a513815 100644
--- a/lib/tempname.h
+++ b/lib/tempname.h
@@ -1,6 +1,6 @@
/* Create a temporary file or directory.
- Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/time-internal.h b/lib/time-internal.h
index c8a2a8ce6..51423c94c 100644
--- a/lib/time-internal.h
+++ b/lib/time-internal.h
@@ -1,6 +1,6 @@
/* Time internal interface
- Copyright 2015-2022 Free Software Foundation, Inc.
+ Copyright 2015-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/time.in.h b/lib/time.in.h
index 6d4c77196..50c9b30b6 100644
--- a/lib/time.in.h
+++ b/lib/time.in.h
@@ -1,6 +1,6 @@
/* A more-standard <time.h>.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -315,6 +315,7 @@ _GL_CXXALIASWARN (strptime);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define ctime rpl_ctime
# endif
+_GL_ATTRIBUTE_DEPRECATED
_GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp));
@@ -435,8 +436,10 @@ _GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
# endif
# if defined GNULIB_POSIXCHECK
# undef asctime_r
+# if HAVE_RAW_DECL_ASCTIME_R
_GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - "
"better use strftime (or even sprintf) instead");
+# endif
# endif
# if defined GNULIB_POSIXCHECK
# undef ctime
@@ -445,8 +448,10 @@ _GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - "
# endif
# if defined GNULIB_POSIXCHECK
# undef ctime_r
+# if HAVE_RAW_DECL_CTIME_R
_GL_WARN_ON_USE (ctime_r, "ctime_r can overrun buffers in some cases - "
"better use strftime (or even sprintf) instead");
+# endif
# endif
#endif
diff --git a/lib/time_r.c b/lib/time_r.c
index d4b227554..97be4fd05 100644
--- a/lib/time_r.c
+++ b/lib/time_r.c
@@ -1,6 +1,6 @@
/* Reentrant time functions like localtime_r.
- Copyright (C) 2003, 2006-2007, 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2007, 2010-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/time_rz.c b/lib/time_rz.c
index 1a91d3778..da0d57b8b 100644
--- a/lib/time_rz.c
+++ b/lib/time_rz.c
@@ -1,6 +1,6 @@
/* Time zone functions such as tzalloc and localtime_rz
- Copyright 2015-2022 Free Software Foundation, Inc.
+ Copyright 2015-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -27,7 +27,6 @@
#include <time.h>
#include <errno.h>
-#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/timegm.c b/lib/timegm.c
index a1b19efc3..b47025a05 100644
--- a/lib/timegm.c
+++ b/lib/timegm.c
@@ -1,6 +1,6 @@
/* Convert UTC calendar time to simple time. Like mktime but assumes UTC.
- Copyright (C) 1994-2022 Free Software Foundation, Inc.
+ Copyright (C) 1994-2023 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
diff --git a/lib/times.c b/lib/times.c
index 68bc8e3c4..3bcc38d9e 100644
--- a/lib/times.c
+++ b/lib/times.c
@@ -1,6 +1,6 @@
/* Get process times
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/trunc.c b/lib/trunc.c
index be24c8780..acbef8a84 100644
--- a/lib/trunc.c
+++ b/lib/trunc.c
@@ -1,5 +1,5 @@
/* Round towards zero.
- Copyright (C) 2007, 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2010-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/tzset.c b/lib/tzset.c
index 845d34962..88fc04798 100644
--- a/lib/tzset.c
+++ b/lib/tzset.c
@@ -1,6 +1,6 @@
/* Provide tzset for systems that don't have it or for which it's broken.
- Copyright (C) 2001-2003, 2005-2007, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2005-2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/unistd.c b/lib/unistd.c
index 95978e6ad..be7a82550 100644
--- a/lib/unistd.c
+++ b/lib/unistd.c
@@ -1,6 +1,6 @@
/* Inline functions for <unistd.h>.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 57df09ecd..4812fdb11 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <unistd.h>.
- Copyright (C) 2003-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -1143,7 +1143,9 @@ _GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
# endif
_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getdomainname);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef getdomainname
# if HAVE_RAW_DECL_GETDOMAINNAME
@@ -2055,7 +2057,7 @@ _GL_CXXALIAS_MDA_CAST (swab, void, (char *from, char *to, int n));
# else
# if defined __hpux /* HP-UX */
_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, int n));
-# elif defined __sun && !defined _XPG4 /* Solaris */
+# elif defined __sun && (defined __SunOS_5_10 || defined __XOPEN_OR_POSIX) && !defined _XPG4 /* Solaris */
_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, ssize_t n));
# else
_GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n));
diff --git a/lib/unsetenv.c b/lib/unsetenv.c
index 07eac6fdd..e5489490f 100644
--- a/lib/unsetenv.c
+++ b/lib/unsetenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2002, 2005-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2002, 2005-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index 285c674b9..ab11ad026 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 1999, 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -101,7 +101,6 @@
#include "xsize.h"
#include "attribute.h"
-#include "verify.h"
#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
# include <math.h>
@@ -408,11 +407,11 @@ is_infinite_or_zerol (long double x)
typedef unsigned int mp_limb_t;
# define GMP_LIMB_BITS 32
-verify (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
+static_assert (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
typedef unsigned long long mp_twolimb_t;
# define GMP_TWOLIMB_BITS 64
-verify (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
+static_assert (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
/* Representation of a bignum >= 0. */
typedef struct
@@ -2628,7 +2627,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
size_t characters;
# if !DCHAR_IS_TCHAR
/* This code assumes that TCHAR_T is 'char'. */
- verify (sizeof (TCHAR_T) == 1);
+ static_assert (sizeof (TCHAR_T) == 1);
TCHAR_T *tmpsrc;
DCHAR_T *tmpdst;
size_t tmpdst_len;
@@ -2894,7 +2893,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
size_t characters;
# if !DCHAR_IS_TCHAR
/* This code assumes that TCHAR_T is 'char'. */
- verify (sizeof (TCHAR_T) == 1);
+ static_assert (sizeof (TCHAR_T) == 1);
TCHAR_T tmpsrc[64]; /* Assume MB_CUR_MAX <= 64. */
DCHAR_T *tmpdst;
size_t tmpdst_len;
@@ -5451,7 +5450,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
DCHAR_T *tmpdst;
size_t tmpdst_len;
/* This code assumes that TCHAR_T is 'char'. */
- verify (sizeof (TCHAR_T) == 1);
+ static_assert (sizeof (TCHAR_T) == 1);
# if USE_SNPRINTF
tmpsrc = (TCHAR_T *) (result + length);
# else
diff --git a/lib/vasnprintf.h b/lib/vasnprintf.h
index 27cf54c50..f69649fb4 100644
--- a/lib/vasnprintf.h
+++ b/lib/vasnprintf.h
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 2002-2004, 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2004, 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/verify.h b/lib/verify.h
index 47b6ee661..b63cb2643 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -1,6 +1,6 @@
/* Compile-time assert-like macros.
- Copyright (C) 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -25,19 +25,19 @@
works as per C11. This is supported by GCC 4.6.0+ and by clang 4+.
Define _GL_HAVE__STATIC_ASSERT1 to 1 if _Static_assert (R) works as
- per C2x. This is supported by GCC 9.1+.
+ per C23. This is supported by GCC 9.1+.
Support compilers claiming conformance to the relevant standard,
and also support GCC when not pedantic. If we were willing to slow
'configure' down we could also use it with other compilers, but
since this affects only the quality of diagnostics, why bother? */
#ifndef __cplusplus
-# if (201112L <= __STDC_VERSION__ \
+# if (201112 <= __STDC_VERSION__ \
|| (!defined __STRICT_ANSI__ \
&& (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 5 <= __clang_major__)))
# define _GL_HAVE__STATIC_ASSERT 1
# endif
-# if (202000L <= __STDC_VERSION__ \
+# if (202311 <= __STDC_VERSION__ \
|| (!defined __STRICT_ANSI__ && 9 <= __GNUC__))
# define _GL_HAVE__STATIC_ASSERT1 1
# endif
@@ -202,12 +202,12 @@ template <int w>
This macro requires three or more arguments but uses at most the first
two, so that the _Static_assert macro optionally defined below supports
- both the C11 two-argument syntax and the C2x one-argument syntax.
+ both the C11 two-argument syntax and the C23 one-argument syntax.
Unfortunately, unlike C11, this implementation must appear as an
ordinary declaration, and cannot appear inside struct { ... }. */
-#if 200410 <= __cpp_static_assert
+#if 202311 <= __STDC_VERSION__ || 200410 <= __cpp_static_assert
# define _GL_VERIFY(R, DIAGNOSTIC, ...) static_assert (R, DIAGNOSTIC)
#elif defined _GL_HAVE__STATIC_ASSERT
# define _GL_VERIFY(R, DIAGNOSTIC, ...) _Static_assert (R, DIAGNOSTIC)
@@ -223,17 +223,44 @@ template <int w>
/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */
#ifdef _GL_STATIC_ASSERT_H
# if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
-# define _Static_assert(...) \
- _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
+# if !defined _MSC_VER || defined __clang__
+# define _Static_assert(...) \
+ _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
+# else
+ /* Work around MSVC preprocessor incompatibility with ISO C; see
+ <https://stackoverflow.com/questions/5134523/>. */
+# define _Static_assert(R, ...) \
+ _GL_VERIFY ((R), "static assertion failed", -)
+# endif
# endif
-# if __cpp_static_assert < 201411 && !defined static_assert
-# define static_assert _Static_assert /* C11 requires this #define. */
+# if (!defined static_assert \
+ && __STDC_VERSION__ < 202311 \
+ && (!defined __cplusplus \
+ || (__cpp_static_assert < 201411 \
+ && __GNUG__ < 6 && __clang_major__ < 6)))
+# if defined __cplusplus && _MSC_VER >= 1900 && !defined __clang__
+/* MSVC 14 in C++ mode supports the two-arguments static_assert but not
+ the one-argument static_assert, and it does not support _Static_assert.
+ We have to play preprocessor tricks to distinguish the two cases.
+ Since the MSVC preprocessor is not ISO C compliant (see above),.
+ the solution is specific to MSVC. */
+# define _GL_EXPAND(x) x
+# define _GL_SA1(a1) static_assert ((a1), "static assertion failed")
+# define _GL_SA2 static_assert
+# define _GL_SA3 static_assert
+# define _GL_SA_PICK(x1,x2,x3,x4,...) x4
+# define static_assert(...) _GL_EXPAND(_GL_SA_PICK(__VA_ARGS__,_GL_SA3,_GL_SA2,_GL_SA1)) (__VA_ARGS__)
+# else
+# define static_assert _Static_assert /* C11 requires this #define. */
+# endif
# endif
#endif
/* @assert.h omit start@ */
-#if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))
+#if defined __clang_major__ && __clang_major__ < 5
+# define _GL_HAS_BUILTIN_TRAP 0
+#elif 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))
# define _GL_HAS_BUILTIN_TRAP 1
#elif defined __has_builtin
# define _GL_HAS_BUILTIN_TRAP __has_builtin (__builtin_trap)
@@ -241,7 +268,9 @@ template <int w>
# define _GL_HAS_BUILTIN_TRAP 0
#endif
-#if 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+#if defined __clang_major__ && __clang_major__ < 5
+# define _GL_HAS_BUILTIN_UNREACHABLE 0
+#elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
# define _GL_HAS_BUILTIN_UNREACHABLE 1
#elif defined __has_builtin
# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
@@ -303,7 +332,7 @@ template <int w>
# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
#elif 1200 <= _MSC_VER
# define assume(R) __assume (R)
-#elif 202311L <= __STDC_VERSION__
+#elif 202311 <= __STDC_VERSION__
# include <stddef.h>
# define assume(R) ((R) ? (void) 0 : unreachable ())
#elif (defined GCC_LINT || defined lint) && _GL_HAS_BUILTIN_TRAP
diff --git a/lib/vsnprintf.c b/lib/vsnprintf.c
index 80999e9b4..acd4e2d4e 100644
--- a/lib/vsnprintf.c
+++ b/lib/vsnprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 2004, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006-2023 Free Software Foundation, Inc.
Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/w32sock.h b/lib/w32sock.h
index 17db3f12a..84e46e335 100644
--- a/lib/w32sock.h
+++ b/lib/w32sock.h
@@ -1,6 +1,6 @@
/* w32sock.h --- internal auxiliary functions for Windows socket functions
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/warn-on-use.h b/lib/warn-on-use.h
index 94f5b9201..30756034a 100644
--- a/lib/warn-on-use.h
+++ b/lib/warn-on-use.h
@@ -1,5 +1,5 @@
/* A C macro for emitting warnings if a function is used.
- Copyright (C) 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2010-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
diff --git a/lib/wchar.in.h b/lib/wchar.in.h
index 835ddbe65..09c9185f6 100644
--- a/lib/wchar.in.h
+++ b/lib/wchar.in.h
@@ -1,6 +1,6 @@
/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -99,7 +99,14 @@
can be freed via 'free'; it can be used only after declaring 'free'. */
/* Applies to: functions. Cannot be used on inline functions. */
#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
-# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+# if defined __cplusplus && defined __GNUC__ && !defined __clang__
+/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
+# else
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC (free, 1)
+# endif
#endif
/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
@@ -745,7 +752,10 @@ _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
/* Return the number of wide characters in S, but at most MAXLEN. */
#if @GNULIB_WCSNLEN@
-# if !@HAVE_WCSNLEN@
+/* On Solaris 11.3, the header files declare the function in the std::
+ namespace, not in the global namespace. So, force a declaration in
+ the global namespace. */
+# if !@HAVE_WCSNLEN@ || (defined __sun && defined __cplusplus)
_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
_GL_ATTRIBUTE_PURE);
# endif
@@ -782,7 +792,10 @@ _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
/* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
#if @GNULIB_WCPCPY@
-# if !@HAVE_WCPCPY@
+/* On Solaris 11.3, the header files declare the function in the std::
+ namespace, not in the global namespace. So, force a declaration in
+ the global namespace. */
+# if !@HAVE_WCPCPY@ || (defined __sun && defined __cplusplus)
_GL_FUNCDECL_SYS (wcpcpy, wchar_t *,
(wchar_t *restrict dest, const wchar_t *restrict src));
# endif
@@ -823,7 +836,10 @@ _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
/* Copy no more than N characters of SRC to DEST, returning the address of
the last character written into DEST. */
#if @GNULIB_WCPNCPY@
-# if !@HAVE_WCPNCPY@
+/* On Solaris 11.3, the header files declare the function in the std::
+ namespace, not in the global namespace. So, force a declaration in
+ the global namespace. */
+# if !@HAVE_WCPNCPY@ || (defined __sun && defined __cplusplus)
_GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
(wchar_t *restrict dest,
const wchar_t *restrict src, size_t n));
@@ -925,7 +941,10 @@ _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
/* Compare S1 and S2, ignoring case. */
#if @GNULIB_WCSCASECMP@
-# if !@HAVE_WCSCASECMP@
+/* On Solaris 11.3, the header files declare the function in the std::
+ namespace, not in the global namespace. So, force a declaration in
+ the global namespace. */
+# if !@HAVE_WCSCASECMP@ || (defined __sun && defined __cplusplus)
_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
_GL_ATTRIBUTE_PURE);
# endif
@@ -942,7 +961,10 @@ _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
/* Compare no more than N chars of S1 and S2, ignoring case. */
#if @GNULIB_WCSNCASECMP@
-# if !@HAVE_WCSNCASECMP@
+/* On Solaris 11.3, the header files declare the function in the std::
+ namespace, not in the global namespace. So, force a declaration in
+ the global namespace. */
+# if !@HAVE_WCSNCASECMP@ || (defined __sun && defined __cplusplus)
_GL_FUNCDECL_SYS (wcsncasecmp, int,
(const wchar_t *s1, const wchar_t *s2, size_t n)
_GL_ATTRIBUTE_PURE);
@@ -1009,7 +1031,10 @@ _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
# endif
_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
# else
-# if !@HAVE_WCSDUP@ || __GNUC__ >= 11
+/* On Solaris 11.3, the header files declare the function in the std::
+ namespace, not in the global namespace. So, force a declaration in
+ the global namespace. */
+# if !@HAVE_WCSDUP@ || (defined __sun && defined __cplusplus) || __GNUC__ >= 11
_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
(const wchar_t *s)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
diff --git a/lib/wcrtomb.c b/lib/wcrtomb.c
index e14d8022a..48a6c8ebe 100644
--- a/lib/wcrtomb.c
+++ b/lib/wcrtomb.c
@@ -1,5 +1,5 @@
/* Convert wide character to multibyte character.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/wctype-h.c b/lib/wctype-h.c
index 127814330..7d3e14a6b 100644
--- a/lib/wctype-h.c
+++ b/lib/wctype-h.c
@@ -1,6 +1,6 @@
/* Inline functions for <wctype.h>.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/wctype.in.h b/lib/wctype.in.h
index 98cafee77..f6e474d38 100644
--- a/lib/wctype.in.h
+++ b/lib/wctype.in.h
@@ -1,6 +1,6 @@
/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
- Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/windows-initguard.h b/lib/windows-initguard.h
index a29d7e97b..9d36f53c8 100644
--- a/lib/windows-initguard.h
+++ b/lib/windows-initguard.h
@@ -1,5 +1,5 @@
/* Init guards, somewhat like spinlocks (native Windows implementation).
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/windows-spawn.c b/lib/windows-spawn.c
index a9212d485..f864db131 100644
--- a/lib/windows-spawn.c
+++ b/lib/windows-spawn.c
@@ -1,5 +1,5 @@
/* Auxiliary functions for the creation of subprocesses. Native Windows API.
- Copyright (C) 2001, 2003-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This file is free software: you can redistribute it and/or modify
@@ -24,7 +24,6 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -324,14 +323,21 @@ init_inheritable_handles (struct inheritable_handles *inh_handles,
HANDLE handle = (HANDLE) _get_osfhandle (fd);
if (handle != INVALID_HANDLE_VALUE)
{
- DWORD hflags;
- /* GetHandleInformation
- <https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-gethandleinformation> */
- if (GetHandleInformation (handle, &hflags))
+ if (duplicate)
+ /* We will add fd to the array, regardless of whether it is
+ inheritable or not. */
+ break;
+ else
{
- if ((hflags & HANDLE_FLAG_INHERIT) != 0)
- /* fd denotes an inheritable descriptor. */
- break;
+ DWORD hflags;
+ /* GetHandleInformation
+ <https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-gethandleinformation> */
+ if (GetHandleInformation (handle, &hflags))
+ {
+ if ((hflags & HANDLE_FLAG_INHERIT) != 0)
+ /* fd denotes an inheritable descriptor. */
+ break;
+ }
}
}
}
@@ -339,31 +345,23 @@ init_inheritable_handles (struct inheritable_handles *inh_handles,
}
/* Note: handles_count >= 3. */
- /* Allocate the arrays. */
+ /* Allocate the array. */
size_t handles_allocated = handles_count;
- HANDLE *handles_array =
- (HANDLE *) malloc (handles_allocated * sizeof (HANDLE));
- if (handles_array == NULL)
- {
- errno = ENOMEM;
- return -1;
- }
- unsigned char *flags_array =
- (unsigned char *) malloc (handles_allocated * sizeof (unsigned char));
- if (flags_array == NULL)
+ struct IHANDLE *ih =
+ (struct IHANDLE *) malloc (handles_allocated * sizeof (struct IHANDLE));
+ if (ih == NULL)
{
- free (handles_array);
errno = ENOMEM;
return -1;
}
- /* Fill in the two arrays. */
+ /* Fill in the array. */
{
HANDLE curr_process = (duplicate ? GetCurrentProcess () : INVALID_HANDLE_VALUE);
unsigned int fd;
for (fd = 0; fd < handles_count; fd++)
{
- handles_array[fd] = INVALID_HANDLE_VALUE;
+ ih[fd].handle = INVALID_HANDLE_VALUE;
/* _get_osfhandle
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/get-osfhandle> */
HANDLE handle = (HANDLE) _get_osfhandle (fd);
@@ -374,29 +372,42 @@ init_inheritable_handles (struct inheritable_handles *inh_handles,
<https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-gethandleinformation> */
if (GetHandleInformation (handle, &hflags))
{
- if ((hflags & HANDLE_FLAG_INHERIT) != 0)
+ if (duplicate)
{
- /* fd denotes an inheritable descriptor. */
- if (duplicate)
+ /* Add fd to the array, regardless of whether it is
+ inheritable or not. */
+ if ((hflags & HANDLE_FLAG_INHERIT) != 0)
+ {
+ /* Instead of duplicating it, just mark it as shared. */
+ ih[fd].handle = handle;
+ ih[fd].flags = KEEP_OPEN_IN_PARENT | KEEP_OPEN_IN_CHILD;
+ }
+ else
{
if (!DuplicateHandle (curr_process, handle,
- curr_process, &handles_array[fd],
+ curr_process, &ih[fd].handle,
0, TRUE, DUPLICATE_SAME_ACCESS))
{
unsigned int i;
for (i = 0; i < fd; i++)
- if (handles_array[i] != INVALID_HANDLE_VALUE)
- CloseHandle (handles_array[i]);
- free (flags_array);
- free (handles_array);
+ if (ih[i].handle != INVALID_HANDLE_VALUE
+ && !(ih[i].flags & KEEP_OPEN_IN_PARENT))
+ CloseHandle (ih[i].handle);
+ free (ih);
errno = EBADF; /* arbitrary */
return -1;
}
+ ih[fd].flags = 0;
+ }
+ }
+ else
+ {
+ if ((hflags & HANDLE_FLAG_INHERIT) != 0)
+ {
+ /* fd denotes an inheritable descriptor. */
+ ih[fd].handle = handle;
+ ih[fd].flags = KEEP_OPEN_IN_CHILD;
}
- else
- handles_array[fd] = handle;
-
- flags_array[fd] = 0;
}
}
}
@@ -406,8 +417,7 @@ init_inheritable_handles (struct inheritable_handles *inh_handles,
/* Return the result. */
inh_handles->count = handles_count;
inh_handles->allocated = handles_allocated;
- inh_handles->handles = handles_array;
- inh_handles->flags = flags_array;
+ inh_handles->ih = ih;
return 0;
}
@@ -418,9 +428,9 @@ compose_handles_block (const struct inheritable_handles *inh_handles,
/* STARTUPINFO
<https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfoa> */
sinfo->dwFlags = STARTF_USESTDHANDLES;
- sinfo->hStdInput = inh_handles->handles[0];
- sinfo->hStdOutput = inh_handles->handles[1];
- sinfo->hStdError = inh_handles->handles[2];
+ sinfo->hStdInput = inh_handles->ih[0].handle;
+ sinfo->hStdOutput = inh_handles->ih[1].handle;
+ sinfo->hStdError = inh_handles->ih[2].handle;
/* On newer versions of Windows, more file descriptors / handles than the
first three can be passed.
@@ -471,11 +481,11 @@ compose_handles_block (const struct inheritable_handles *inh_handles,
handles_aligned[fd] = INVALID_HANDLE_VALUE;
flags[fd] = 0;
- HANDLE handle = inh_handles->handles[fd];
+ HANDLE handle = inh_handles->ih[fd].handle;
if (handle != INVALID_HANDLE_VALUE
/* The first three are possibly already passed above.
But they need to passed here as well, if they have some flags. */
- && (fd >= 3 || inh_handles->flags[fd] != 0))
+ && (fd >= 3 || (unsigned char) inh_handles->ih[fd].flags != 0))
{
DWORD hflags;
/* GetHandleInformation
@@ -490,7 +500,7 @@ compose_handles_block (const struct inheritable_handles *inh_handles,
flags[fd] = 1. But on ReactOS or Wine, adding the bit
that indicates the handle type may be necessary. So,
just do it everywhere. */
- flags[fd] = 1 | inh_handles->flags[fd];
+ flags[fd] = 1 | (unsigned char) inh_handles->ih[fd].flags;
switch (GetFileType (handle))
{
case FILE_TYPE_CHAR:
@@ -522,8 +532,7 @@ compose_handles_block (const struct inheritable_handles *inh_handles,
void
free_inheritable_handles (struct inheritable_handles *inh_handles)
{
- free (inh_handles->flags);
- free (inh_handles->handles);
+ free (inh_handles->ih);
}
int
@@ -619,9 +628,12 @@ spawnpvech (int mode,
errno = saved_errno;
return -1;
}
- inh_handles.handles[0] = stdin_handle; inh_handles.flags[0] = 0;
- inh_handles.handles[1] = stdout_handle; inh_handles.flags[1] = 0;
- inh_handles.handles[2] = stderr_handle; inh_handles.flags[2] = 0;
+ inh_handles.ih[0].handle = stdin_handle;
+ inh_handles.ih[0].flags = KEEP_OPEN_IN_CHILD;
+ inh_handles.ih[1].handle = stdout_handle;
+ inh_handles.ih[1].flags = KEEP_OPEN_IN_CHILD;
+ inh_handles.ih[2].handle = stderr_handle;
+ inh_handles.ih[2].flags = KEEP_OPEN_IN_CHILD;
/* CreateProcess
<https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa> */
diff --git a/lib/windows-spawn.h b/lib/windows-spawn.h
index 0be407bf9..42c5af771 100644
--- a/lib/windows-spawn.h
+++ b/lib/windows-spawn.h
@@ -1,5 +1,5 @@
/* Auxiliary functions for the creation of subprocesses. Native Windows API.
- Copyright (C) 2001, 2003-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This file is free software: you can redistribute it and/or modify
@@ -18,7 +18,6 @@
#ifndef _WINDOWS_SPAWN_H
#define _WINDOWS_SPAWN_H
-#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
@@ -85,10 +84,43 @@ extern char * compose_envblock (const char * const *envp)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
-/* This struct keeps track of which handles to pass to a subprocess, and with
- which flags. All of the handles here are inheritable.
+/* An inheritable handle with some additional information. */
+struct IHANDLE
+{
+ /* Either INVALID_HANDLE_VALUE or an inheritable handle. */
+ HANDLE handle;
+ /* Only relevant if handle != INVALID_HANDLE_VALUE.
+ It is a bit mask consisting of:
+ - 32 for O_APPEND.
+ - KEEP_OPEN_IN_CHILD if the handle is scheduled to be preserved in the
+ child process.
+ - KEEP_OPEN_IN_PARENT if the handle is shared with (and needs to be kept
+ open in) the parent process.
+ - DELAYED_DUP2_OLDFD if there is a delayed dup2 (oldfd, newfd) and
+ this IHANDLE is at position oldfd.
+ - DELAYED_DUP2_NEWFD if there is a delayed dup2 (oldfd, newfd) and
+ this IHANDLE is at position newfd.
+ Note that DELAYED_DUP2_OLDFD and DELAYED_DUP2_NEWFD cannot be set in the
+ same IHANDLE. */
+ unsigned short flags;
+ #define KEEP_OPEN_IN_CHILD 0x100
+ #define KEEP_OPEN_IN_PARENT 0x200
+ #define DELAYED_DUP2_OLDFD 0x400
+ #define DELAYED_DUP2_NEWFD 0x800
+ /* Only relevant if handle != INVALID_HANDLE_VALUE and flags contains
+ either DELAYED_DUP2_OLDFD or DELAYED_DUP2_NEWFD.
+ It is the other fd of the delayed dup2 (oldfd, newfd), i.e.
+ - for DELAYED_DUP2_OLDFD, the newfd,
+ - for DELAYED_DUP2_NEWFD, the oldfd. */
+ int linked_fd;
+};
+
+/* This struct keeps track of which handles to potentially pass to a subprocess,
+ and with which flags. All of the handles here are inheritable.
Regarding handle inheritance, see
- <https://docs.microsoft.com/en-us/windows/win32/sysinfo/handle-inheritance> */
+ <https://docs.microsoft.com/en-us/windows/win32/sysinfo/handle-inheritance>.
+ Whether a handle is actually scheduled for being preserved in the child
+ process is determined by the KEEP_OPEN_IN_CHILD bit in the flags. */
struct inheritable_handles
{
/* The number of occupied entries in the two arrays below.
@@ -96,20 +128,16 @@ struct inheritable_handles
size_t count;
/* The number of allocated entries in the two arrays below. */
size_t allocated;
- /* handles[0..count-1] are the occupied entries.
- handles[fd] is either INVALID_HANDLE_VALUE or an inheritable handle. */
- HANDLE *handles;
- /* flags[0..count-1] are the occupied entries.
- flags[fd] is only relevant if handles[fd] != INVALID_HANDLE_VALUE.
- It is a bit mask consisting of:
- - 32 for O_APPEND.
- */
- unsigned char *flags;
+ /* ih[0..count-1] are the occupied entries. */
+ struct IHANDLE *ih;
};
-/* Initializes a set of inheritable handles, filling in all inheritable handles
- assigned to file descriptors.
- If DUPLICATE is true, the handles stored in the set are duplicates.
+/* Initializes a set of inheritable handles, filling in all or part of the
+ file descriptors of the current process.
+ If DUPLICATE is true, the handles stored are those of all file descriptors,
+ and we use DuplicateHandle to make sure that they are all inheritable.
+ If DUPLICATE is false, the handles stored are only the inheritables ones;
+ this is a shortcut for spawnpvech().
Returns 0 upon success. In case of failure, -1 is returned, with errno set.
*/
extern int init_inheritable_handles (struct inheritable_handles *inh_handles,
diff --git a/lib/write.c b/lib/write.c
index bcbc97c63..d2fc18a77 100644
--- a/lib/write.c
+++ b/lib/write.c
@@ -1,5 +1,5 @@
/* POSIX compatible write() function.
- Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This file is free software: you can redistribute it and/or modify
diff --git a/lib/xalloc-oversized.h b/lib/xalloc-oversized.h
index aefa6fd80..5dbdfb550 100644
--- a/lib/xalloc-oversized.h
+++ b/lib/xalloc-oversized.h
@@ -1,6 +1,6 @@
/* xalloc-oversized.h -- memory allocation size checking
- Copyright (C) 1990-2000, 2003-2004, 2006-2022 Free Software Foundation, Inc.
+ Copyright (C) 1990-2000, 2003-2004, 2006-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/xsize.c b/lib/xsize.c
index 761e3434d..279ae824f 100644
--- a/lib/xsize.c
+++ b/lib/xsize.c
@@ -1,6 +1,6 @@
/* Checked size_t computations.
- Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
diff --git a/lib/xsize.h b/lib/xsize.h
index 0bfa4c889..1ec78e776 100644
--- a/lib/xsize.h
+++ b/lib/xsize.h
@@ -1,6 +1,6 @@
/* xsize.h -- Checked size_t computations.
- Copyright (C) 2003, 2008-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as