]> Savannah Git Hosting - gnulib.git/log
gnulib.git
4 weeks agodcomp-script: New module.
Bruno Haible [Tue, 1 Apr 2025 00:00:48 +0000 (02:00 +0200)]
dcomp-script: New module.

* m4/dcomp.m4: New file.
* build-aux/dcomp.sh.in: New file.
* modules/dcomp-script: New file.

4 weeks agoacl, file-has-acl tests: Strengthen tests on Cygwin.
Bruno Haible [Mon, 31 Mar 2025 09:30:12 +0000 (11:30 +0200)]
acl, file-has-acl tests: Strengthen tests on Cygwin.

Suggested by Corinna Vinschen in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00126.html>.

* tests/test-set-mode-acl.sh: On Cygwin, use group 1 instead of the
non-existent group 0.
* tests/test-copy-acl.sh: Likewise.
* tests/test-file-has-acl.sh: Likewise.

5 weeks agofile-has-acl: Update comments regarding Cygwin.
Bruno Haible [Sun, 30 Mar 2025 14:34:40 +0000 (16:34 +0200)]
file-has-acl: Update comments regarding Cygwin.

* lib/acl-internal.h (HAVE_ACL_EXTENDED_FILE, acl_extended_file): Add
more comments.

5 weeks agoacl-permissions: Update comments regarding NetBSD.
Bruno Haible [Sat, 29 Mar 2025 11:46:14 +0000 (12:46 +0100)]
acl-permissions: Update comments regarding NetBSD.

* lib/acl-internal.c: Update comments.
* lib/acl_entries.c: Likewise.
* tests/test-file-has-acl.sh: Likewise.
* tests/test-copy-acl.sh: Likewise.

5 weeks agodoc: Document NetBSD acl functions.
Collin Funk [Fri, 28 Mar 2025 21:58:31 +0000 (14:58 -0700)]
doc: Document NetBSD acl functions.

* doc/acl-resources.txt: Document that NetBSD supports all ACL functions
that FreeBSD supports.

5 weeks agobootstrap: Improve "make dist" tarball reproducability.
Simon Josefsson [Thu, 27 Mar 2025 19:01:28 +0000 (20:01 +0100)]
bootstrap: Improve "make dist" tarball reproducability.

* top/bootstrap-funclib.sh (autogen): Don't pass unnecessary -I's when
invoking autoreconf.  The order of M4 include directories is reflected
in Makefile.in content.  Our GNUmakefile _version rule invoke
autoreconf without any extra -I, and this difference in how autoreconf
is invoked results in different tarballs for "make dist" vs "make
release" which is undesirable.

5 weeks agomaintainer-makefile: Check spelling using 'codespell'.
Simon Josefsson [Thu, 27 Mar 2025 18:45:30 +0000 (19:45 +0100)]
maintainer-makefile: Check spelling using 'codespell'.

* top/maint.mk (sc_codespell): Add.

5 weeks agoautoupdate
Karl Berry [Wed, 26 Mar 2025 16:22:06 +0000 (09:22 -0700)]
autoupdate

5 weeks agosame-inode: don't assume memory objects have ino
Paul Eggert [Tue, 25 Mar 2025 00:00:20 +0000 (17:00 -0700)]
same-inode: don't assume memory objects have ino

* lib/same-inode.h (psame_inode): Do not assume shared and/or
typed memory objects have reliable st_dev and st_ino when given to
stat-like functions, as POSIX does not guarantee this.
I don’t know of any such platforms (QNX perhaps?) but it’s
easy to be safe.

5 weeks agosame-inode: update now-wrong dependency
Paul Eggert [Tue, 25 Mar 2025 00:00:20 +0000 (17:00 -0700)]
same-inode: update now-wrong dependency

* modules/same-inode (Depends-on): Depend on sys_stat-h,
not sys_types.h.

5 weeks agolibtextstyle-optional: pacify gcc -Wunused-parameter
Paul Eggert [Tue, 25 Mar 2025 00:00:19 +0000 (17:00 -0700)]
libtextstyle-optional: pacify gcc -Wunused-parameter

* lib/textstyle.in.h (html_ostream_create): Mark arg as unused.

5 weeks agogetlocalename_l-unsafe: Work around Cygwin 3.6.0 bug.
Bruno Haible [Mon, 24 Mar 2025 13:52:12 +0000 (14:52 +0100)]
getlocalename_l-unsafe: Work around Cygwin 3.6.0 bug.

* m4/locale_h.m4 (gl_LOCALE_H_DEFAULTS): Initialize
REPLACE_GETLOCALENAME_L.
* m4/getlocalename_l.m4 (gl_FUNC_GETLOCALENAME_L_UNSAFE): Test whether
getlocalename_l works. Set REPLACE_GETLOCALENAME_L.
* modules/locale-h (Makefile.am): Substitute REPLACE_GETLOCALENAME_L.
* lib/locale.in.h (getlocalename_l): Consider REPLACE_GETLOCALENAME_L.
* modules/getlocalename_l-simple (Depends-on, configure.ac): Likewise.
* doc/posix-functions/getlocalename_l.texi: Mention two Cygwin bugs.

5 weeks agomountlist: Fix a compilation error on Solaris with gcc 14.
Bruno Haible [Mon, 24 Mar 2025 10:06:25 +0000 (11:06 +0100)]
mountlist: Fix a compilation error on Solaris with gcc 14.

* lib/mountlist.c (read_file_system_list): Cast the argument of
MNT_IGNORE.

5 weeks agogocomp-script: Improve comments.
Bruno Haible [Mon, 24 Mar 2025 09:28:30 +0000 (10:28 +0100)]
gocomp-script: Improve comments.

Reported by Collin Funk in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00094.html>.

* build-aux/gocomp.sh.in: Mention limitation in comments.

5 weeks agomountlist tests: Fix link error. (regr. 2025-03-18).
Collin Funk [Mon, 24 Mar 2025 03:32:01 +0000 (20:32 -0700)]
mountlist tests: Fix link error. (regr. 2025-03-18).

* modules/mountlist-tests (Makefile.am): Link the test program with
LIBINTL.

5 weeks agoutimens: Fix missing declarations on NetBSD (regr. 2024-09-16).
Collin Funk [Sun, 23 Mar 2025 23:36:26 +0000 (16:36 -0700)]
utimens: Fix missing declarations on NetBSD (regr. 2024-09-16).

* lib/utimens.h [HAVE_UTIMENS || HAVE_LUTIMENS]: Include <sys/stat.h>
instead of <sys/time.h> for the declarations of these functions on
NetBSD.

6 weeks agonewlocale: Fix implicit function declarations.
Collin Funk [Sun, 23 Mar 2025 21:33:49 +0000 (14:33 -0700)]
newlocale: Fix implicit function declarations.

* lib/newlocale.c [HAVE_NEWLOCALE]: Include string.h for strlen and
strcmp, stdio.h for sprintf, and stdlib.h for free.

6 weeks agoautoupdate
Karl Berry [Sun, 23 Mar 2025 15:40:58 +0000 (08:40 -0700)]
autoupdate

6 weeks agogetlocalename_l-unsafe: Add Android workaround, like on OpenBSD.
Bruno Haible [Sat, 22 Mar 2025 12:06:36 +0000 (13:06 +0100)]
getlocalename_l-unsafe: Add Android workaround, like on OpenBSD.

* m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): Set
gt_cv_locale_fake to yes also on Android.

6 weeks agosetlocale-messages: Rename to setlocale-fixes and add Android support.
Bruno Haible [Sat, 22 Mar 2025 12:03:43 +0000 (13:03 +0100)]
setlocale-messages: Rename to setlocale-fixes and add Android support.

* lib/setlocale-fixes.h: Renamed from lib/setlocale-messages.h.
(setlocale_fixed, setlocale_fixed_null): New declarations.
* lib/setlocale-fixes.c: Renamed from lib/setlocale-messages.h.
(lc_cat_name): New variable.
(cat_to_index, index_to_cat): New macro.
(lc_all_name): New variable.
(cat_names): New constant.
(fill_lc_all_name, extract_single_name, setlocale_fixed,
setlocale_fixed_null): New functions.
* m4/setlocale.m4 (gl_FUNC_SETLOCALE): Set NEED_SETLOCALE_IMPROVED to 1
on Android.
* lib/setlocale.c: Include setlocale-fixes.h instead of
setlocale-messages.h.
(setlocale_unixlike) [__ANDROID__]: Use setlocale_fixed instead of
setlocale_mtsafe.
(setlocale_improved): On Android, use setlocale_fixed_null instead of
setlocale.
* lib/getlocalename_l-unsafe.c: Include setlocale-fixes.h instead of
setlocale-messages.h.
(getlocalename_l_unsafe): On Android, use setlocale_fixed_null instead
of setlocale_null.
* modules/setlocale-fixes: Renamed from modules/setlocale-messages.
(Files): Update.
(configure.ac): Compile the .c file also on Android.
(Include): Include setlocale-fixes.h instead of setlocale-messages.h.
* modules/setlocale (Depends-on): Add setlocale-fixes. Remove
setlocale-messages.
* modules/getlocalename_l-unsafe (Depends-on): Likewise.
* doc/posix-functions/setlocale.texi: Mention the Android problem.

6 weeks agogetloadavg: Improve Linux and Android support.
Bruno Haible [Fri, 21 Mar 2025 15:25:59 +0000 (16:25 +0100)]
getloadavg: Improve Linux and Android support.

* lib/getloadavg.c [__linux__, __ANDROID__]: Include <sys/param.h> and
<sys/sysinfo.h>.
(getloadavg) [__linux__, __ANDROID__]: Use sysinfo() instead of reading
/proc/loadavg.
(LINUX_LDAV_FILE): Remove macro.

6 weeks agoparse-duration: Work around an strtoul() misfeature.
Bruno Haible [Fri, 21 Mar 2025 12:15:55 +0000 (13:15 +0100)]
parse-duration: Work around an strtoul() misfeature.

* lib/parse-duration.c (str_const_to_ul): Reject a + or - sign between
the optional whitespace and the digits.
* tests/test-parse-duration.sh: Add some tests with expected failure.
* tests/test-parse-duration.c (main): Fix usage message.

6 weeks agomountlist: Add specification comment in .h file.
Bruno Haible [Fri, 21 Mar 2025 11:22:42 +0000 (12:22 +0100)]
mountlist: Add specification comment in .h file.

* lib/mountlist.h (read_file_system_list): Move specification to here...
* lib/mountlist.c (read_file_system_list): ...from here.

6 weeks agomountlist: Work around an strtoul() misfeature.
Bruno Haible [Fri, 21 Mar 2025 11:20:24 +0000 (12:20 +0100)]
mountlist: Work around an strtoul() misfeature.

* lib/mountlist.c: Include c-ctype.h.
(dev_from_mount_options): Ignore the dev=... option if its value starts
with whitespace or with a + or - sign.
* modules/mountlist (Depends-on): Add c-ctype.

6 weeks agomountlist: Replace a configure-time error with a compile-time error.
Bruno Haible [Fri, 21 Mar 2025 10:46:43 +0000 (11:46 +0100)]
mountlist: Replace a configure-time error with a compile-time error.

Reported by Yury V. Zaytsev <yury@shurup.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00080.html>.

* m4/mountlist.m4 (gl_MOUNTLIST): Instead of aborting the configuration,
define MOUNTED_NOT_PORTED.
* lib/mountlist.c (read_file_system_list): Err out if MOUNTED_NOT_PORTED
is defined.
* modules/mountlist (configure.ac, Makefile.am): Compile mountlist.c on
all platforms.

6 weeks agosetlocale-null: Fix autoconf warning.
Bruno Haible [Fri, 21 Mar 2025 06:17:53 +0000 (07:17 +0100)]
setlocale-null: Fix autoconf warning.

* m4/setlocale_null.m4 (gl_FUNC_SETLOCALE_NULL): Define through
AC_DEFUN_ONCE.

6 weeks agoFix compilation errors in C++ mode on Android.
Bruno Haible [Thu, 20 Mar 2025 16:35:38 +0000 (17:35 +0100)]
Fix compilation errors in C++ mode on Android.

* lib/string.in.h (memset_explicit, strerrorname_np): Disable
_GL_CXXALIASWARN invocation on non-glibc systems.
* lib/time.in.h (timespec_getres): Likewise.
* lib/unistd.in.h (copy_file_range): Likewise.

6 weeks agonproc: Optimize.
Bruno Haible [Thu, 20 Mar 2025 13:28:54 +0000 (14:28 +0100)]
nproc: Optimize.

* lib/nproc.c (num_processors): Optimize away the
num_processors_ignoring_omp (query) call when possible.

6 weeks agonproc, openmp-init: omit unnecessary strtol code
Paul Eggert [Wed, 19 Mar 2025 20:23:46 +0000 (13:23 -0700)]
nproc, openmp-init: omit unnecessary strtol code

* lib/nproc.c (parse_omp_threads):
* lib/omp-init.c (parse_omp_threads):
Remove unnecessary initialization and unnecessary check
whether endptr == NULL.
Reported by Alejandro Colomar in:
https://lore.kernel.org/liba2i/jx4664ishtl34eg2npdrv5fkfdiczqnlq3vjuacjrupjvh377x@gddcftzgwmfq/

6 weeks agogetlogin, getlogin_r: Fix typo in documentation.
Bruno Haible [Wed, 19 Mar 2025 14:35:13 +0000 (15:35 +0100)]
getlogin, getlogin_r: Fix typo in documentation.

Reported by Eric Blake in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00071.html>.

* doc/posix-functions/getlogin.texi: Fix typo.
* doc/posix-functions/getlogin_r.texi: Likewise.

6 weeks agoautoupdate
Karl Berry [Wed, 19 Mar 2025 13:48:03 +0000 (06:48 -0700)]
autoupdate

6 weeks agomountlist: Improve implementation on native Windows.
Bruno Haible [Wed, 19 Mar 2025 12:50:47 +0000 (13:50 +0100)]
mountlist: Improve implementation on native Windows.

* lib/mountlist.c (read_file_system_list) [_WIN32 && !__CYGWIN__]:
Also return the mount points inside the file systems.

6 weeks agomountlist: Improve implementation on native Windows.
Bruno Haible [Wed, 19 Mar 2025 11:10:05 +0000 (12:10 +0100)]
mountlist: Improve implementation on native Windows.

* lib/mountlist.c (read_file_system_list) [_WIN32 && !__CYGWIN__]:
Return the mntroot of drives mapped by SUBST or NET USE.

6 weeks agomountlist: Improve implementation on native Windows.
Bruno Haible [Wed, 19 Mar 2025 08:10:35 +0000 (09:10 +0100)]
mountlist: Improve implementation on native Windows.

* lib/mountlist.c (read_file_system_list) [_WIN32 && !__CYGWIN__]:
Filter out those volumes for which GetVolumeInformation fails.

6 weeks agofutimens: Work around a GNU/Hurd bug.
Collin Funk [Wed, 19 Mar 2025 04:50:00 +0000 (21:50 -0700)]
futimens: Work around a GNU/Hurd bug.

* m4/futimens.m4 (gl_FUNC_FUTIMENS): Check if futimens validates the
tv_nsec values of the timespec argument. Set bits in a return value
instead of exiting early.
* doc/posix-functions/futimens.texi (futimens): Mention the GNU/Hurd
bug. Mention the same bug occurs on NetBSD 10.

6 weeks agomountlist: Add tests.
Collin Funk [Wed, 19 Mar 2025 02:58:25 +0000 (19:58 -0700)]
mountlist: Add tests.

* modules/mountlist-tests: New file.
* tests/test-mountlist.c: New file.
* modules/mountlist (Usable-in-testdir): Remove section.
* gnulib-tool.sh (func_create_testdir): Allow mountlist to be used in
testdirs.

6 weeks agomountlist: Add support for native Windows.
Collin Funk [Wed, 19 Mar 2025 02:23:00 +0000 (19:23 -0700)]
mountlist: Add support for native Windows.

* lib/mountlist.c (read_file_system_list) [_WIN32 && !__CYGWIN__]:
Enumerate all drive prefixes.
* m4/mountlist.m4 (gl_MOUNTLIST): Don't abort on native Windows.

6 weeks agoPrefer the __gnu_hurd__ macro over __GNU__.
Collin Funk [Wed, 19 Mar 2025 01:37:48 +0000 (18:37 -0700)]
Prefer the __gnu_hurd__ macro over __GNU__.

* lib/get_ppid_of.c: Replace use of __GNU__ with __gnu_hurd__.
* lib/get_progname_of.c: Likewise.
* lib/sigsegv.c: Likewise.
* lib/sigsegv.in.h: Likewise.
* lib/vma-iter.c: Likewise.
* lib/vma-iter.h: Likewise.
* tests/test-ptsname.c: Likewise.
* tests/test-ptsname_r.c: Likewise.
* tests/test-sigsegv-catch-stackoverflow1.c: Likewise.
* tests/test-sigsegv-catch-stackoverflow2.c: Likewise.
* lib/getloadavg.c: Likewise. Adjust conditions and comments to account
for the fact that NeXT defines __GNU__ and not __gnu_hurd__.

6 weeks agoutimensat: Make sure exit status in configure check doesn't exceed 127.
Collin Funk [Wed, 19 Mar 2025 01:12:39 +0000 (18:12 -0700)]
utimensat: Make sure exit status in configure check doesn't exceed 127.

Reported by Bruno Haible in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00061.html>.

* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Merge bits for tests to match
expectations on current platforms.

6 weeks agoutimensat: Increment serial number for previous commit.
Collin Funk [Tue, 18 Mar 2025 05:13:04 +0000 (22:13 -0700)]
utimensat: Increment serial number for previous commit.

* m4/utimensat.m4: Increment serial number.

6 weeks agoutimensat: Work around a GNU/Hurd bug.
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.

7 weeks agovma-iter: Detect executable memory segments on Haiku (regr. 2011-01-25).
Collin Funk [Fri, 14 Mar 2025 02:11:08 +0000 (19:11 -0700)]
vma-iter: Detect executable memory segments on Haiku (regr. 2011-01-25).

* lib/vma-iter.c (vma_iterate) [__BEOS__ || __HAIKU__]: Use the
B_EXECUTE_AREA flag.

7 weeks agodup3: Fix behavior for equal file descriptors on Haiku.
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.

7 weeks agofcntl-h: Fix GNULIB_defined_O_NONBLOCK on Haiku (regr. 2025-02-16).
Bruno Haible [Wed, 12 Mar 2025 10:52:05 +0000 (11:52 +0100)]
fcntl-h: Fix GNULIB_defined_O_NONBLOCK on Haiku (regr. 2025-02-16).

* lib/fcntl.in.h (_@GUARD_PREFIX@_ALREADY_INCLUDING_FCNTL_H): New macro.

7 weeks agoFix typo in last commit.
Simon Josefsson [Wed, 12 Mar 2025 10:29:59 +0000 (11:29 +0100)]
Fix typo in last commit.

7 weeks agodoc: Improvements for gnulib git bundle.
Simon Josefsson [Wed, 12 Mar 2025 10:22:39 +0000 (11:22 +0100)]
doc: Improvements for gnulib git bundle.

* doc/gnulib-git-bundle.texi (Gnulib Git Bundle): Use https URL,
suggested by Bruno.  Update instructions and add checksum/keyinfo.

7 weeks agoquotearg: Avoid undefined behaviour.
Bruno Haible [Mon, 10 Mar 2025 16:28:33 +0000 (17:28 +0100)]
quotearg: Avoid undefined behaviour.

Reported by Kirill Furman <kfurman@astralinux.ru> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00037.html>.

* lib/quotearg.c (set_char_quoting): Use 'unsigned int', not 'int', for
doing bit mask operations.

7 weeks agogetlogin, getlogin_r: Document limitation.
Bruno Haible [Mon, 10 Mar 2025 05:23:06 +0000 (06:23 +0100)]
getlogin, getlogin_r: Document limitation.

Reported by Nicolas Boos <nicolas.boos@wanadoo.fr> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00033.html>.

* doc/posix-functions/getlogin.texi: Mention the "different user names
with same uid" limitation.
* doc/posix-functions/getlogin_r.texi: Likewise.

8 weeks agogetlogin_r: Work around musl 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.

8 weeks agogetlogin: Work around musl bug.
Bruno Haible [Sun, 9 Mar 2025 09:16:58 +0000 (10:16 +0100)]
getlogin: Work around musl bug.

* lib/unistd.in.h (getlogin): Consider REPLACE_GETLOGIN.
* lib/getlogin.c: Change license header to GPL.
(getlogin): Add implementation for Linux.
* m4/getlogin.m4 (gl_FUNC_GETLOGIN): Test whether getlogin works.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_GETLOGIN.
* modules/unistd-h (Makefile.am): Substitute REPLACE_GETLOGIN.
* modules/getlogin (Depends-on): Add readutmp.
(configure.ac): Consider REPLACE_GETLOGIN.
(License): Change to GPL.
* tests/test-getlogin.c (main): Add another test.
* doc/posix-functions/getlogin.texi: Mention the workaround.

8 weeks agogetlogin: document musl bug
Paul Eggert [Sat, 8 Mar 2025 23:36:33 +0000 (15:36 -0800)]
getlogin: document musl bug

Problem reported by Nicolas Boos <https://bugs.gnu.org/76876>.

8 weeks agogocomp-script: Avoid error on native Windows.
Bruno Haible [Sat, 8 Mar 2025 03:08:10 +0000 (04:08 +0100)]
gocomp-script: Avoid error on native Windows.

* build-aux/gocomp.sh.in: Unset CC and CXX.

8 weeks agogocomp-script: New module.
Bruno Haible [Thu, 6 Mar 2025 22:56:01 +0000 (23:56 +0100)]
gocomp-script: New module.

* m4/gocomp.m4: New file.
* build-aux/gocomp.sh.in: New file.
* modules/gocomp-script: New file.

8 weeks agogetaddrinfo: Fix AI_NUMERICSERV configure check on GCC 14 (regr. 2025-02-12).
Collin Funk [Wed, 5 Mar 2025 05:45:58 +0000 (21:45 -0800)]
getaddrinfo: Fix AI_NUMERICSERV configure check on GCC 14 (regr. 2025-02-12).

* m4/getaddrinfo.m4 (gl_GETADDRINFO): Define a pointer to pass to
getaddrinfo where it allocates and stores the result.

2 months agodoc: Update publication recipe.
Bruno Haible [Mon, 3 Mar 2025 21:02:04 +0000 (22:02 +0100)]
doc: Update publication recipe.

* doc/README: Update publication commands.

2 months agodoc: Document upcoming Gnulib Git Bundle.
Simon Josefsson [Mon, 3 Mar 2025 20:08:01 +0000 (21:08 +0100)]
doc: Document upcoming Gnulib Git Bundle.

* doc/gnulib.texi (Miscellaneous Notes): Add sub-section "Gnulib Git Bundle".
* doc/gnulib-git-bundle.texi: New file.

2 months agovasprintf-posix, vasprintf-gnu: Fix module description.
Bruno Haible [Mon, 3 Mar 2025 19:41:41 +0000 (20:41 +0100)]
vasprintf-posix, vasprintf-gnu: Fix module description.

Reported by Vivien Kraus <vivien@planete-kraus.eu> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00009.html>.

* modules/vasprintf-posix (Include): Change to <stdio.h>.
* modules/vasprintf-gnu (Include): Likewise.

2 months agopackage-version: Improve wording in './configure --help'.
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.

2 months agovc-mtime: Fix module description.
Bruno Haible [Fri, 28 Feb 2025 08:00:55 +0000 (09:00 +0100)]
vc-mtime: Fix module description.

Reported by Vivien Kraus <vivien@planete-kraus.eu> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-02/msg00174.html>.

* modules/vc-mtime (Include): Fix typo.

2 months agocsharpcomp: Reduce number of read() system calls.
Bruno Haible [Tue, 25 Feb 2025 08:04:45 +0000 (09:04 +0100)]
csharpcomp: Reduce number of read() system calls.

* lib/csharpcomp.c: Include <stddef.h>.
(compile_csharp_using_dotnet): Read bytes into a buffer, not one-by-one.

2 months agovc-mtime: Reduce number of read() system calls.
Bruno Haible [Tue, 25 Feb 2025 08:04:28 +0000 (09:04 +0100)]
vc-mtime: Reduce number of read() system calls.

* lib/vc-mtime.c: Include <stddef.h>.
(git_vc_controlled): Read bytes into a buffer, not one-by-one.

2 months agovc-mtime: Improve comment.
Bruno Haible [Tue, 25 Feb 2025 08:19:52 +0000 (09:19 +0100)]
vc-mtime: Improve comment.

Suggested by Paul Eggert.

* lib/vc-mtime.c (git_mtime): Clarify CommitDate vs. AuthorDate.

2 months agovc-mtime: New module.
Bruno Haible [Mon, 24 Feb 2025 18:03:17 +0000 (19:03 +0100)]
vc-mtime: New module.

* lib/vc-mtime.h: New file.
* lib/vc-mtime.c: New file.
* modules/vc-mtime: New file.

2 months agonl_langinfo: Support abbreviated alternative month names on FreeBSD.
Bruno Haible [Mon, 24 Feb 2025 10:12:23 +0000 (11:12 +0100)]
nl_langinfo: Support abbreviated alternative month names on FreeBSD.

* m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): If HAVE_LANGINFO_ABALTMON
is 0, set REPLACE_NL_LANGINFO to 1.

2 months agogetlocalename_l-unsafe: Fix compilation error on OpenBSD, AIX.
Bruno Haible [Mon, 24 Feb 2025 08:24:45 +0000 (09:24 +0100)]
getlocalename_l-unsafe: Fix compilation error on OpenBSD, AIX.

* modules/getlocalename_l-unsafe (configure.ac): Add module indicator.
* m4/locale_h.m4 (gl_LOCALE_H_REQUIRE_DEFAULTS): Initialize
GNULIB_GETLOCALENAME_L_UNSAFE.
* modules/locale-h (Makefile.am): Substitute
GNULIB_GETLOCALENAME_L_UNSAFE.
* lib/locale.in.h (newlocale, duplocale, freelocale): Test the module
indicator of 'getlocalename_l-unsafe', not the module indicator of
'getlocalename_l'.

2 months agonl_langinfo: Fix support of abbreviated alternative month names.
Bruno Haible [Mon, 24 Feb 2025 07:34:15 +0000 (08:34 +0100)]
nl_langinfo: Fix support of abbreviated alternative month names.

* lib/nl_langinfo.c (rpl_nl_langinfo): Treat ABALTMON_i like ABMON_i.

2 months agostrerror_l tests: Fix link error.
Bruno Haible [Mon, 24 Feb 2025 07:07:40 +0000 (08:07 +0100)]
strerror_l tests: Fix link error.

* modules/strerror_l-tests (Makefile.am): Link the test program with
LIBINTL.

2 months agolocalename-unsafe-limited: Use getlocalename_l-unsafe-limited.
Bruno Haible [Sat, 22 Feb 2025 17:39:21 +0000 (18:39 +0100)]
localename-unsafe-limited: Use getlocalename_l-unsafe-limited.

* modules/localename-unsafe-limited (Depends-on): Add
getlocalename_l-unsafe-limited. Remove getlocalename_l-unsafe.

2 months agogetlocalename_l-unsafe-limited: New module.
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'.

2 months agolocalename-unsafe: Use getlocalename_l-unsafe.
Bruno Haible [Sat, 22 Feb 2025 17:18:53 +0000 (18:18 +0100)]
localename-unsafe: Use getlocalename_l-unsafe.

* lib/localename-unsafe.c: Include getlocalename_l-unsafe.h.
(gl_locale_name_thread_unsafe): Invoke getlocalename_l_unsafe instead of
getlocalename_l.
* modules/localename-unsafe (Depends-on): Add getlocalename_l-unsafe.
Remove getlocalename_l-simple.
* modules/localename-unsafe-limited (Depends-on): Likewise.

2 months agogetlocalename_l-unsafe: New module.
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.

2 months agolanginfo-h, nl_langinfo: Support abbreviated alternative month names.
Bruno Haible [Fri, 21 Feb 2025 18:26:23 +0000 (19:26 +0100)]
langinfo-h, nl_langinfo: Support abbreviated alternative month names.

* lib/langinfo.in.h (ABALTMON_1...ABALTMON_12): New macros.
* m4/langinfo_h.m4 (gl_LANGINFO_H): Define HAVE_LANGINFO_ABALTMON.
* modules/langinfo-h (Makefile.am): Substitute HAVE_LANGINFO_ABALTMON.
* tests/test-langinfo-h.c (items): Add ABALTMON_1 to ABALTMON_12.
* lib/nl_langinfo.c (rpl_nl_langinfo): Treat ABALTMON_i like ABMON_i.
* tests/test-nl_langinfo.c (main): Test ABALTMON_*.
* doc/posix-headers/langinfo.texi: Document support of ABALTMON_*.
* doc/posix-functions/nl_langinfo.texi: Likewise.

2 months agolanginfo-h tests: Verify that ALTMON_* are defined.
Bruno Haible [Fri, 21 Feb 2025 17:42:22 +0000 (18:42 +0100)]
langinfo-h tests: Verify that ALTMON_* are defined.

* tests/test-langinfo-h.c (items): Add ALTMON_1 to ALTMON_12.

2 months agohost-cpu-c-abi: Improve support for loongarch32.
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*.

2 months agogetlocalename_l-simple: Add tests.
Bruno Haible [Fri, 21 Feb 2025 10:25:54 +0000 (11:25 +0100)]
getlocalename_l-simple: Add tests.

* tests/test-getlocalename_l.c: New file.
* modules/getlocalename_l-simple-tests: New file.

2 months agogetlocalename_l-simple: New module.
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.

2 months agosetlocale-messages: 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.

2 months agolocalename-unsafe: Remove dead code.
Bruno Haible [Fri, 21 Feb 2025 07:37:16 +0000 (08:37 +0100)]
localename-unsafe: Remove dead code.

* lib/localename-unsafe.c (gl_locale_name_thread_unsafe): On Solaris,
assume HAVE_NAMELESS_LOCALES is undefined.

2 months agolocalename-unsafe: Remove support for nonexistent Solaris 12.
Bruno Haible [Fri, 21 Feb 2025 07:37:10 +0000 (08:37 +0100)]
localename-unsafe: Remove support for nonexistent Solaris 12.

* m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): Remove test for
getlocalename_l.
* lib/localename-unsafe.c: Ignore HAVE_GETLOCALENAME_L.

2 months agosetlocale: Relicense under LGPLv2+.
Bruno Haible [Fri, 21 Feb 2025 07:29:45 +0000 (08:29 +0100)]
setlocale: Relicense under LGPLv2+.

* modules/setlocale (License): Change to LGPLv2+.
* lib/setlocale.c: Update license notice.

2 months ago*_l: Fix mistake.
Bruno Haible [Thu, 20 Feb 2025 15:09:49 +0000 (16:09 +0100)]
*_l: Fix mistake.

* lib/is_l-impl.h (FUNC): Fix array index on old NetBSD and OpenBSD.
* lib/to_l-impl.h (FUNC): Likewise.
* lib/strcasecmp_l.c (strcasecmp_l): Likewise.
* lib/strncasecmp_l.c (strncasecmp_l): Likewise.
* lib/strerror_l.c (strerror_l_r): Likewise.

2 months agoreadutmp: Let callers distinguish LOGINs from USERs.
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.

2 months agostrerror_l: Add tests.
Bruno Haible [Tue, 18 Feb 2025 11:22:30 +0000 (12:22 +0100)]
strerror_l: Add tests.

* tests/test-strerror_l.c: New file.
* modules/strerror_l-tests: New file.

2 months agostrerror_l: New module.
Bruno Haible [Tue, 18 Feb 2025 11:20:41 +0000 (12:20 +0100)]
strerror_l: New module.

* lib/string.in.h: Include <locale.h>.
(strerror_l, strerror_l_r): New declarations.
* lib/strerror_l.c: New file.
* m4/strerror_l.m4: New file.
* m4/string_h.m4 (gl_STRING_H): Test for strerror_l.
(gl_STRING_H_REQUIRE_DEFAULTS): Initialize GNULIB_STRERROR_L.
(gl_STRING_H_DEFAULTS): Initialize HAVE_STRERROR_L, REPLACE_STRERROR_L.
* modules/string-h (Makefile.am): Substitute GNULIB_STRERROR_L,
HAVE_STRERROR_L, REPLACE_STRERROR_L.
* modules/strerror_l: New file.
* tests/test-string-h-c++.cc: Check declaration of strerror_l.
* doc/posix-functions/strerror_l.texi: Mention the new module.

2 months agoerrno-iter: New module.
Bruno Haible [Tue, 18 Feb 2025 11:11:29 +0000 (12:11 +0100)]
errno-iter: New module.

* lib/errno-iter.h: New file.
* lib/errno-iter.c: New file, based on lib/strerrorname_np.c.
* modules/errno-iter: New file.

2 months agoat-init: Add tests.
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.

2 months agoat-init: New module.
Bruno Haible [Tue, 18 Feb 2025 11:01:59 +0000 (12:01 +0100)]
at-init: New module.

* lib/at-init.h: New file.
* lib/at-init.c: New file.
* modules/at-init: New file.

2 months agofts: expose fts_debug
Paul Eggert [Mon, 17 Feb 2025 22:15:37 +0000 (14:15 -0800)]
fts: expose fts_debug

* lib/fts_.h (fts_debug) [GNULIB_FTS_DEBUG]: New decl.
Coreutils was accessing this by the back door; let’s make it public.

2 months agocrc-tests: use consistent type for randomb
Paul Eggert [Mon, 17 Feb 2025 22:14:07 +0000 (14:14 -0800)]
crc-tests: use consistent type for randomb

* tests/randomb.c (randomb): Now array of char, not unsigned char,
since callers all want char.  All uses changed.

2 months agoreadutmp, boot-time: Improve documentation.
Bruno Haible [Mon, 17 Feb 2025 12:08:38 +0000 (13:08 +0100)]
readutmp, boot-time: Improve documentation.

* DEPENDENCIES: Mention requirements of 'readutmp' and 'boot-time'.

2 months agogetaddrinfo tests: Skip test cases that may fail on Debian 12.
Bruno Haible [Mon, 17 Feb 2025 11:03:37 +0000 (12:03 +0100)]
getaddrinfo tests: Skip test cases that may fail on Debian 12.

* tests/test-getaddrinfo.c (main): Skip some test cases on glibc.

2 months agostrncasecmp_l: Fix replacement implementation.
Bruno Haible [Mon, 17 Feb 2025 07:26:28 +0000 (08:26 +0100)]
strncasecmp_l: Fix replacement implementation.

* lib/strncasecmp_l.c (strncasecmp_l): Use tolower_l, not tolower.

2 months agostrcasecmp, strncasecmp: Fix compilation error on MSVC.
Bruno Haible [Mon, 17 Feb 2025 07:11:57 +0000 (08:11 +0100)]
strcasecmp, strncasecmp: Fix compilation error on MSVC.

* modules/strcasecmp (configure.ac): Invoke gl_STRINGS_MODULE_INDICATOR.
* modules/strncasecmp (configure.ac): Likewise.

2 months agogetaddrinfo tests: Make failures more verbose.
Bruno Haible [Mon, 17 Feb 2025 06:34:23 +0000 (07:34 +0100)]
getaddrinfo tests: Make failures more verbose.

* tests/test-getaddrinfo.c (simple): Print some info before returning 1.

2 months agodoc: Adjust platforms that define O_CLOEXEC in unistd.h.
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.

2 months agostrncasecmp_l: Add tests.
Bruno Haible [Sun, 16 Feb 2025 21:32:37 +0000 (22:32 +0100)]
strncasecmp_l: Add tests.

* tests/test-strncasecmp_l.c: New file.
* modules/strncasecmp_l-tests: New file.

2 months agostrncasecmp_l: New module.
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.

2 months agostrcasecmp_l: Add tests.
Bruno Haible [Sun, 16 Feb 2025 21:32:19 +0000 (22:32 +0100)]
strcasecmp_l: Add tests.

* tests/test-strcasecmp_l.c: New file.
* modules/strcasecmp_l-tests: New file.

2 months agostrcasecmp_l: New module.
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.

2 months agounistd-h tests: Check that unistd.h defines O_CLOEXEC.
Collin Funk [Sun, 16 Feb 2025 20:29:36 +0000 (12:29 -0800)]
unistd-h tests: Check that unistd.h defines O_CLOEXEC.

* tests/test-unistd-h.c: Prefer #error to emitting a syntax error. Check
that O_CLOEXEC is defined.