]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 weeks agoregex: don’t check RE_SYNTAX_EMACS
Paul Eggert [Mon, 14 Apr 2025 21:43:02 +0000 (14:43 -0700)]
regex: don’t check RE_SYNTAX_EMACS

* m4/regex.m4 (gl_REGEX): Do not check RE_SYNTAX_EMACS’s value.
Suggested by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2025-04/msg00098.html

2 weeks agoc32is*, c32to* tests: Avoid test failures on macOS 15.4.
Bruno Haible [Mon, 14 Apr 2025 20:53:12 +0000 (22:53 +0200)]
c32is*, c32to* tests: Avoid test failures on macOS 15.4.

* tests/test-c32isalnum.c (main): On macOS, disable test cases that fail
on macOS 15.4.
* tests/test-c32isalpha.c (main): Likewise.
* tests/test-c32isgraph.c (main): Likewise.
* tests/test-c32islower.c (main): Likewise.
* tests/test-c32isprint.c (main): Likewise.
* tests/test-c32ispunct.c (main): Likewise.
* tests/test-c32isspace.c (main): Likewise.
* tests/test-c32isupper.c (main): Likewise.
* tests/test-c32tolower.c (main): Likewise.
* tests/test-c32toupper.c (main): Likewise.

2 weeks agoc-stack tests: Remove left-over core dump file.
Bruno Haible [Mon, 14 Apr 2025 20:49:55 +0000 (22:49 +0200)]
c-stack tests: Remove left-over core dump file.

Suggested by Eric Blake in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-04/msg00101.html>.

* tests/test-c-stack2.sh: Remove 'core' and 'test-c-stack.core' when
done.

2 weeks agoregex: Fix undefined behaviour.
Bruno Haible [Mon, 14 Apr 2025 14:00:13 +0000 (16:00 +0200)]
regex: Fix undefined behaviour.

* lib/regex.h (_REGEX_NELTS): Define to empty; don't use ISO C99
variable-length arrays.

2 weeks agoselect tests: Work around a Cygwin bug.
Bruno Haible [Mon, 14 Apr 2025 13:15:12 +0000 (15:15 +0200)]
select tests: Work around a Cygwin bug.

* tests/test-select-in.sh: Skip the /dev/null test on Cygwin 3.6.x.

2 weeks agoisnanl, isfinite, snan: Improve cross-compilation guess.
Bruno Haible [Mon, 14 Apr 2025 10:14:38 +0000 (12:14 +0200)]
isnanl, isfinite, snan: Improve cross-compilation guess.

* m4/exponentl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): Don't assume that
arm is always little-endian.

2 weeks agoisnanl, isfinite, snan: Improve cross-compilation guess.
Bruno Haible [Mon, 14 Apr 2025 09:37:25 +0000 (11:37 +0200)]
isnanl, isfinite, snan: Improve cross-compilation guess.

* m4/exponentl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): When
cross-compiling, invoke gl_LONG_DOUBLE_VS_DOUBLE and
gl_DOUBLE_EXPONENT_LOCATION, and guess the result depending on the CPU.
* modules/getpayloadl (Depends-on): Add exponentd.m4, math_h.m4.
* modules/isfinite (Depends-on): Likewise.
* modules/isnanl (Depends-on): Likewise.
* modules/setpayloadl (Depends-on): Likewise.
* modules/setpayloadsigl (Depends-on): Likewise.
* modules/isnanl-nolibm (Depends-on): Add exponentd.m4.

2 weeks agoregex: make RE_* usable in #if
Paul Eggert [Mon, 14 Apr 2025 03:47:54 +0000 (20:47 -0700)]
regex: make RE_* usable in #if

* lib/regex.h (RE_BACKSLASH_ESCAPE_IN_LISTS):
Define to 1ul so that the RE_* macros can be used in #if.

2 weeks agoregex: don’t assume RE_SYNTAX_* work in #if
Paul Eggert [Mon, 14 Apr 2025 01:53:17 +0000 (18:53 -0700)]
regex: don’t assume RE_SYNTAX_* work in #if

* m4/regex.m4 (gl_REGEX): Fix thinko that would have
prevented future glibc versions from passing the test.

2 weeks agoregex: pacify gcc -Wcalloc-transposed-args
Paul Eggert [Mon, 14 Apr 2025 01:36:29 +0000 (18:36 -0700)]
regex: pacify gcc -Wcalloc-transposed-args

* lib/regcomp.c (init_dfa, parse_bracket_exp)
(build_charclass_op):
* lib/regex_internal.c (create_ci_newstate, create_cd_newstate):
* lib/regexec.c (get_subexp, build_trtable):
When calling calloc, put size argument last.

2 weeks agoregex: match current Emacs behavior
Paul Eggert [Mon, 14 Apr 2025 01:01:08 +0000 (18:01 -0700)]
regex: match current Emacs behavior

* config/srclist.txt: Comment out regex.h, since we now
disagree with glibc.
* lib/regex.h (RE_SYNTAX_EMACS):
Match Emacs 21+ behavior, not Emacs 20-.
* m4/regex.m4 (gl_REGEX): Check for this Emacs fix.

2 weeks agogetlogin_r tests: Avoid writing to a literal string.
Bruno Haible [Sun, 13 Apr 2025 21:18:10 +0000 (23:18 +0200)]
getlogin_r tests: Avoid writing to a literal string.

* tests/test-getlogin_r.c: Include xalloc.h.
(main): Pass a writable string to putenv().
* modules/getlogin_r-tests (Depends-on): Add xalloc.
(Makefile.am): Link the program with libintl when needed.

2 weeks agogetlogin tests: Avoid writing to a literal string.
Bruno Haible [Sun, 13 Apr 2025 21:17:06 +0000 (23:17 +0200)]
getlogin tests: Avoid writing to a literal string.

* tests/test-getlogin.c: Include xalloc.h.
(main): Pass a writable string to putenv().
* modules/getlogin-tests (Depends-on): Add xalloc.
(Makefile.am): Link the program with libintl when needed.

3 weeks agovasnprintf: Optimize last commit.
Bruno Haible [Sun, 13 Apr 2025 18:23:57 +0000 (20:23 +0200)]
vasnprintf: Optimize last commit.

* lib/vasnprintf.c (VASNPRINTF): Optimize a few loops.

3 weeks agovasnprintf: Consider the grouping rule.
Bruno Haible [Sun, 13 Apr 2025 15:58:40 +0000 (17:58 +0200)]
vasnprintf: Consider the grouping rule.

Reported by Pádraig Brady.

* lib/vasnprintf.c (grouping_rule, num_thousands_separators): New
functions.
(MAX_ROOM_NEEDED): Adjust worst-case guess for FLAG_GROUP.
(VASNPRINTF): Likewise. Invoke grouping_rule, num_thousands_separators.
Use the grouping rule to determine where to insert the thousands
separators.
* modules/vasnprintf (Depends-on): Add localeconv.
* modules/vasnwprintf (Depends-on): Likewise.
* modules/c-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u8-u8-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u8-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u16-u16-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u16-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u32-u32-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u32-vasnprintf (Depends-on): Likewise.
* modules/unistdio/ulc-vasnprintf (Depends-on): Likewise.

3 weeks agovasnprintf tests: Fix compilation error on MSVC (regression yesterday).
Bruno Haible [Sun, 13 Apr 2025 15:48:56 +0000 (17:48 +0200)]
vasnprintf tests: Fix compilation error on MSVC (regression yesterday).

* tests/test-vasnprintf-posix2.c (main): Disable the new test on
platforms where the 'long double' value range is insufficient.
* tests/test-vasnwprintf-posix2.c (main): Likewise.

3 weeks ago*printf: Document a Haiku bug.
Bruno Haible [Sun, 13 Apr 2025 09:17:26 +0000 (11:17 +0200)]
*printf: Document a Haiku bug.

* doc/posix-functions/fwprintf.texi: Mention the missing ' flag support.
* doc/posix-functions/vfwprintf.texi: Likewise.
* doc/posix-functions/wprintf.texi: Likewise.
* doc/posix-functions/vwprintf.texi: Likewise.
* doc/posix-functions/swprintf.texi: Likewise.
* doc/posix-functions/vswprintf.texi: Likewise.

3 weeks agoaligned-malloc tests: Simplify a macro definition and improve comment.
Collin Funk [Sat, 12 Apr 2025 22:03:41 +0000 (15:03 -0700)]
aligned-malloc tests: Simplify a macro definition and improve comment.

Suggested by Bruno Haible.

* tests/test-aligned-malloc.c (ALIGNMENT): Undefine without checking.
Mention that the #undef is for AIX which defines it beforehand in
<sys/socket.h>.

3 weeks agoimmutable: Simplify a macro definition and improve comment.
Collin Funk [Sat, 12 Apr 2025 22:02:33 +0000 (15:02 -0700)]
immutable: Simplify a macro definition and improve comment.

Suggested by Bruno Haible.

* lib/immutable.c (ALIGNMENT): Undefine without checking. Mention that
the #undef is for AIX which defines it beforehand in <sys/socket.h>.

3 weeks agovasnprintf tests: Add a test case that showcases a Solaris bug.
Bruno Haible [Sat, 12 Apr 2025 21:48:28 +0000 (23:48 +0200)]
vasnprintf tests: Add a test case that showcases a Solaris bug.

* tests/test-vasnprintf-posix2.c (main): Add one more %'g test.
* tests/test-vasnwprintf-posix2.c (main): Likewise.

3 weeks agostdlib: Avoid syntax errors in libstdc++ header files on AIX.
Collin Funk [Sat, 12 Apr 2025 20:24:31 +0000 (13:24 -0700)]
stdlib: Avoid syntax errors in libstdc++ header files on AIX.

* lib/stdlib.in.h: Include <string> before strtol, strtoll, strtoul, or
strtoull gets defined as a macro.

3 weeks agoaligned-malloc tests: Avoid redefining macros on AIX.
Collin Funk [Sat, 12 Apr 2025 19:36:10 +0000 (12:36 -0700)]
aligned-malloc tests: Avoid redefining macros on AIX.

* tests/test-aligned-malloc.c (ALIGNMENT): Undefine any definition from
system headers.

3 weeks agoimmutable: Avoid redefining macros on AIX.
Collin Funk [Sat, 12 Apr 2025 19:30:30 +0000 (12:30 -0700)]
immutable: Avoid redefining macros on AIX.

* lib/immutable.c (ALIGNMENT): Undefine any definition from system
headers.

3 weeks agois*_l, fnmatch tests: Avoid test failures on macOS 15.4.
Bruno Haible [Sat, 12 Apr 2025 10:45:40 +0000 (12:45 +0200)]
is*_l, fnmatch tests: Avoid test failures on macOS 15.4.

Reported by Daniel Collins <solemnwarning@solemnwarning.net>
at <https://savannah.gnu.org/bugs/?67007>.

* tests/test-isgraph_l.c (main): On macOS, disable test cases that fail
on macOS 15.4.
* tests/test-isprint_l.c (main): Likewise.
* tests/test-ispunct_l.c (main): Likewise.
* tests/test-fnmatch.c (main): Likewise.

3 weeks agovasnprintf: Work around two grouping bugs on native Windows.
Bruno Haible [Sat, 12 Apr 2025 09:03:45 +0000 (11:03 +0200)]
vasnprintf: Work around two grouping bugs on native Windows.

* m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_FLAG_GROUPING): On native
Windows, define NEED_PRINTF_FLAG_GROUPING.
* lib/vasnprintf.c (localeconv): Undefine.
(thousands_separator_char, thousands_separator_wchar): On native
Windows, use localeconv().
* tests/test-vasnprintf-posix2.c (main): On native Windows, expect
3 digits for the exponent.
* tests/test-vasnwprintf-posix2.c (main): Likewise.
* doc/posix-functions/fprintf.texi: Mention the mingw and MSVC bugs.
* doc/posix-functions/vfprintf.texi: Likewise.
* doc/posix-functions/printf.texi: Likewise.
* doc/posix-functions/vprintf.texi: Likewise.
* doc/posix-functions/sprintf.texi: Likewise.
* doc/posix-functions/vsprintf.texi: Likewise.
* doc/posix-functions/snprintf.texi: Likewise.
* doc/posix-functions/vsnprintf.texi: Likewise.
* doc/posix-functions/dprintf.texi: Likewise.
* doc/posix-functions/vdprintf.texi: Likewise.
* doc/posix-functions/fwprintf.texi: Likewise.
* doc/posix-functions/vfwprintf.texi: Likewise.
* doc/posix-functions/wprintf.texi: Likewise.
* doc/posix-functions/vwprintf.texi: Likewise.
* doc/posix-functions/swprintf.texi: Likewise.
* doc/posix-functions/vswprintf.texi: Likewise.
* doc/posix-functions/asprintf.texi: Likewise.
* doc/posix-functions/vasprintf.texi: Likewise.
* doc/glibc-functions/obstack_printf.texi: Likewise.
* doc/glibc-functions/obstack_vprintf.texi: Likewise.

3 weeks agolocaleconv tests: Add multithread-safety test.
Bruno Haible [Sat, 12 Apr 2025 07:32:43 +0000 (09:32 +0200)]
localeconv tests: Add multithread-safety test.

* tests/test-localeconv-mt.c: New file, based on
tests/test-nl_langinfo-mt.c.
* modules/localeconv-tests (Files): Add it.
(Depends-on): Add setlocale, thread, nanosleep.
(Makefile.am): Arrange to compile and run test-localeconv-mt.

3 weeks agovasnprintf: Work around two grouping bugs on many platforms.
Bruno Haible [Fri, 11 Apr 2025 22:09:23 +0000 (00:09 +0200)]
vasnprintf: Work around two grouping bugs on many platforms.

* m4/printf.m4 (gl_PRINTF_FLAG_GROUPING_INT_PRECISION): New macro.
(gl_PRINTF_FLAG_GROUPING_MULTIBYTE): New macro.
* m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_IS_POSIX): Require
gl_PRINTF_FLAG_GROUPING_INT_PRECISION,
gl_PRINTF_FLAG_GROUPING_MULTIBYTE. Test
gl_cv_func_printf_flag_grouping_int_precision,
gl_cv_func_printf_flag_grouping_multibyte.
* m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_IS_POSIX): Likewise.
* m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_IS_POSIX): Likewise.
* m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_IS_POSIX): Likewise.
* m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_IS_POSIX): Likewise.
* m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_IS_POSIX): Likewise.
* m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_IS_POSIX): Likewise.
* m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_IS_POSIX): Likewise.
* m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_IS_POSIX): Likewise.
* m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_IS_POSIX): Likewise.
* m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_IS_POSIX):
Likewise.
* m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_FLAG_GROUPING): Require
gl_PRINTF_FLAG_GROUPING_INT_PRECISION,
gl_PRINTF_FLAG_GROUPING_MULTIBYTE. Test
gl_cv_func_printf_flag_grouping_int_precision,
gl_cv_func_printf_flag_grouping_multibyte. Define the C macro
NEED_PRINTF_FLAG_GROUPING_INT.
* lib/vasnprintf.c (thousands_separator_char): New function.
(THOUSEP_CHAR_MAXLEN): New macro.
(thousands_separator_wchar): New function.
(THOUSEP_WCHAR_MAXLEN): New macro.
(MAX_ROOM_NEEDED): Improve the room estimate for FLAG_GROUP.
(VASNPRINTF): Add code for emitting thousands separators in the %f, %F,
%g, %G implementations and in the code relies the system's
sprintf/snprintf/swprintf function. Test NEED_PRINTF_FLAG_GROUPING and
NEED_PRINTF_FLAG_GROUPING_INT where needed.
* tests/test-vasnprintf-posix2.c (main): Add tests of the grouping flag.
* tests/test-vasnwprintf-posix2.c (main): Likewise.
* tests/test-vasnprintf-posix2.sh: Test in both French locales, not only
in one of them.
* tests/test-vasnwprintf-posix2.sh: Likewise.
* modules/vasnprintf-posix-tests (Depends-on): Add localeconv.
* modules/vasnwprintf-posix-tests (Depends-on): Likewise.
* doc/posix-functions/fprintf.texi: Mention the grouping bug with
precision on integers and the grouping bug with a multibyte thousands
separator.
* doc/posix-functions/vfprintf.texi: Likewise.
* doc/posix-functions/printf.texi: Likewise.
* doc/posix-functions/vprintf.texi: Likewise.
* doc/posix-functions/sprintf.texi: Likewise.
* doc/posix-functions/vsprintf.texi: Likewise.
* doc/posix-functions/snprintf.texi: Likewise.
* doc/posix-functions/vsnprintf.texi: Likewise.
* doc/posix-functions/dprintf.texi: Likewise.
* doc/posix-functions/vdprintf.texi: Likewise.
* doc/posix-functions/fwprintf.texi: Likewise.
* doc/posix-functions/vfwprintf.texi: Likewise.
* doc/posix-functions/wprintf.texi: Likewise.
* doc/posix-functions/vwprintf.texi: Likewise.
* doc/posix-functions/swprintf.texi: Likewise.
* doc/posix-functions/vswprintf.texi: Likewise.
* doc/posix-functions/asprintf.texi: Likewise.
* doc/posix-functions/vasprintf.texi: Likewise.
* doc/glibc-functions/obstack_printf.texi: Likewise.
* doc/glibc-functions/obstack_vprintf.texi: Likewise.

3 weeks agovasnprintf: Follow glibc's behaviour on glibc systems.
Bruno Haible [Fri, 11 Apr 2025 14:59:24 +0000 (16:59 +0200)]
vasnprintf: Follow glibc's behaviour on glibc systems.

* lib/vasnprintf.c (DCHAR_MBSNLEN): Define fallback.
(VASNPRINTF): Use it on for width handling on glibc.
* modules/vasnprintf (Depends-on): Add mbsnlen.
* modules/c-vasnprintf (Depends-on): Likewise.

3 weeks agovasnprintf: Fix memory size bound for %g with grouping and precision.
Bruno Haible [Fri, 11 Apr 2025 14:45:03 +0000 (16:45 +0200)]
vasnprintf: Fix memory size bound for %g with grouping and precision.

* lib/vasnprintf.c (MAX_ROOM_NEEDED): For %g, consider also the size of
the thousands separators.

3 weeks agonewlocale: Support cross-compilation.
Bruno Haible [Fri, 11 Apr 2025 07:50:58 +0000 (09:50 +0200)]
newlocale: Support cross-compilation.

* m4/newlocale.m4 (gl_FUNC_NEWLOCALE): Use a no-op command as third
argument of AC_RUN_IFELSE.

3 weeks agostrcasecmp: Support cross-compilation.
Bruno Haible [Thu, 10 Apr 2025 14:42:14 +0000 (16:42 +0200)]
strcasecmp: Support cross-compilation.

Reported by Rudi Heitbaum <rudi@heitbaum.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-04/msg00055.html>.

* m4/strcasecmp.m4 (gl_STRCASECMP_WORKS): Use a no-op command as third
argument of AC_RUN_IFELSE.

3 weeks agovasnprintf: Fix handling of # flag in %b, %B directives.
Bruno Haible [Thu, 10 Apr 2025 08:42:12 +0000 (10:42 +0200)]
vasnprintf: Fix handling of # flag in %b, %B directives.

* lib/vasnprintf.c (VASNPRINTF): In the prec_ourselves code, treat a 0b
prefix like a 0x prefix.

3 weeks agostring-h: Fix build error on Windows/macOS about strerror_l.
Simon Josefsson [Wed, 9 Apr 2025 06:45:40 +0000 (08:45 +0200)]
string-h: Fix build error on Windows/macOS about strerror_l.

https://lists.gnu.org/r/bug-gnulib/2025-04/msg00045.html

* lib/string.in.h: Wrap _GL_WARN_ON_USE in
HAVE_RAW_DECL_STRERROR_L.

3 weeks agostddef-h: Silence autoconf warnings introduced in previous commit.
Collin Funk [Wed, 9 Apr 2025 04:20:39 +0000 (21:20 -0700)]
stddef-h: Silence autoconf warnings introduced in previous commit.

* m4/stddef_h.m4 (gl_STDDEF_H): Use AC_LANG_SOURCE inside call to
AC_COMPILE_IFELSE.

3 weeks agostddef-h: Make a configure test work with upcoming GCC 15.
Bruno Haible [Tue, 8 Apr 2025 09:31:20 +0000 (11:31 +0200)]
stddef-h: Make a configure test work with upcoming GCC 15.

* m4/stddef_h.m4 (gl_STDDEF_H): Replace test "for clean definition" with
one that succeeds in GCC 15.

3 weeks agoverify: Enhance a comment.
Bruno Haible [Mon, 7 Apr 2025 09:02:02 +0000 (11:02 +0200)]
verify: Enhance a comment.

* lib/verify.h (_GL_COUNTER): Reference portability study regarding
__COUNTER__.

3 weeks agostdioext: Update comments regarding Haiku.
Bruno Haible [Mon, 7 Apr 2025 08:55:46 +0000 (10:55 +0200)]
stdioext: Update comments regarding Haiku.

* lib/fbufmode.c (fbufmode): Update comment.
* lib/fpending.c: Likewise.
* lib/freadable.c: Likewise.
* lib/freadahead.c: Likewise.
* lib/freadptr.c: Likewise.
* lib/freadseek.c (freadptrinc): Likewise.
* lib/fseterr.c: Likewise.
* lib/fwritable.c: Likewise.
* lib/fwriting.c: Likewise.

3 weeks agofile-has-acl: port symlink code to Cygwin
Paul Eggert [Mon, 7 Apr 2025 08:45:17 +0000 (01:45 -0700)]
file-has-acl: port symlink code to Cygwin

Problem reported by Corinna Vinschen in:
https://lists.gnu.org/r/bug-gnulib/2025-03/msg00112.html
* lib/file-has-acl.c (acl_get_link_np): New static function,
defined only if needed; include <fcntl.h> if needed for this.
(HAVE_ACL_GET_LINK_NP): Define this if defining acl_get_link_np.

3 weeks agomaintainer-makefile: Avoid submodule-checks fail without submodules.
Simon Josefsson [Mon, 7 Apr 2025 06:56:09 +0000 (08:56 +0200)]
maintainer-makefile: Avoid submodule-checks fail without submodules.

* top/maint.mk (no-submodule-changes): Condition on .gitmodules.
(public-submodule-commit): Likewise.

3 weeks agofseterr: Port to recent Haiku snapshots.
Collin Funk [Mon, 7 Apr 2025 03:08:25 +0000 (20:08 -0700)]
fseterr: Port to recent Haiku snapshots.

* lib/fseterr.h (__fseterr): Provide missing declaration.

3 weeks agofflush: Port to recent Haiku snapshots.
Collin Funk [Mon, 7 Apr 2025 02:34:54 +0000 (19:34 -0700)]
fflush: Port to recent Haiku snapshots.

* lib/stdio-impl.h (_IO_IN_BACKUP) [__HAIKU__]: Define macros.
* lib/fflush.c (fp_) [!__HAIKU__]: Define to fp.
(fflush): Use fp_ instead of fp.

3 weeks agofbufmode: Port to recent Haiku snapshots.
Collin Funk [Mon, 7 Apr 2025 02:28:27 +0000 (19:28 -0700)]
fbufmode: Port to recent Haiku snapshots.

* lib/stdio-impl.h (_IO_UNBUFFERED, _IO_LINE_BUF) [__HAIKU__]: Define
macros.
* lib/fbufmode.c (fp_) [!__HAIKU__]: Define to fp.
(fbufmode): Use fp_ instead of fp.

3 weeks agofseeko: Port to recent Haiku snapshots.
Collin Funk [Mon, 7 Apr 2025 02:19:35 +0000 (19:19 -0700)]
fseeko: Port to recent Haiku snapshots.

* lib/stdio-impl.h (fp_) [__HAIKU__]: Define to FILE which is an
incomplete type on Haiku.
(_IO_EOF_SEEN) [__HAIKU__]: Define macro.
* lib/fseeko.c (fp_) [!__HAIKU__]: Define to fp.
(fseeko): Use fp_ instead of fp.

4 weeks agognulib-tool.py: Fix missing space.
Eric Blake [Sat, 5 Apr 2025 20:21:13 +0000 (15:21 -0500)]
gnulib-tool.py: Fix missing space.

* pygnulib/main.py (main_with_exception_handling): Typo fix.

4 weeks agomaint: ChangeLog for previous commit
Eric Blake [Fri, 4 Apr 2025 15:13:12 +0000 (10:13 -0500)]
maint: ChangeLog for previous commit

4 weeks agotests: Better name in init.sh usage
Eric Blake [Fri, 4 Apr 2025 15:06:33 +0000 (10:06 -0500)]
tests: Better name in init.sh usage

* tests/init.sh: Prefer a word with non-negative connotation,
and which can't be confused for a typo.

4 weeks agomaintainer-makefile: Work with modern LCOV versions.
Simon Josefsson [Fri, 4 Apr 2025 09:49:13 +0000 (11:49 +0200)]
maintainer-makefile: Work with modern LCOV versions.

* top/maint.mk (gen-coverage): Don't pass --highlight to genhtml.

4 weeks agocrypto/gc: Silence some -Wcalloc-transposed-args warnings.
Bruno Haible [Wed, 2 Apr 2025 22:52:14 +0000 (00:52 +0200)]
crypto/gc: Silence some -Wcalloc-transposed-args warnings.

* lib/gc-gnulib.c (gc_cipher_open, gc_hash_open, gc_hash_clone): Swap
the arguments of calloc().

4 weeks agoSilence some -Wunterminated-string-initialization warnings.
Bruno Haible [Wed, 2 Apr 2025 22:45:30 +0000 (00:45 +0200)]
Silence some -Wunterminated-string-initialization warnings.

* lib/base32.c (base32_encode): Mark b32str as not NUL-terminated.
* lib/base64.c (b64c): Mark as not NUL-terminated.
* lib/bcp47.c (struct script): Mark the 'code' field as not
NUL-terminated.
* lib/striconveh.c (mem_cd_iconveh_internal): Mark hex as not
NUL-terminated.
* lib/unicase/special-casing.in.h (struct special_casing_rule): Mark the
'code' field as not NUL-terminated.

4 weeks agogetlocalename_l-unsafe: Avoid undefined behaviour on Solaris 11.4.
Bruno Haible [Wed, 2 Apr 2025 18:58:17 +0000 (20:58 +0200)]
getlocalename_l-unsafe: Avoid undefined behaviour on Solaris 11.4.

* lib/getlocalename_l-unsafe.c (getlocalename_l_unsafe): On
Solaris 11.4, use "" as fallback.

4 weeks agodcomp-script: Handle gdc binaries named <host>-gdc.
Bruno Haible [Tue, 1 Apr 2025 08:00:54 +0000 (10:00 +0200)]
dcomp-script: Handle gdc binaries named <host>-gdc.

* m4/dcomp.m4 (gt_DCOMP): Look only at the first word of the --version
output and accept a "<host>-" prefix.
* build-aux/dcomp.sh.in: Likewise.

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.

5 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.