Collin Funk [Tue, 18 Mar 2025 04:16:22 +0000 (21:16 -0700)]
utimensat: Work around a GNU/Hurd bug.
* lib/utimensat.c (rpl_utimensat) [__gnu_hurd__]: Check for out of range
tv_nsec values.
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Likewise. Guess that utimensat
doesn't work on GNU/Hurd.
* doc/posix-functions/utimensat.texi: Mention the bug.
Collin Funk [Thu, 13 Mar 2025 01:55:26 +0000 (18:55 -0700)]
dup3: Fix behavior for equal file descriptors on Haiku.
* lib/dup3.c (dup3) [__HAIKU__]: Set errno to EINVAL and return -1 if
both file descriptors are equal.
* doc/posix-functions/dup3.texi: Document the Haiku bug.
Bruno Haible [Sun, 9 Mar 2025 09:19:20 +0000 (10:19 +0100)]
getlogin_r: Work around musl bug.
* lib/getlogin_r.c (getlogin_r): Add implementation for Linux.
* m4/getlogin_r.m4 (gl_FUNC_GETLOGIN_R): Test whether getlogin_r has the
musl bug.
* tests/test-getlogin_r.c (main): Add another test.
* doc/posix-functions/getlogin_r.texi: Mention the workaround.
Bruno Haible [Sat, 1 Mar 2025 14:59:29 +0000 (15:59 +0100)]
package-version: Improve wording in './configure --help'.
Reported by Benno Schulenberg <bensberg@telfort.nl> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-03/msg00000.html>.
* doc/package-version.texi: Recommend a dummy version number named
'package', not 'dummy'.
* m4/init-package-version.m4: Update comments accordingly.
* build-aux/git-version-gen: Likewise.
Bruno Haible [Sat, 22 Feb 2025 17:35:37 +0000 (18:35 +0100)]
getlocalename_l-unsafe-limited: New module.
* modules/getlocalename_l-unsafe-limited: New file.
* modules/getlocalename_l-unsafe (Depends-on): Add
getlocalename_l-unsafe-limited.
(Makefile.am): Don't compile getlocalename_l-unsafe.c if already
compiled as part of module 'getlocalename_l-unsafe-limited'.
Bruno Haible [Sat, 22 Feb 2025 17:11:38 +0000 (18:11 +0100)]
getlocalename_l-unsafe: New module.
* lib/getlocalename_l-unsafe.h: New file, based on
lib/getlocalename_l.c.
* lib/getlocalename_l-unsafe.c: New file.
* lib/getlocalename_l.c: Most code moved to
lib/getlocalename_l-unsafe.c.
(getlocalename_l): Implement based on getlocalename_l_unsafe.
* m4/getlocalename_l.m4 (gl_FUNC_GETLOCALENAME_L_UNSAFE,
gl_PREREQ_GETLOCALENAME_L_UNSAFE): New macros.
(gl_FUNC_GETLOCALENAME_L_SIMPLE): Require
gl_FUNC_GETLOCALENAME_L_UNSAFE.
(gl_PREREQ_GETLOCALENAME_L_SIMPLE): Now empty.
* modules/getlocalename_l-unsafe: New file.
* modules/getlocalename_l-simple (Files): Remove
lib/localename-table.h, lib/localename-table.c,
m4/intl-thread-locale.m4.
(Depends-on): Add getlocalename_l-unsafe. Remove setlocale-messages,
setlocale-null, free-posix.
(Makefile.am): Don't compile localename-table.c.
Bruno Haible [Fri, 21 Feb 2025 10:38:35 +0000 (11:38 +0100)]
host-cpu-c-abi: Improve support for loongarch32.
Reported by <wuruilong@loongson.cn>
in <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1098478>
via Simon Josefsson.
* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Prepare template for
__loongarch32__ in config.h.
(gl_HOST_CPU_C_ABI_32BIT): Speed up the configure test on loongarch*.
Bruno Haible [Fri, 21 Feb 2025 10:25:51 +0000 (11:25 +0100)]
getlocalename_l-simple: New module.
* lib/locale.in.h (newlocale, duplocale, freelocale): Now enabled by
module 'getlocalename_l-simple'.
(getlocalename_l): New declaration.
* lib/getlocalename_l.c: New file, based on lib/localename-unsafe.c,
with modifications for glibc systems, NetBSD, OpenBSD, Android.
* lib/localename-table.h (LCMIN): New macro.
* lib/struniq.h: Update a comment.
* lib/localename-unsafe.c: Don't define the
LOCALENAME_ENHANCE_LOCALE_FUNCS overrides here. Moved to
lib/getlocalename_l.c.
(gl_locale_name_thread_unsafe): Invoke getlocalename_l. Previous code
moved to lib/getlocalename_l.c.
* m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): Improve support
for OpenBSD: Set gt_nameless_locales to yes and
gt_localename_enhances_locale_funcs to yes also when $gt_fake_locales is
yes.
* m4/getlocalename_l.m4: New file, based on m4/localename.m4.
* m4/localename.m4 (gl_LOCALENAME_UNSAFE, gl_LOCALENAME_UNSAFE_LIMITED):
Remove code that was moved to m4/getlocalename_l.m4.
* m4/locale_h.m4 (gl_LOCALE_H): Test whether getlocalename_l is
declared.
(gl_LOCALE_H_REQUIRE_DEFAULTS): Initialize GNULIB_GETLOCALENAME_L.
(gl_LOCALE_H_DEFAULTS): Initialize HAVE_GETLOCALENAME_L.
* modules/locale-h (Makefile.am): Substitute GNULIB_GETLOCALENAME_L,
HAVE_GETLOCALENAME_L.
* modules/getlocalename_l-simple: New file.
* modules/localename-unsafe (Files): Remove lib/localename-table.h,
lib/localename-table.c, lib/struniq.h.
(Depends-on): Add getlocalename_l-simple. Remove bool, flexmember,
free-posix, langinfo-h, thread-optim.
(Makefile.am): Don't compile localename-table.c.
* modules/localename-unsafe-limited (Depends-on): Add
getlocalename_l-simple.
* modules/newlocale (Link): New section.
* modules/duplocale (Link): Link with $(GETLOCALENAME_L_LIB).
* modules/freelocale (Link): New section.
* modules/newlocale-tests (Makefile.am): Link the test program with
$(GETLOCALENAME_L_LIB).
* modules/duplocale-tests (Makefile.am): Likewise.
* modules/freelocale-tests (Makefile.am): Likewise.
* modules/is*_l-tests (Makefile.am): Likewise.
* modules/tolower_l-tests (Makefile.am): Likewise.
* modules/toupper_l-tests (Makefile.am): Likewise.
* modules/strcasecmp_l-tests (Makefile.am): Likewise.
* modules/strncasecmp_l-tests (Makefile.am): Likewise.
* modules/strerror_l-tests (Makefile.am): Likewise.
* doc/posix-functions/getlocalename_l.texi: Mention the new module.
Bruno Haible [Fri, 21 Feb 2025 08:31:12 +0000 (09:31 +0100)]
setlocale-messages: New module.
* lib/setlocale-messages.h: New file.
* lib/setlocale-messages.c: New file, based on lib/setlocale.c.
* modules/setlocale-messages: New file.
* lib/setlocale.c: Include setlocale-messages.h.
(lc_messages_name): Remove variable.
(setlocale_single): Just invoke setlocale_messages.
* modules/setlocale (Depends-on): Add setlocale-messages.
Bruno Haible [Wed, 19 Feb 2025 22:46:37 +0000 (23:46 +0100)]
readutmp: Let callers distinguish LOGINs from USERs.
Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-02/msg00123.html>.
* lib/readutmp.h (LOGIN_PROCESS, UT_TYPE_LOGIN_PROCESS): New macros.
* lib/readutmp.c (read_utmp_from_systemd): Possibly use LOGIN_PROCESS
instead of USER_PROCESS, depending on the session's class.
Bruno Haible [Tue, 18 Feb 2025 11:03:37 +0000 (12:03 +0100)]
at-init: Add tests.
* tests/test-at-init.sh: New file.
* tests/test-at-init.c: New file.
* tests/test-at-init-2.c: New file.
* tests/test-at-init-3.c: New file.
* modules/at-init-tests: New file.
Collin Funk [Sun, 16 Feb 2025 21:58:35 +0000 (13:58 -0800)]
doc: Adjust platforms that define O_CLOEXEC in unistd.h.
Suggested by Bruno Haible.
* posix-headers/unistd.texi: Mention that macOS 12 and AIX 7.3 do not
define O_CLOEXEC in this header. Remove redundant MSVC.
Bruno Haible [Sun, 16 Feb 2025 21:32:33 +0000 (22:32 +0100)]
strncasecmp_l: New module.
* lib/strings.in.h (strncasecmp_l): New declaration.
* lib/strncasecmp_l.c: New file, based on lib/strncasecmp.c.
* m4/strncasecmp_l.m4: New file.
* m4/strings_h.m4 (gl_STRINGS_H): Test for strncasecmp_l.
(gl_STRINGS_H_REQUIRE_DEFAULTS): Initialize GNULIB_STRNCASECMP_L.
(gl_STRINGS_H_DEFAULTS): Initialize HAVE_STRNCASECMP_L,
REPLACE_STRNCASECMP_L.
* modules/strings-h (Makefile.am): Substitute GNULIB_STRNCASECMP_L,
HAVE_STRNCASECMP_L, REPLACE_STRNCASECMP_L.
* modules/strncasecmp_l: New file.
* tests/test-strings-h-c++.cc: Check declaration of strncasecmp_l.
* doc/posix-functions/strncasecmp_l.texi: Mention the new module and the
macOS, Solaris, Cygwin bugs.
Bruno Haible [Sun, 16 Feb 2025 21:32:02 +0000 (22:32 +0100)]
strcasecmp_l: New module.
* lib/strings.in.h: Include <locale.h>.
(strcasecmp_l): New declaration.
* lib/strcasecmp_l.c: New file, based on lib/strcasecmp.c.
* m4/strcasecmp_l.m4: New file.
* m4/strings_h.m4 (gl_STRINGS_H): Test for strcasecmp_l.
(gl_STRINGS_H_REQUIRE_DEFAULTS): Initialize GNULIB_STRCASECMP_L.
(gl_STRINGS_H_DEFAULTS): Initialize HAVE_STRCASECMP_L,
REPLACE_STRCASECMP_L.
* modules/strings-h (Makefile.am): Substitute GNULIB_STRCASECMP_L,
HAVE_STRCASECMP_L, REPLACE_STRCASECMP_L.
* modules/strcasecmp_l: New file.
* tests/test-strings-h-c++.cc: Check declaration of strcasecmp_l.
* doc/posix-functions/strcasecmp_l.texi: Mention the new module and the
macOS, Solaris, Cygwin bugs.
Collin Funk [Sun, 16 Feb 2025 20:23:57 +0000 (12:23 -0800)]
unistd-h: Make sure O_CLOEXEC is defined.
* modules/unistd-h (Depends-on): Add fcntl-h.
* lib/unistd.in.h: Include fcntl.h if inclusion of unistd.h does not
define O_CLOEXEC.
* doc/posix-headers/unistd.texi: Document the platforms that do not
define O_CLOEXEC in unistd.h.
Bruno Haible [Sun, 16 Feb 2025 17:24:16 +0000 (18:24 +0100)]
strncasecmp: Add tests.
* tests/test-strncasecmp-1.sh: New file.
* tests/test-strncasecmp-2.sh: New file.
* tests/test-strncasecmp.c: New file.
* modules/strncasecmp-tests: New file.
Bruno Haible [Sun, 16 Feb 2025 17:02:00 +0000 (18:02 +0100)]
strcasecmp: Add tests.
* tests/test-strcasecmp-1.sh: New file.
* tests/test-strcasecmp-2.sh: New file.
* tests/test-strcasecmp.c: New file.
* modules/strcasecmp-tests: New file.
Bruno Haible [Sun, 16 Feb 2025 12:43:40 +0000 (13:43 +0100)]
bootstrap: Fix recognition of --depth option with recent git releases.
Reported by Benno Schulenberg <bensberg@telfort.nl> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-02/msg00106.html>.
* top/bootstrap-funclib.sh (prepare_GNULIB_SRCDIR): Assume that
'git clone' and 'git fetch' support the --depth option.
* build-aux/bootstrap: Regenerated.