]> git.ipfire.org Git - thirdparty/gnulib.git/log
thirdparty/gnulib.git
4 months agolog10f: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:43 +0000 (12:42 +0200)] 
log10f: Remove support for OSF/1.

* m4/log10f.m4 (gl_FUNC_LOG10F_WORKS): Remove macro.
(gl_FUNC_LOG10F): Don't invoke it.
* lib/log10f.c (log10f): Assume that log10f (±0.0f) is correct.

4 months agolog10: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:40 +0000 (12:42 +0200)] 
log10: Remove support for OSF/1.

* m4/log10.m4 (gl_FUNC_LOG10_WORKS): Remove macro.
(gl_FUNC_LOG10): Don't invoke it.
* lib/log10.c (log10): Assume that log10 (±0.0) is correct.

4 months agologl: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:37 +0000 (12:42 +0200)] 
logl: Remove support for OSF/1.

* m4/logl.m4 (gl_FUNC_LOGL_WORKS): Remove test regarding logl (-0.0L).
* lib/logl.c (logl): Remove workaround for OSF/1.

4 months agologf: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:35 +0000 (12:42 +0200)] 
logf: Remove support for OSF/1.

* m4/logf.m4 (gl_FUNC_LOGF_WORKS): Remove macro.
(gl_FUNC_LOGF): Don't invoke it.
* lib/logf.c (logf): Assume that logf (±0.0f) is correct.

4 months agolog: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:31 +0000 (12:42 +0200)] 
log: Remove support for OSF/1.

* m4/log.m4 (gl_FUNC_LOG_WORKS): Remove macro.
(gl_FUNC_LOG): Don't invoke it.
* lib/log.c (log): Assume that log (±0.0) is correct.

4 months agolocalcharset: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:27 +0000 (12:42 +0200)] 
localcharset: Remove support for OSF/1.

* lib/localcharset.h: Update comments.
* lib/localcharset.c (alias_table): Remove entries for OSF/1.

4 months agoldd: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:24 +0000 (12:42 +0200)] 
ldd: Remove support for OSF/1.

* m4/ldd.m4 (gl_LDD): Remove code for OSF/1.

4 months agoiconv_open: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:20 +0000 (12:42 +0200)] 
iconv_open: Remove support for OSF/1.

* m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN): Remove code for OSF/1.
* lib/iconv_open.c (ICONV_FLAVOR_OSF): Remove macro.
(rpl_iconv_open): Update comments.
* lib/iconv_open-osf.gperf: Remove file.
* modules/iconv_open (Files): Remove it.
(Makefile.am): Remove rule for $(srcdir)/iconv_open-osf.h. Update
BUILT_SOURCES, MOSTLYCLEANFILES, MAINTAINERCLEANFILES, EXTRA_DIST
accordingly.

4 months agogetprogname: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:17 +0000 (12:42 +0200)] 
getprogname: Remove support for OSF/1.

* lib/getprogname.c: Remove code for OSF/1.

4 months agogetlogin_r: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:14 +0000 (12:42 +0200)] 
getlogin_r: Remove support for OSF/1.

* m4/getlogin_r.m4 (gl_FUNC_GETLOGIN_R): Remove cross-compilation guess
for OSF/1.

4 months agogetloadavg: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:11 +0000 (12:42 +0200)] 
getloadavg: Remove support for OSF/1.

* lib/getloadavg.c: Remove code for OSF/1.

4 months agoget-rusage-data: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:07 +0000 (12:42 +0200)] 
get-rusage-data: Remove support for OSF/1.

* lib/get-rusage-data.c (get_rusage_data): Remove code for OSF/1.

4 months agofsusage: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:04 +0000 (12:42 +0200)] 
fsusage: Remove support for OSF/1.

* lib/fsusage.c (get_fs_usage): Remove code for STAT_STATFS3_OSF1.
* m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Remove test for for 3-argument
statfs function.

4 months agofmodl-ieee: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:42:01 +0000 (12:42 +0200)] 
fmodl-ieee: Remove support for OSF/1.

* m4/fmodl.m4 (gl_FUNC_FMODL): Don't test against OSF/1 bug.

4 months agofmodf-ieee: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:41:57 +0000 (12:41 +0200)] 
fmodf-ieee: Remove support for OSF/1.

* m4/fmodf.m4 (gl_FUNC_FMODF): Don't test against OSF/1 bug.

4 months agofmod: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:41:53 +0000 (12:41 +0200)] 
fmod: Remove support for OSF/1.

* m4/fmod.m4 (gl_FUNC_FMOD): Don't test against OSF/1 bug.

4 months agofcntl-h: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:41:48 +0000 (12:41 +0200)] 
fcntl-h: Remove support for OSF/1.

* lib/fcntl.in.h (O_DIRECT): Don't test for O_DIRECTIO.

4 months agoerrno-iter, strerrorname_np: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:40:36 +0000 (12:40 +0200)] 
errno-iter, strerrorname_np: Remove support for OSF/1.

* lib/errno-iter.c (errno_iterate): Remove cases for EAIO, ECLONEME,
EDIRTY, EDUPPKG, EEMULATE, EFAIL, EINPROG, EMTIMERS, ERELOCATED,
ESUCCESS, EVERSION.
* lib/strerrorname_np.c (strerrorname_np): Likewise.
* tests/test-strerrorname_np.c (main): Likewise.

4 months agoerrno-h: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:39:02 +0000 (12:39 +0200)] 
errno-h: Remove support for OSF/1.

* lib/errno.in.h: Don't test EMULTIHOP_HIDDEN, ENOLINK_HIDDEN,
EOVERFLOW_HIDDEN.
* m4/errno_h.m4 (gl_REPLACE_ERRNO_VALUE): Remove macro.
(gl_HEADER_ERRNO_H): Don't invoke it.
* modules/errno-h (Makefile.am): Don't substitute EMULTIHOP_HIDDEN,
EMULTIHOP_VALUE, ENOLINK_HIDDEN, ENOLINK_VALUE, EOVERFLOW_HIDDEN,
EOVERFLOW_VALUE.

4 months agofaccessat, truncate: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:38:31 +0000 (12:38 +0200)] 
faccessat, truncate: Remove support for OSF/1.

* lib/faccessat.c: Simplify include of <unistd.h>.
* lib/truncate.c: Likewise.

4 months agofchmodat, fstat, fstatat, lstat, stat: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:38:28 +0000 (12:38 +0200)] 
fchmodat, fstat, fstatat, lstat, stat: Remove support for OSF/1.

* lib/fchmodat.c: Simplify include of <sys/stat.h>.
* lib/fstat.c: Likewise.
* lib/fstatat.c: Likewise.
* lib/lstat.c: Likewise.
* lib/stat.c: Likewise.

4 months agofopen, freopen: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:38:24 +0000 (12:38 +0200)] 
fopen, freopen: Remove support for OSF/1.

* lib/fopen.c: Simplify include of <stdio.h>.
* lib/freopen.c: Likewise.

4 months agocreat, open, openat: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:38:21 +0000 (12:38 +0200)] 
creat, open, openat: Remove support for OSF/1.

* lib/creat.c: Simplify include of <fcntl.h>.
* lib/open.c: Likewise.
* lib/openat.c: Likewise.

4 months agoacl-permissions, file-has-acl: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:37:35 +0000 (12:37 +0200)] 
acl-permissions, file-has-acl: Remove support for OSF/1.

* m4/acl.m4 (gl_FUNC_ACL): Don't test for libpacl.
* lib/acl-internal.h (rpl_acl_get_fd, rpl_acl_set_fd): Remove functions.
* lib/acl-internal.c (acl_access_nontrivial): Remove code for OSF/1.
* lib/acl_entries.c (acl_entries): Likewise.
* lib/file-has-acl.c (fdfile_has_aclinfo): Likewise.
* lib/set-permissions.c (acl_from_mode): Likewise.
* doc/acl-resources.txt: Remove info about OSF/1.

4 months agoacl, file-has-acl, copy-file tests: Remove support for OSF/1.
Bruno Haible [Tue, 9 Sep 2025 10:37:03 +0000 (12:37 +0200)] 
acl, file-has-acl, copy-file tests: Remove support for OSF/1.

* tests/test-file-has-acl.sh: Remove code for OSF/1 ACLs.
* tests/test-set-mode-acl.sh: Likewise.
* tests/test-copy-acl.sh: Likewise.
* tests/test-copy-file.sh: Likewise.
* tests/test-sameacls.c: Update comment.

5 months agostdcountof-h: Add support for C++ compilers that lack _Countof.
Bruno Haible [Mon, 8 Sep 2025 13:22:46 +0000 (15:22 +0200)] 
stdcountof-h: Add support for C++ compilers that lack _Countof.

* lib/stdcountof.in.h: Use include_next idiom. In C++ mode, test
CXX_HAVE_STDCOUNTOF_H instead of HAVE_STDCOUNTOF_H.
* m4/stdcountof_h.m4 (gl_STDCOUNTOF_H): Invoke gl_CHECK_NEXT_HEADERS.
Set CXX_HAVE_STDCOUNTOF_H. Consider CXX_HAVE_STDCOUNTOF_H when setting
GL_GENERATE_STDCOUNTOF_H.
* modules/stdcountof-h (Depends-on): Add include_next.
(Makefile.am): Substitute GUARD_PREFIX, HAVE_STDCOUNTOF_H,
CXX_HAVE_STDCOUNTOF_H, INCLUDE_NEXT, PRAGMA_SYSTEM_HEADER,
PRAGMA_COLUMNS, NEXT_STDCOUNTOF_H.

5 months agostdcountof-h tests: Fix compilation error with clang 21.
Bruno Haible [Mon, 8 Sep 2025 11:42:54 +0000 (13:42 +0200)] 
stdcountof-h tests: Fix compilation error with clang 21.

* tests/test-stdcountof-h.c (test_func): Don't use _gl_verify_is_array
if it's not defined.

5 months agoannounce-gen: Improve efficiency of "git clone".
Bruno Haible [Mon, 8 Sep 2025 06:36:06 +0000 (08:36 +0200)] 
announce-gen: Improve efficiency of "git clone".

* build-aux/announce-gen: Use read-only mirrors of git.savannah.gnu.org.

5 months agomaint: allow false/true in C macros
Paul Eggert [Sun, 7 Sep 2025 23:34:43 +0000 (16:34 -0700)] 
maint: allow false/true in C macros

* top/maint.mk (sc_Wundef_boolean): Allow false and true in C
macro definiens.  C23 requires support for false and true, and the
‘bool’ module makes it easy to support this in older compilers.

5 months agobootstrap: Improve efficiency of "git clone".
Bruno Haible [Sun, 7 Sep 2025 23:20:01 +0000 (01:20 +0200)] 
bootstrap: Improve efficiency of "git clone".

* top/bootstrap-funclib.sh (default_gnulib_url): Use read-only mirror of
git.savannah.gnu.org.
* build-aux/bootstrap: Regenerated.

5 months agocrypo/sha3: Fix typo from the previous commit.
Collin Funk [Sat, 6 Sep 2025 23:57:58 +0000 (16:57 -0700)] 
crypo/sha3: Fix typo from the previous commit.

* lib/sha3-stream.c (sha3_xxx_stream): Add missing &'s since
sha3_free_ctx expects a pointer.

5 months agocrypto/sha3-buffer, crypto/sha3: Protect against double frees (regr. today).
Collin Funk [Sat, 6 Sep 2025 23:38:08 +0000 (16:38 -0700)] 
crypto/sha3-buffer, crypto/sha3: Protect against double frees (regr. today).

* lib/sha3.c (sha3_free_ctx): Only free the EVP_MD_CTX if it is not
NULL, and set it to NULL after freeing.
(DEFINE_SHA3_INIT_CTX, sha3_finish_ctx, sha3_process_bytes): Leave
freeing memory to the caller.
* lib/sha3-stream.c (sha3_xxx_stream): Call sha3_free_ctx on success and
if sha3_init_ctx fails.
* tests/test-sha3-224-buffer.c (main): Add a test that would otherwise
segfault without this patch.
* tests/test-sha3-256-buffer.c (main): Likewise.
* tests/test-sha3-384-buffer.c (main): Likewise.
* tests/test-sha3-512-buffer.c (main): Likewise.

5 months agocrypto/sha3-buffer: Set errno when OpenSSL functions fail.
Collin Funk [Sat, 6 Sep 2025 20:11:14 +0000 (13:11 -0700)] 
crypto/sha3-buffer: Set errno when OpenSSL functions fail.

* lib/sha3.c: Include <errno.h>
(DEFINE_SHA3_INIT_CTX): Set errno to ENOMEM if function fails.
(sha3_finish_ctx, sha3_process_block): Set errno to EINVAL on failure.

5 months agocrypto/sha3, crypto/sha3-buffer: Don't leak memory when using OpenSSL.
Collin Funk [Sat, 6 Sep 2025 17:55:40 +0000 (10:55 -0700)] 
crypto/sha3, crypto/sha3-buffer: Don't leak memory when using OpenSSL.

Reported by Pádraig Brady in:
<https://lists.gnu.org/archive/html/bug-gnulib/2025-09/msg00058.html>.

* lib/sha3.c (DEFINE_SHA3_INIT_CTX) [!HAVE_OPENSSL_SHA3]: Always return
true.
[HAVE_OPENSSL_SHA3]: Call EVP_MD_CTX_create to allocate an EVP_MD_CTX.
(DEFINE_SHA3_BUFFER, sha3_process_bytes, sha3_process_block)
[!HAVE_OPENSSL_SHA3]: Always return true.
[HAVE_OPENSSL_SHA3]: Return NULL if any function calls fail.
(sha3_finish_ctx) [HAVE_OPENSSL_SHA3]: Free memory allocated by
EV_MD_CTX_create.
(sha3_free_ctx): New function.
* lib/sha3.h (struct sha3_ctx): Use a heap allocated EVP_MD_CTX.
(sha3_224_init_ctx, sha3_256_init_ctx, sha3_384_init_ctx)
(sha3_512_init_ctx, sha3_process_block, sha3_process_bytes): Change
prototype to return a bool. Mention that they return false if an OpenSSL
function fails.
(sha3_finish_ctx, sha3_read_ctx, sha3_224_buffer, sha3_256_buffer)
(sha3_384_buffer, sha3_512_buffer): Mention that these functions return
NULL if an OpenSSL function fails.
(sha3_free_ctx): New function.
* lib/sha3-stream.c (sha3_xxx_stream): Expect a function parameter that
returns bool. Check the return values of the sha3 functions, cleaning up
memory on failure.
* modules/crypto/sha3-buffer: Add bool.

5 months agogitsub.sh: Support URL redirections also for subcheckouts.
Bruno Haible [Sat, 6 Sep 2025 14:43:04 +0000 (16:43 +0200)] 
gitsub.sh: Support URL redirections also for subcheckouts.

* top/gitsub.sh (func_expand): New function.
(func_pull): Invoke it, and show a message about redirection.

5 months agoquotearg: Remove an unused variable.
Collin Funk [Sat, 6 Sep 2025 01:52:43 +0000 (18:52 -0700)] 
quotearg: Remove an unused variable.

* lib/quotearg.c (gettext_quote): Remove a variable that is no longer
used after yesterdays changes.

5 months agodfa, propername-lite, quotearg: prefer mbszero
Paul Eggert [Fri, 5 Sep 2025 22:18:31 +0000 (15:18 -0700)] 
dfa, propername-lite, quotearg: prefer mbszero

Problem reported by Collin Funk in:
https://lists.gnu.org/r/bug-gnulib/2025-09/msg00063.html
* lib/dfa.c (mbszero) [GAWK]: Omit unnecessary parens.
* lib/localeinfo.c (mbszero) [GAWK]: New macro, copied from dfa.c.
(is_using_utf8, init_localeinfo): Use it.
* lib/propername-lite.c (proper_name_lite):
* lib/quotearg.c (gettext_quote):
Prefer mbszero to initializing the entire mbstate_t.

5 months agounlocked-io: also deal with fileno
Paul Eggert [Fri, 5 Sep 2025 20:54:08 +0000 (13:54 -0700)] 
unlocked-io: also deal with fileno

This shouldn’t affect performance on glibc, where fileno and
fileno_unlocked are aliases under the theory that no locking is needed.
However, it might help a bit on platforms like FreeBSD where
fileno_unlocked is inline and does not lock.
* lib/unlocked-io.h (fileno, fileno_unlocked):
Define as needed, similarly to fgets etc.
* m4/unlocked-io.m4 (gl_FUNC_GLIBC_UNLOCKED_IO):
Also check fileno_unlocked.

5 months agoprogname: static check instead of dynamic
Paul Eggert [Fri, 5 Sep 2025 20:04:09 +0000 (13:04 -0700)] 
progname: static check instead of dynamic

* lib/progname.c: Don’t include stdio.h or stdlib.h.
(set_program_name): Omit dynamic check that (with current glibc
optimization) drags in fwrite even when unlocked I/O is wanted.
The check was not all that useful in practice and we now have a
static one anyway (which admittedly is not that useful either).
Prefer memcmp to strncmp when equivalent, for clarity.
* lib/progname.h: Include arg-nonnull.h and declare
set_program_name with _GL_ARG_NONNULL.
* modules/progname (Depends-on): Add snippet/arg-nonnull.

5 months agopropername-lite: simplify USE_MBRTOC32 away
Paul Eggert [Fri, 5 Sep 2025 15:28:56 +0000 (08:28 -0700)] 
propername-lite: simplify USE_MBRTOC32 away

* lib/propername-lite.c (USE_MBRTOC32): Remove.
Replace its use with HAVE_UCHAR_H.

5 months agopropername-lite: Fix compilation error on Haiku r1/beta4 (regr. today).
Bruno Haible [Fri, 5 Sep 2025 09:33:44 +0000 (11:33 +0200)] 
propername-lite: Fix compilation error on Haiku r1/beta4 (regr. today).

* lib/propername-lite.c: Test HAVE_UCHAR_H instead of relying on
__has_include.
* modules/propername-lite (Depends-on): Add uchar-h.

5 months agoquotearg: Improve comment.
Bruno Haible [Fri, 5 Sep 2025 09:01:29 +0000 (11:01 +0200)] 
quotearg: Improve comment.

* lib/quotearg.c (gettext_quote): Improve terminology. Use standard
encoding name.

5 months agopropername-lite: lighten it up some more
Paul Eggert [Fri, 5 Sep 2025 07:15:38 +0000 (00:15 -0700)] 
propername-lite: lighten it up some more

This should help GNU diffutils avoid some Gnulib modules.
* lib/propername-lite.c: Do not include c-strcase.h, localcharset.h.
Include <uchar.h> and mbrtowc32 if available.
Use __has_include to detect this; that should be good enough nowadays.
Use native mbrtoc32 instead of Gnulib replacement; that should
be good enough.  2nd arg is now possibly unused.
Use mbrtoc32, if available, to determine whether UTF-8 is being used,
to avoid dependencies.
* modules/propername-lite (Depends-on):
Remove localcharset, c-strcasecmp.

5 months agoquotearg: do not depend on localcharset
Paul Eggert [Fri, 5 Sep 2025 04:18:30 +0000 (21:18 -0700)] 
quotearg: do not depend on localcharset

* lib/quotearg.c: Do not include localcharset.h.
(gettext_quote): Do not use locale_charset; instead, use
mbrtoc32 to determine whether the character set uses UTF-8.
Treat GB-18030 like similar encodings, as it is not worth the
trouble of special-casing: its special-case code has been broken
since 2011, nobody cared enough to report the bug, and the idea
that someone would use GB-18030 without translations is weird anyway.
* modules/quotearg (Depends-on): Remove localcharset.

5 months agognulib-tool: Improve changes from yesterday and today.
Bruno Haible [Thu, 4 Sep 2025 20:52:44 +0000 (22:52 +0200)] 
gnulib-tool: Improve changes from yesterday and today.

* gnulib-tool.sh (func_emit_tests_Makefile_am): Consider also the case
that --with-tests is specified and --makefile-name /
--tests-makefile-name are not specified. Simplify an initialization and
augmentation to an initialization.
* pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Likewise.

5 months agoextern-inline: mention likely C2y change
Paul Eggert [Thu, 4 Sep 2025 20:42:23 +0000 (13:42 -0700)] 
extern-inline: mention likely C2y change

5 months agocrypto/sha3-buffer: Don't abort on OOM.
Collin Funk [Wed, 3 Sep 2025 02:16:17 +0000 (19:16 -0700)] 
crypto/sha3-buffer: Don't abort on OOM.

* modules/crypto/sha3-buffer (Depends-on): Add stddef-h.
* lib/sha3.h: Include stddef.h.
(sha3_ctx): Use a stack allocated buffer used to cast to store an
EVP_MD_CTX.
* lib/sha3.c (DEFINE_SHA3_INIT_CTX): Initialize the structure to zero.
Use the stack allocated buffer instead of calling EVP_MD_CTX_create.
(sha3_read_ctx): Just call sha3_finish_ctx similar to the other crypto
modules.
(sha3_finish_ctx): Remove call to EVP_MD_CTX_free. Call
EVP_DigestFinal_ex.

5 months agognulib-tool: Avoid Automake error when using --create-testdir (regr. today).
Collin Funk [Thu, 4 Sep 2025 03:18:04 +0000 (20:18 -0700)] 
gnulib-tool: Avoid Automake error when using --create-testdir (regr. today).

* gnulib-tool.sh (func_emit_tests_Makefile_am): Initialize AM_CFLAGS and
AM_CXXFLAGS when creating a test directory.
* pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Likewise.

5 months agognulib-tool: In tests directories, augment AM_CFLAGS and AM_CXXFLAGS.
Bruno Haible [Wed, 3 Sep 2025 22:15:19 +0000 (00:15 +0200)] 
gnulib-tool: In tests directories, augment AM_CFLAGS and AM_CXXFLAGS.

Reported by Pádraig Brady in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-09/>.

* gnulib-tool.sh (func_emit_tests_Makefile_am): Append the
warning-protection options to AM_CFLAGS and AM_CXXFLAGS, in addition to
initializing CFLAGS and CXXFLAGS.
* pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Likewise.
* doc/gnulib-tool.texi (Modified build rules): Document the need to
initialize AM_CFLAGS and AM_CXXFLAGS in tests directories.
* NEWS: Mention the new requirement.

5 months agognulib-tool: Improve C++ awareness of 2021-06-10 / 2024-03-06 commit.
Bruno Haible [Wed, 3 Sep 2025 21:43:45 +0000 (23:43 +0200)] 
gnulib-tool: Improve C++ awareness of 2021-06-10 / 2024-03-06 commit.

* gnulib-tool.sh (func_emit_lib_Makefile_am): If the file list contains
some C++ files, emit also an initialization for
${libname}_${libext}_CXXFLAGS.
(func_emit_tests_Makefile_am): If the file list contains no C++ files,
don't emit an initialization for CXXFLAGS.
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): If the file list
contains some C++ files, emit also an initialization for
${libname}_${libext}_CXXFLAGS.
(GLEmiter.tests_Makefile_am): If the file list contains no C++ files,
don't emit an initialization for CXXFLAGS.

5 months agocrypto/sha3-buffer: Add support for OpenSSL.
Collin Funk [Tue, 2 Sep 2025 05:57:22 +0000 (22:57 -0700)] 
crypto/sha3-buffer: Add support for OpenSSL.

* lib/sha3.c (DEFINE_SHA3_INIT_CTX, sha3_read_ctx, sha3_finish_ctx)
(DEFINE_SHA3_BUFFER, sha3_process_bytes, sha3_process_block)
[HAVE_OPENSSL_SHA3]: Define these functions/macros using the OpenSSL EVP
API.
* lib/sha3.h [HAVE_OPENSSL_SHA3]: Include <openssl/evp.h>.
(struct sha3_ctx) [HAVE_OPENSSL_SHA3]: Only store a pointer to an
EVP_MD_CTX in the structure.
* m4/gl-openssl.m4 (gl_CRYPTO_CHECK): If the argument is SHA3 check for
EVP_sha3_224.
* m4/sha3.m4 (gl_SHA3): New file, based on m4/sha512.m4.
* modules/crypto/sha3-buffer (Files): Add m4/gl-openssl.m4 and
m4/sha3.m4.
(configure.ac): Invoke gl_SHA3. Remove gl_BIGENDIAN.
* modules/crypto/sha3-buffer-tests (Makefile.am): Link to @LIB_CRYPTO@.

5 months agotests: Fix potential link errors.
Bruno Haible [Tue, 2 Sep 2025 14:08:16 +0000 (16:08 +0200)] 
tests: Fix potential link errors.

* modules/mbiter-bench-tests (Makefile.am): Link the benchmark program
with $(LIBICONV).
* modules/mbiterf-bench-tests (Makefile.am): Likewise.
* modules/mbuiter-bench-tests (Makefile.am): Likewise.
* modules/mbuiterf-bench-tests (Makefile.am): Likewise.
* modules/mcel-bench-tests (Makefile.am): Likewise.
* modules/mbswidth-bench-tests (Makefile.am): Likewise.

5 months agoClarify link dependency towards libiconv.
Bruno Haible [Tue, 2 Sep 2025 14:05:31 +0000 (16:05 +0200)] 
Clarify link dependency towards libiconv.

* modules/propername (Link): Document requirement to link with
$(LIBICONV) or $(LTLIBICONV).
* modules/xstriconv (Link): Likewise.

5 months agogetlogin tests: Fix link error on musl libc.
Bruno Haible [Tue, 2 Sep 2025 13:48:04 +0000 (15:48 +0200)] 
getlogin tests: Fix link error on musl libc.

* modules/getlogin-tests (Makefile.am): Link test-getlogin with
$(LIBINTL).

5 months agoClarify link dependency towards libintl on FreeBSD, Solaris, etc.
Bruno Haible [Tue, 2 Sep 2025 12:24:55 +0000 (14:24 +0200)] 
Clarify link dependency towards libintl on FreeBSD, Solaris, etc.

* modules/acl (Link): Document requirement to link with $(LIBINTL) or
$(LTLIBINTL).
* modules/areadlinkat (Link): Likewise.
* modules/areadlinkat-with-size (Link): Likewise.
* modules/argmatch (Link): Likewise.
* modules/argp (Link): Likewise.
* modules/argp-version-etc (Link): Likewise.
* modules/backup-rename (Link): Likewise.
* modules/backupfile (Link): Likewise.
* modules/bitset (Link): Likewise.
* modules/bitsetv (Link): Likewise.
* modules/c-xvasprintf (Link): Likewise.
* modules/canon-host (Link): Likewise.
* modules/canonicalize (Link): Likewise.
* modules/chdir-long (Link): Likewise.
* modules/chmodat (Link): Likewise.
* modules/chownat (Link): Likewise.
* modules/classpath (Link): Likewise.
* modules/clean-temp (Link): Likewise.
* modules/clean-temp-simple (Link): Likewise.
* modules/closein (Link): Likewise.
* modules/closeout (Link): Likewise.
* modules/copy-file (Link): Likewise.
* modules/csharpcomp (Link): Likewise.
* modules/csharpexec (Link): Likewise.
* modules/cygpath (Link): Likewise.
* modules/dfa (Link): Likewise.
* modules/dirname (Link): Likewise.
* modules/error (Link): Likewise.
* modules/exclude (Link): Likewise.
* modules/execute (Link): Likewise.
* modules/faccessat (Link): Likewise.
* modules/fchmodat (Link): Likewise.
* modules/fchownat (Link): Likewise.
* modules/fdopendir (Link): Likewise.
* modules/fdutimensat (Link): Likewise.
* modules/file-set (Link): Likewise.
* modules/file-type (Link): Likewise.
* modules/filenamecat (Link): Likewise.
* modules/findprog (Link): Likewise.
* modules/fstatat (Link): Likewise.
* modules/fstrcmp (Link): Likewise.
* modules/fts (Link): Likewise.
* modules/getcwd (Link): Likewise.
* modules/getlogin (Link): Likewise.
* modules/getopt-gnu (Link): Likewise.
* modules/getopt-posix (Link): Likewise.
* modules/getumask (Link): Likewise.
* modules/getusershell (Link): Likewise.
* modules/glob (Link): Likewise.
* modules/hamt (Link): Likewise.
* modules/hash-triple (Link): Likewise.
* modules/hashcode-file-inode (Link): Likewise.
* modules/human (Link): Likewise.
* modules/idcache (Link): Likewise.
* modules/issymlinkat (Link): Likewise.
* modules/javacomp (Link): Likewise.
* modules/javaexec (Link): Likewise.
* modules/javaversion (Link): Likewise.
* modules/kwset (Link): Likewise.
* modules/lchmod (Link): Likewise.
* modules/linebuffer (Link): Likewise.
* modules/linkat (Link): Likewise.
* modules/list-c++ (Link): Likewise.
* modules/long-options (Link): Likewise.
* modules/map-c++ (Link): Likewise.
* modules/mem-hash-map (Link): Likewise.
* modules/mkancesdirs (Link): Likewise.
* modules/mkdir-p (Link): Likewise.
* modules/mkdirat (Link): Likewise.
* modules/mkfifoat (Link): Likewise.
* modules/modechange (Link): Likewise.
* modules/mountlist (Link): Likewise.
* modules/obstack (Link): Likewise.
* modules/obstack-printf (Link): Likewise.
* modules/obstack-printf-gnu (Link): Likewise.
* modules/obstack-printf-posix (Link): Likewise.
* modules/obstack-zprintf (Link): Likewise.
* modules/obstack-zprintf-gnu (Link): Likewise.
* modules/obstack-zprintf-posix (Link): Likewise.
* modules/omap-c++ (Link): Likewise.
* modules/openat (Link): Likewise.
* modules/openat-die (Link): Likewise.
* modules/openat-safer (Link): Likewise.
* modules/opendirat (Link): Likewise.
* modules/oset-c++ (Link): Likewise.
* modules/pagealign_alloc (Link): Likewise.
* modules/parse-datetime (Link): Likewise.
* modules/parse-datetime2 (Link): Likewise.
* modules/pipe-filter-gi (Link): Likewise.
* modules/pipe-filter-ii (Link): Likewise.
* modules/propername (Link): Likewise.
* modules/propername-lite (Link): Likewise.
* modules/quote (Link): Likewise.
* modules/quotearg (Link): Likewise.
* modules/quotearg-simple (Link): Likewise.
* modules/readlinkat (Link): Likewise.
* modules/readtokens (Link): Likewise.
* modules/readtokens0 (Link): Likewise.
* modules/readutmp (Link): Likewise.
* modules/regex-quote (Link): Likewise.
* modules/relocatable-lib (Link): Likewise.
* modules/relocatable-prog (Link): Likewise.
* modules/renameat (Link): Likewise.
* modules/renameatu (Link): Likewise.
* modules/same (Link): Likewise.
* modules/save-cwd (Link): Likewise.
* modules/savedir (Link): Likewise.
* modules/savewd (Link): Likewise.
* modules/selinux-at (Link): Likewise.
* modules/set-c++ (Link): Likewise.
* modules/sh-quote (Link): Likewise.
* modules/sigpipe-die (Link): Likewise.
* modules/spawn-pipe (Link): Likewise.
* modules/stack (Link): Likewise.
* modules/statat (Link): Likewise.
* modules/string-desc-quotearg (Link): Likewise.
* modules/strsignal (Link): Likewise.
* modules/supersede (Link): Likewise.
* modules/symlinkat (Link): Likewise.
* modules/system-quote (Link): Likewise.
* modules/term-style-control (Link): Likewise.
* modules/timevar (Link): Likewise.
* modules/trim (Link): Likewise.
* modules/unicodeio (Link): Likewise.
* modules/unlinkat (Link): Likewise.
* modules/userspec (Link): Likewise.
* modules/utimecmp (Link): Likewise.
* modules/utimensat (Link): Likewise.
* modules/vc-mtime (Link): Likewise.
* modules/verror (Link): Likewise.
* modules/version-etc (Link): Likewise.
* modules/version-etc-fsf (Link): Likewise.
* modules/wait-process (Link): Likewise.
* modules/windows-cygpath (Link): Likewise.
* modules/xalignalloc (Link): Likewise.
* modules/xalloc (Link): Likewise.
* modules/xalloc-die (Link): Likewise.
* modules/xbinary-io (Link): Likewise.
* modules/xconcat-filename (Link): Likewise.
* modules/xfreopen (Link): Likewise.
* modules/xgetcwd (Link): Likewise.
* modules/xgetcwd-lgpl (Link): Likewise.
* modules/xgetdomainname (Link): Likewise.
* modules/xgetgroups (Link): Likewise.
* modules/xgethostname (Link): Likewise.
* modules/xhash (Link): Likewise.
* modules/xlist (Link): Likewise.
* modules/xmalloca (Link): Likewise.
* modules/xmap (Link): Likewise.
* modules/xmemcoll (Link): Likewise.
* modules/xmemdup0 (Link): Likewise.
* modules/xomap (Link): Likewise.
* modules/xoset (Link): Likewise.
* modules/xprintf (Link): Likewise.
* modules/xprintf-gnu (Link): Likewise.
* modules/xprintf-posix (Link): Likewise.
* modules/xreadlink (Link): Likewise.
* modules/xreadlinkat (Link): Likewise.
* modules/xset (Link): Likewise.
* modules/xsetenv (Link): Likewise.
* modules/xstdopen (Link): Likewise.
* modules/xstrerror (Link): Likewise.
* modules/xstriconv (Link): Likewise.
* modules/xstring-buffer (Link): Likewise.
* modules/xstring-buffer-reversed (Link): Likewise.
* modules/xstring-desc (Link): Likewise.
* modules/xstrndup (Link): Likewise.
* modules/xstrtol-error (Link): Likewise.
* modules/xsublist (Link): Likewise.
* modules/xvasprintf (Link): Likewise.
* modules/xvasprintf-gnu (Link): Likewise.
* modules/xvasprintf-posix (Link): Likewise.
* modules/yesno (Link): Likewise.

5 months agouchar-h: Fix compilation error of <cuchar> in C++ mode on macOS 15.
Bruno Haible [Mon, 1 Sep 2025 22:12:43 +0000 (00:12 +0200)] 
uchar-h: Fix compilation error of <cuchar> in C++ mode on macOS 15.

* lib/uchar.in.h: In C++ mode, use CXX_HAVE_UCHAR_H instead of
HAVE_UCHAR_H.
* m4/uchar_h.m4 (gl_UCHAR_H): Set CXX_HAVE_UCHAR_H.
* modules/uchar-h (Makefile.am): Substitute CXX_HAVE_UCHAR_H.

5 months agoFix the previous two commits.
Collin Funk [Mon, 1 Sep 2025 21:26:59 +0000 (14:26 -0700)] 
Fix the previous two commits.

The issue occurs on alpha not hppa. Also add the glibc bug report link
in comments.

5 months agosys_types-h tests: Fix a static_assert failure on glibc/hppa.
Collin Funk [Mon, 1 Sep 2025 21:01:36 +0000 (14:01 -0700)] 
sys_types-h tests: Fix a static_assert failure on glibc/hppa.

* tests/test-sys_types-h.c [__GLIBC__ && __hppa]: Don't check that
blksize_t and blkcnt_t are signed.
* doc/posix-headers/sys_types.texi: Mention that these types are
unsigned on this platform.

5 months agosys_stat-h tests: Fix a static_assert failure on glibc/hppa.
Collin Funk [Mon, 1 Sep 2025 21:00:00 +0000 (14:00 -0700)] 
sys_stat-h tests: Fix a static_assert failure on glibc/hppa.

Reported by Santiago Vila <sanvila@debian.org> in:
<https://lists.gnu.org/archive/html/bug-m4/2025-09/msg00000.html>.

* tests/test-sys_stat-h.c [__GLIBC__ && __hppa]: Don't check that
blksize_t and blkcnt_t are signed.
* doc/posix-headers/sys_stat.texi: Mention that these types are
unsigned on this platform.

5 months agotests: adapt AT_FDCWD fix for more tests
Paul Eggert [Mon, 1 Sep 2025 20:04:21 +0000 (13:04 -0700)] 
tests: adapt AT_FDCWD fix for more tests

* tests/test-areadlinkat-with-size.c (main):
* tests/test-areadlinkat.c (main):
* tests/test-faccessat.c (main):
* tests/test-fchmodat.c (main):
* tests/test-fchownat.c (main):
* tests/test-fstatat.c (main):
* tests/test-linkat.c (main):
* tests/test-mkdirat.c (main):
* tests/test-mkfifoat.c (main):
* tests/test-openat-safer.c (main):
* tests/test-readlinkat.c (main):
* tests/test-renameat.c (main):
* tests/test-renameatu.c (main):
* tests/test-symlinkat.c (main):
* tests/test-unlinkat.c (main):
* tests/test-utimensat.c (main):
Work even if AT_FDCWD == -1.

5 months agoopenat2-tests: fix AT_FDCWD portability
Paul Eggert [Mon, 1 Sep 2025 18:25:00 +0000 (11:25 -0700)] 
openat2-tests: fix AT_FDCWD portability

* tests/test-openat.c (main): Work even if AT_FDCWD == -1.

5 months agou64: Allow the header to be included twice.
Collin Funk [Sun, 31 Aug 2025 21:54:56 +0000 (14:54 -0700)] 
u64: Allow the header to be included twice.

* lib/u64.h: Add include guard.

5 months agocrypto/sha3: New module.
Collin Funk [Sun, 31 Aug 2025 21:21:02 +0000 (14:21 -0700)] 
crypto/sha3: New module.

* modules/crypto/sha3: New file.
* lib/sha3-stream.c: New file, based on sha512-stream.c.
* lib/sha3.h (sha3_224_stream, sha3_256_stream, sha3_384_stream)
(sha3_512_stream): New declarations.

5 months agocrypto/sha3-buffer: Add tests.
Collin Funk [Sun, 31 Aug 2025 19:51:14 +0000 (12:51 -0700)] 
crypto/sha3-buffer: Add tests.

* modules/crypto/sha3-buffer-tests: New file.
* tests/test-sha3-224-buffer.c: Likewise.
* tests/test-sha3-256-buffer.c: Likewise.
* tests/test-sha3-384-buffer.c: Likewise.
* tests/test-sha3-512-buffer.c: Likewise.
* tests/bench-sha3-224.c: Likewise.
* tests/bench-sha3-256.c: Likewise.
* tests/bench-sha3-384.c: Likewise.
* tests/bench-sha3-512.c: Likewise.

5 months agocrypto/sha3-buffer: New module.
Collin Funk [Sun, 31 Aug 2025 18:43:37 +0000 (11:43 -0700)] 
crypto/sha3-buffer: New module.

* lib/u64.h (u64getlo, u64not): New functions.
* lib/sha3.c: New file, based on lib/sha512.c.
* lib/sha3.h: New file, based on lib/sha512.h.
* modules/crypto/sha3-buffer: New file.

5 months agou64: avoid theoretical problem with >64-bit int
Paul Eggert [Sun, 31 Aug 2025 14:54:18 +0000 (07:54 -0700)] 
u64: avoid theoretical problem with >64-bit int

* lib/u64.h: Include limits.h, for INT_MAX.  Use uint64_t only if
INT_MAX < UINT64_MAX, to avoid undefined behavior on theoretical
platforms where adding two uint64_t expressions can have undefined
behavior on signed integer overflow.

5 months agoautoupdate
Karl Berry [Wed, 27 Aug 2025 16:03:27 +0000 (09:03 -0700)] 
autoupdate

5 months agonstrftime tests: Test in the UTF-8 environment on native Windows.
Bruno Haible [Mon, 25 Aug 2025 22:02:22 +0000 (00:02 +0200)] 
nstrftime tests: Test in the UTF-8 environment on native Windows.

Prompted by <https://debbugs.gnu.org/79296>.

* tests/test-nstrftime-w32utf8.sh: New file.
* tests/test-nstrftime-w32utf8.c: New file.
* modules/nstrftime-tests (Files): Add them. Add windows-utf8.rc,
windows-utf8.manifest, m4/windows-rc.m4.
(configure.ac): Invoke gl_WINDOWS_RC.
(Makeile.am): Arrange to build test-nstrftime-w32utf8 and
run test-nstrftime-w32utf8.sh.

5 months agogen-uni-tables: Update a comment.
Bruno Haible [Sat, 23 Aug 2025 14:04:14 +0000 (16:04 +0200)] 
gen-uni-tables: Update a comment.

* lib/gen-uni-tables.c: Update comment regarding glibc.

5 months agombfile: Make mb_setascii an inline function.
Collin Funk [Sat, 23 Aug 2025 03:18:13 +0000 (20:18 -0700)] 
mbfile: Make mb_setascii an inline function.

* lib/mbchar.h (mb_setascii): Define as an extern inline function
instead of a macro.

5 months agodoc: Update for glibc 2.42.
Bruno Haible [Tue, 19 Aug 2025 18:05:47 +0000 (20:05 +0200)] 
doc: Update for glibc 2.42.

* doc/glibc-functions/uabs.texi: New file.
* doc/glibc-functions/ulabs.texi: New file.
* doc/glibc-functions/ullabs.texi: New file.
* doc/glibc-functions/uimaxabs.texi: New file.
* doc/gnulib.texi (Glibc inttypes.h): New section.
(Glibc stdlib.h): Include three of these files.

5 months agodoc: Update for glibc 2.42.
Bruno Haible [Tue, 19 Aug 2025 17:29:03 +0000 (19:29 +0200)] 
doc: Update for glibc 2.42.

* doc/glibc-functions/pthread_gettid_np.texi: New file.
* doc/gnulib.texi (Glibc pthread.h): Include it.
* doc/posix-headers/*.texi: Update.
* doc/posix-functions/*.texi: Likewise.

5 months agodoc: Update for glibc 2.41.
Bruno Haible [Tue, 19 Aug 2025 07:23:26 +0000 (09:23 +0200)] 
doc: Update for glibc 2.41.

* doc/glibc-functions/sched_getattr.texi: New file.
* doc/glibc-functions/sched_setattr.texi: New file.
* doc/gnulib.texi (Glibc sched.h): Include them.
* doc/posix-functions/initstate.texi: Update.
* doc/glibc-functions/initstate_r.texi: Likewise.
* doc/posix-functions/compoundn*.texi: Likewise.

5 months agonproc: honor cgroupv2 CPU quotas
Pádraig Brady [Mon, 18 Aug 2025 14:34:59 +0000 (15:34 +0100)] 
nproc: honor cgroupv2 CPU quotas

cgroupv1 CPU quotas are not considered,
as those are now legacy (RHEL7 era),
and are more complex/inefficient to parse.

Tested in coreutils on Fedora 42
as detailed in tests/test-nproc.c

* lib/nproc.c (cgroup2_mount): Identify the cgroup2 mount point,
first at the common location for efficiency,
resorting to searching mount points otherwise.
(get_cgroup2_cpu_quota): Walk cgroup2 quotas for the current process,
returning the lowest integer number of CPUs configured.
(cpu_quota): On Linux return the cgroupv2 CPU quota if the
currrent scheduler honors it.  Otherwise return ULONG_MAX.
(num_processors): Clamp the return to <= quota.
* m4/nproc.m4: Add a check for mntent.h.
* tests/test-nproc.c: Document how cgroup CPU quotas were tested.

5 months agodoc: Mention some musl libc stubs.
Bruno Haible [Tue, 19 Aug 2025 06:49:22 +0000 (08:49 +0200)] 
doc: Mention some musl libc stubs.

* doc/posix-functions/sched_getparam.texi: Mention musl libc stub.
* doc/posix-functions/sched_setparam.texi: Likewise.
* doc/posix-functions/sched_getscheduler.texi: Likewise.
* doc/posix-functions/sched_setscheduler.texi: Likewise.
* doc/posix-functions/posix_spawnattr_getschedparam.texi: Likewise.
* doc/posix-functions/posix_spawnattr_setschedparam.texi: Likewise.
* doc/posix-functions/posix_spawnattr_getschedpolicy.texi: Likewise.
* doc/posix-functions/posix_spawnattr_setschedpolicy.texi: Likewise.

5 months agosys_stat: Fix namespace pollution on native Windows.
Bruno Haible [Mon, 18 Aug 2025 13:44:48 +0000 (15:44 +0200)] 
sys_stat: Fix namespace pollution on native Windows.

* lib/issymlink.h: New file, extracted from lib/sys_stat.in.h.
* lib/issymlink.c: Include issymlink.h instead of <sys/stat.h>.
* lib/issymlinkat.c: Likewise.
* modules/issymlink (Files): Add lib/issymlink.h.
(Depends-on): Add extern-inline.
(configure.ac): Use gl_MODULE_INDICATOR.
(Include): Set to "issymlink.h".
* modules/issymlinkat (Files): Add lib/issymlink.h.
(Depends-on): Add extern-inline.
(configure.ac): Use gl_MODULE_INDICATOR.
(Include): Set to "issymlink.h".
* lib/sys_stat.in.h: Don't include <errno.h>, <unistd.h>.
(_GL_ISSYMLINK_INLINE, _GL_ISSYMLINKAT_INLINE): Remove macros.
(issymlink, issymlinkat): Remove functions.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_REQUIRE_DEFAULTS): Don't initialize
GNULIB_ISSYMLINK, GNULIB_ISSYMLINKAT.
* modules/sys_stat-h (Depends-on): Remove extern-inline.
(Makefile.am): Don't substitute GNULIB_ISSYMLINK, GNULIB_ISSYMLINKAT.
* lib/chown.c: Include issymlink.h.
* lib/lchown.c: Likewise.
* lib/lchmod.c: Likewise.
* lib/fchmodat.c: Likewise.
* lib/rename.c: Likewise.
* lib/renameatu.c: Likewise.
* lib/unlink.c: Likewise.
* lib/unlinkat.c: Likewise.
* lib/utimens.c: Likewise.

5 months agoReduce risk of compilation errors within include files.
Bruno Haible [Fri, 15 Aug 2025 12:42:07 +0000 (14:42 +0200)] 
Reduce risk of compilation errors within include files.

* lib/dirent.in.h: Move include <sys/stat.h> near the end of the file.
* lib/stdlib.in.h: Move include <sys/wait.h> near the end of the file.
* lib/sys_select.in.h: Move include <string.h> near the end of the file.
* lib/unistd.in.h: Add comment.

5 months agoutimens: Use issymlink.
Bruno Haible [Thu, 14 Aug 2025 20:34:17 +0000 (22:34 +0200)] 
utimens: Use issymlink.

* lib/utimens.c (lutimens): Use issymlink instead of readlink.
* modules/utimens (Depends-on): Remove readlink. Add issymlink.

5 months agounlinkat: Use issymlinkat.
Bruno Haible [Thu, 14 Aug 2025 20:31:48 +0000 (22:31 +0200)] 
unlinkat: Use issymlinkat.

* lib/unlinkat.c (rpl_unlinkat): Use issymlinkat instead of readlinkat.
* modules/unlinkat (Depends-on): Remove readlinkat. Add issymlinkat.

5 months agounlink: Use issymlink.
Bruno Haible [Thu, 14 Aug 2025 20:30:18 +0000 (22:30 +0200)] 
unlink: Use issymlink.

* lib/unlink.c (rpl_unlink): Use issymlink instead of readlink.
* modules/unlink (Depends-on): Remove readlink. Add issymlink.

5 months agorenameatu: Use issymlinkat.
Bruno Haible [Thu, 14 Aug 2025 20:23:29 +0000 (22:23 +0200)] 
renameatu: Use issymlinkat.

* lib/renameatu.c (renameatu): Use issymlinkat instead of readlinkat.
* modules/renameatu (Depends-on): Remove readlinkat. Add issymlinkat.

5 months agorename: Use issymlink.
Bruno Haible [Thu, 14 Aug 2025 20:21:23 +0000 (22:21 +0200)] 
rename: Use issymlink.

* lib/rename.c (rpl_rename): Use issymlink instead of readlink.
* modules/rename (Depends-on): Remove readlink. Add issymlink.

5 months agofchmodat: Use issymlinkat.
Bruno Haible [Thu, 14 Aug 2025 20:18:57 +0000 (22:18 +0200)] 
fchmodat: Use issymlinkat.

* lib/fchmodat.c (fchmodat): Use issymlinkat instead of readlinkat.
* modules/fchmodat (Depends-on): Add issymlinkat, openat.

5 months agolchmod: Use issymlink, issymlinkat.
Bruno Haible [Thu, 14 Aug 2025 20:16:23 +0000 (22:16 +0200)] 
lchmod: Use issymlink, issymlinkat.

* lib/lchmod.c (lchmod): Use issymlink instead of readlink and
issymlinkat instead of readlinkat.
* modules/lchmod (Depends-on): Remove readlink. Add issymlink,
issymlinkat.

5 months agochown: Avoid a redundant stat() call.
Bruno Haible [Thu, 14 Aug 2025 20:05:37 +0000 (22:05 +0200)] 
chown: Avoid a redundant stat() call.

* lib/chown.c (rpl_chown): Set stat_valid after stat() succeeded.

5 months agolchown: Use issymlink.
Bruno Haible [Thu, 14 Aug 2025 19:59:20 +0000 (21:59 +0200)] 
lchown: Use issymlink.

* lib/lchown.c (lchown): Use issymlink instead of readlink.
* modules/lchown (Depends-on): Remove readlink. Add issymlink.

5 months agochown: Use issymlink.
Bruno Haible [Thu, 14 Aug 2025 19:54:44 +0000 (21:54 +0200)] 
chown: Use issymlink.

* lib/chown.c (rpl_chown): Use issymlink instead of readlink.
* modules/chown (Depends-on): Add issymlink.

5 months agoissymlink, issymlinkat: New modules.
Bruno Haible [Thu, 14 Aug 2025 16:36:00 +0000 (18:36 +0200)] 
issymlink, issymlinkat: New modules.

* lib/sys_stat.in.h: Invoke _GL_INLINE_HEADER_BEGIN,
_GL_INLINE_HEADER_END. Include <errno.h>, <unistd.h>.
(_GL_ISSYMLINK_INLINE, _GL_ISSYMLINKAT_INLINE): New macros.
(issymlink, issymlinkat): New declarations.
* lib/unistd.in.h: Do the #include <fcntl.h>, when needed for O_CLOEXEC,
at the end of the file. So that when <fcntl.h> includes <sys/stat.h>,
the declarations of readlink() and readlinkat() on native Windows are
already present.
* lib/issymlink.c: New file.
* lib/issymlinkat.c: New file.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_REQUIRE_DEFAULTS): Initialize
GNULIB_ISSYMLINK, GNULIB_ISSYMLINKAT.
* modules/sys_stat-h (Depends-on): Add extern-inline.
(Makefile.am): Substitute GNULIB_ISSYMLINK, GNULIB_ISSYMLINKAT.
* modules/issymlink: New file.
* modules/issymlinkat: New file.

5 months agoFix typo in previous change
Paul Eggert [Tue, 12 Aug 2025 16:25:15 +0000 (09:25 -0700)] 
Fix typo in previous change

5 months agounlinkat: fix another GNU/Hurd typo
Paul Eggert [Tue, 12 Aug 2025 15:17:55 +0000 (08:17 -0700)] 
unlinkat: fix another GNU/Hurd typo

Problem reported by Bruno Haible.
* lib/unlinkat.c (rpl_unlinkat): Fix negation.

5 months agounlinkat: fix GNU/Hurd typo
Paul Eggert [Tue, 12 Aug 2025 05:01:14 +0000 (22:01 -0700)] 
unlinkat: fix GNU/Hurd typo

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2025-08/msg00041.html
* lib/unlinkat.c (rpl_unlinkat): Declare missing local.

5 months agomanywarnings: update C warnings for GCC 15.2
Paul Eggert [Tue, 12 Aug 2025 03:11:51 +0000 (20:11 -0700)] 
manywarnings: update C warnings for GCC 15.2

This is merely changes to commentary; no changes to
the flags passed to GCC.
* build-aux/gcc-warning.spec: Add warnings introduced in GCC 15.2.

5 months agoPrefer readlink to lstat+S_ISLNK when easy
Paul Eggert [Tue, 12 Aug 2025 00:22:03 +0000 (17:22 -0700)] 
Prefer readlink to lstat+S_ISLNK when easy

To test for a symlink, use readlink, not lstat+S_ISLNK,
when the lstat is used only for the symlink test.
This avoids EOVERFLOW issues.
* lib/lchown.c (rpl_lchown) [CHOWN_CHANGE_TIME_BUG]:
* lib/rename.c (rpl_rename):
[!(_WIN32 && !__CYGWIN__) && (RENAME_TRAILING_SLASH_SOURCE_BUG
|| RENAME_DEST_EXISTS_BUG || RENAME_HARD_LINK_BUG)]:
* lib/renameatu.c (renameatu):
[HAVE_RENAMEAT && RENAME_TRAILING_SLASH_SOURCE_BUG]:
* lib/unlink.c (rpl_unlink):
* lib/unlinkat.c (rpl_unlinkat):
* lib/utimens.c (lutimens) [!HAVE_LUTIMENS]:
Prefer readlink to lstat+S_ISLNK.
* modules/lchown, modules/rename, modules/unlink, modules/utimens:
(Depends-on): Add readlink.
* modules/unlinkat (Depends-on): Add fstatat, readlinkat.

5 months agonlcanon tests: Fix test failure on Solaris.
Bruno Haible [Mon, 11 Aug 2025 10:04:17 +0000 (12:04 +0200)] 
nlcanon tests: Fix test failure on Solaris.

* tests/test-nlcanon.sh: Handle the --no-reexec option (from init.sh).

5 months agonlcanon: Make it work on OpenBSD.
Bruno Haible [Mon, 11 Aug 2025 09:51:43 +0000 (11:51 +0200)] 
nlcanon: Make it work on OpenBSD.

* build-aux/nlcanon.sh.in (sed_convert_crlf): New variable. Use it
instead of a sed script that contains '\r'.

5 months agoUse standard way of including <config.h>.
Bruno Haible [Sun, 10 Aug 2025 14:35:41 +0000 (16:35 +0200)] 
Use standard way of including <config.h>.

* lib/string-desc.c: Use normalized boilerplate.
* lib/string-desc-contains.c: Likewise.
* lib/str_startswith.c: Likewise.
* lib/str_endswith.c: Likewise.
* lib/mbs_endswith.c: Likewise.

5 months agotest-framework-sh: Ensure TESTS_ENVIRONMENT gets augmented in gltests/.
Bruno Haible [Sun, 10 Aug 2025 11:40:48 +0000 (13:40 +0200)] 
test-framework-sh: Ensure TESTS_ENVIRONMENT gets augmented in gltests/.

* modules/test-framework-sh (Applicability): New section.

6 months agognulib-tool: Fix invalid generated Makefile.am (regression 2025-08-04).
Bruno Haible [Sat, 9 Aug 2025 06:17:09 +0000 (08:17 +0200)] 
gnulib-tool: Fix invalid generated Makefile.am (regression 2025-08-04).

* gnulib-tool.sh (func_emit_lib_Makefile_am): Emit line that initializes
TESTS_ENVIRONMENT.
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Likewise.

6 months agogit-merge-changelog: Remove module.
Bruno Haible [Tue, 5 Aug 2025 21:16:15 +0000 (23:16 +0200)] 
git-merge-changelog: Remove module.

It is now available through
$ git clone https://git.savannah.gnu.org/git/vc-changelog.git
see https://gitweb.git.savannah.gnu.org/gitweb/?p=vc-changelog.git .

* lib/git-merge-changelog.c: Remove file.
* modules/git-merge-changelog: Remove file.
* NEWS: Mention the change.

6 months agonlcanon tests: Fix last commit.
Bruno Haible [Mon, 4 Aug 2025 23:20:58 +0000 (01:20 +0200)] 
nlcanon tests: Fix last commit.

* tests/init.sh (setup_): Revert last change.
* modules/test-framework-sh (Makefile.am): Augment TESTS_ENVIRONMENT
here.
* modules/nlcanon-tests (Makefile.am): Don't augment TESTS_ENVIRONMENT
here.