]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 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 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.

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

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

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

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

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

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

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

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

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

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

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

8 weeks 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.

8 weeks 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*.

8 weeks 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.

8 weeks 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'.

8 weeks agorealloc: Fix link error in C++ mode on CentOS 5 (regression 2024-11-04).
Bruno Haible [Sun, 16 Feb 2025 14:46:06 +0000 (15:46 +0100)]
realloc: Fix link error in C++ mode on CentOS 5 (regression 2024-11-04).

* lib/stdlib.in.h (rpl_realloc): Ensure C linkage, not C++ linkage, in
C++ mode.

8 weeks agosetlocale: Update info about Galician and Tamil.
Bruno Haible [Thu, 13 Feb 2025 01:18:05 +0000 (02:18 +0100)]
setlocale: Update info about Galician and Tamil.

* lib/setlocale.c (locales_with_principal_territory): Galician is
mostly spoken in Spain, not Portugal. Tamil is mostly spoken in India,
not Sri Lanka.

8 weeks agogettext-h: Fix compilation error on native Windows.
Bruno Haible [Wed, 12 Feb 2025 22:43:21 +0000 (23:43 +0100)]
gettext-h: Fix compilation error on native Windows.

* modules/gettext-h (Depends-on): Add locale-h.

8 weeks agopopen: Set gl_cv_func_popen_works to "guessing no" on OS/2.
KO Myung-Hun [Mon, 10 Feb 2025 11:35:00 +0000 (20:35 +0900)]
popen: Set gl_cv_func_popen_works to "guessing no" on OS/2.

* doc/posix-functions/popen.texi: List OS/2 kLIBC case.
* m4/popen.m4 (gl_FUNC_POPEN): Set gl_cv_func_popen_works to
"guessing no" on OS/2.

Copyright-paperwork-exempt: Yes

8 weeks agoautoupdate
Karl Berry [Tue, 4 Feb 2025 15:03:06 +0000 (07:03 -0800)]
autoupdate

8 weeks agognulib-tool: Apply libgnu.{,l}a specific CFLAGS to all its object files.
Bruno Haible [Mon, 3 Feb 2025 22:55:39 +0000 (23:55 +0100)]
gnulib-tool: Apply libgnu.{,l}a specific CFLAGS to all its object files.

* gnulib-tool.sh (func_emit_initmacro_end): Define
${macro_prefix}_${libname}_{LIBOBJS,LTLIBOBJS,LIBOBJDEPS} macros, that
include libname in the base name of the object files.
(func_emit_lib_Makefile_am): Use ${macro_prefix}_${libname}_*LIBOBJS
values instead of ${macro_prefix}_*LIBOBJS values.
* pygnulib/GLEmiter.py (GLEmiter.initmacro_end): Define
{macro_prefix_arg}_{libname}_{LIBOBJS,LTLIBOBJS,LIBOBJDEPS} macros, that
include libname in the base name of the object files.
(GLEmiter.lib_Makefile_am):Use {macro_prefix}_{libname}_*LIBOBJS
values instead of {macro_prefix}_*LIBOBJS values.

3 months agofile-has-acl: Fix --with-libsmack option handling.
Bruno Haible [Sun, 26 Jan 2025 11:08:16 +0000 (12:08 +0100)]
file-has-acl: Fix --with-libsmack option handling.

* m4/acl.m4 (gl_FUNC_ACL_ARG): Add missing comma between macro
arguments.

3 months agoptsname_r: Work around ptsname_r bug on Solaris 11 OmniOS.
Collin Funk [Sat, 25 Jan 2025 05:36:11 +0000 (21:36 -0800)]
ptsname_r: Work around ptsname_r bug on Solaris 11 OmniOS.

* lib/ptsname_r.c (ptsname_r): Ensure the resulting buffer is not
clobbered if it is too small on Solaris 11 OmniOS.
* m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): On Solaris 11 OmniOS, arrange to
override ptsname_r.
* doc/posix-functions/ptsname_r.texi: Document the bug.

3 months agostrerrorname_np: Work around a bug on Solaris 11 OmniOS.
Collin Funk [Sat, 25 Jan 2025 04:38:54 +0000 (20:38 -0800)]
strerrorname_np: Work around a bug on Solaris 11 OmniOS.

* m4/strerrorname_np.m4 (gl_CHECK_STRERRORNAME_NP): Test if
strerrorname_np returns NULL when given ERESTART or ESTRPIPE.
* doc/glibc-functions/strerrorname_np.texi: Document the bug.

3 months agotests: Fix a few compilation errors on Solaris 11 OmniOS with gcc 14.
Bruno Haible [Fri, 24 Jan 2025 19:06:06 +0000 (20:06 +0100)]
tests: Fix a few compilation errors on Solaris 11 OmniOS with gcc 14.

* tests/test-accept.c: Omit the signature check on Solaris.
* tests/test-gethostname.c: Likewise.
* tests/test-getpeername.c: Likewise.
* tests/test-getsockname.c: Likewise.
* tests/test-getsockopt.c: Likewise.
* tests/test-recvfrom.c: Likewise.
* doc/posix-functions/accept.texi: Mention the Solaris 11 OmniOS
problem.
* doc/posix-functions/gethostname.texi: Likewise.
* doc/posix-functions/getpeername.texi: Likewise.
* doc/posix-functions/getsockname.texi: Likewise.
* doc/posix-functions/getsockopt.texi: Likewise.
* doc/posix-functions/recvfrom.texi: Likewise.

3 months agouchar-h-c23: Fix compilation error on OmniOS.
Collin Funk [Fri, 24 Jan 2025 05:14:43 +0000 (21:14 -0800)]
uchar-h-c23: Fix compilation error on OmniOS.

* lib/lc-charset-unicode.c (locale_encoding_to_unicode)
(unicode_to_locale_encoding): Cast the argument to iconv with
ICONV_CONST.

3 months agoflexmember: port to IBM XL C 16.1
Paul Eggert [Sun, 19 Jan 2025 07:02:09 +0000 (23:02 -0800)]
flexmember: port to IBM XL C 16.1

* lib/flexmember.h (FLEXALIGNOF): Use the conservative definition
if _Alignof is a macro, to avoid a C99 conformance issue exposed
by IBM XL C 16.1 which otherwise complains "An aggregate
containing a flexible array member cannot be used as a member of a
structure or as an array element."

3 months agoalignasof: port to IBM XL C 16.1
Paul Eggert [Sun, 19 Jan 2025 06:06:55 +0000 (22:06 -0800)]
alignasof: port to IBM XL C 16.1

* doc/gnulib.texi (alignof):
Improve doc to match implementation better.
* m4/stdalign.m4 (alignas): Do not define to _Alignas
if __xlC__ claims to conform to C11, because _Alignas fails with
weird diagnostics "Unexpected text %1$s encountered."
* tests/test-alignasof.c (TEST_ALIGNMENT, alignas):
Follow doc advice.

3 months agorenameatu: Work around a GNU/Hurd bug.
Collin Funk [Sun, 19 Jan 2025 05:06:49 +0000 (21:06 -0800)]
renameatu: Work around a GNU/Hurd bug.

* m4/renameat.m4 (gl_FUNC_RENAMEAT): Check if renameat2 handles trailing
slashes.
* doc/glibc-functions/renameat2.texi: Mention the GNU/Hurd bug.

3 months agoalignasof: port to IBM XL C V16.1
Paul Eggert [Sat, 18 Jan 2025 06:11:54 +0000 (22:11 -0800)]
alignasof: port to IBM XL C V16.1

* m4/stdalign.m4 (gl_ALIGNASOF):
Work around similar bug in IBM XL C V16.1.0 cc (non-clang).
Since this is the last version of this obsolescent compiler,
assume the bug is in earlier versions.

3 months agoAvoid -Wformat=security failures with --disable-nls
Pádraig Brady [Fri, 17 Jan 2025 13:01:40 +0000 (13:01 +0000)]
Avoid -Wformat=security failures with --disable-nls

This was noticed with GCC 14.

* lib/xmemcoll.c: Always use format arguments.
* lib/xprintf.c: Likewise.

3 months agocrc-x86_64: fix unaligned access
Paul Eggert [Fri, 17 Jan 2025 06:58:55 +0000 (22:58 -0800)]
crc-x86_64: fix unaligned access

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2025-01/msg00142.html
* lib/crc.c (crc32_update_no_xor): Don’t pass unaligned buffer to
crc32_update_no_xor_pclmul.  No doubt there is a higher
performance fix, perhaps involving advancing byte-by-byte along
the buffer until we get to an aligned boundary, but at least this
should fix the alignment bug.

3 months agogetopt-posix: Fix compilation error in C++ mode (regression 2024-09-21).
Bruno Haible [Thu, 16 Jan 2025 22:10:10 +0000 (23:10 +0100)]
getopt-posix: Fix compilation error in C++ mode (regression 2024-09-21).

Reported by G. Branden Robinson <g.branden.robinson@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00135.html>.

* lib/getopt-pfx-core.h: On several platforms, include <unistd.h> first.
* modules/getopt-posix (Files): Add m4/musl.m4.
(configure.ac): Invoke gl_MUSL_LIBC.

3 months agowchar_h: Fix for glibc 2.5.
Bruno Haible [Thu, 16 Jan 2025 20:14:45 +0000 (21:14 +0100)]
wchar_h: Fix for glibc 2.5.

* lib/wchar.in.h (__need_wint_t): Clean up after including glibc's
<wchar.h>.

3 months agofile-has-acl: handle listxattr returning ENOTSUP
Pádraig Brady [Wed, 15 Jan 2025 23:30:24 +0000 (23:30 +0000)]
file-has-acl: handle listxattr returning ENOTSUP

listxattr() was seen to return ENOTSUP on virtiofs,
which resulted in ls outputting "Not supported" errors.

* lib/file-has-acl.c (aclinfo_may_indicate_xattr): Treat any
non valid acl errno as being inconclusive as to whether there
are xattrs available.

3 months agoassert-h: Fix compilation error with gcc >= 13 on Solaris 11.
Bruno Haible [Tue, 14 Jan 2025 21:47:43 +0000 (22:47 +0100)]
assert-h: Fix compilation error with gcc >= 13 on Solaris 11.

Reported by Pádraig Brady <P@draigBrady.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00120.html>.

* m4/assert_h.m4 (gl_ASSERT_H): Don't assume that on Solaris with gcc or
clang, static_assert works: /usr/include/assert.h is in the way.

3 months agocrc: Respect Automake's silent-rules.
Collin Funk [Mon, 13 Jan 2025 06:28:44 +0000 (22:28 -0800)]
crc: Respect Automake's silent-rules.

* modules/crc (Makefile.am): Add the $(AM_V_GEN) prefix before the
command.

3 months agoprogname: also set program_invocation_short_name
Pádraig Brady [Sun, 12 Jan 2025 16:47:57 +0000 (16:47 +0000)]
progname: also set program_invocation_short_name

* lib/progname.c (set_program_name): Keep program_invocation_name
and program_invocation_short_name consistent.

3 months agofile-has-acl: handle NFSv4 ACLs with listxattr returning EACCES
Pádraig Brady [Sat, 11 Jan 2025 16:40:33 +0000 (16:40 +0000)]
file-has-acl: handle NFSv4 ACLs with listxattr returning EACCES

* lib/file-has-acl.c (has_xattr): A new helper function to
lookup aclinfo for the xattr or fallback to getxattr() if appropriate.
(get_aclinfo): Use has_xattr() rather than aclinfo_has_xattr().
Discussed at <https://bugs.gnu.org/74692>

3 months agoeealloc, malloca: Fix module dependencies.
Bruno Haible [Sat, 11 Jan 2025 14:20:48 +0000 (15:20 +0100)]
eealloc, malloca: Fix module dependencies.

Reported by Miro Palmu <email@miropalmu.cc> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00077.html>.

* modules/eealloc (Depends-on): Add stdlib-h.
* modules/malloca (Depends-on): Likewise.

3 months agocanonicalize: Fix module dependencies.
Bruno Haible [Sat, 11 Jan 2025 14:19:57 +0000 (15:19 +0100)]
canonicalize: Fix module dependencies.

Reported by Miro Palmu <email@miropalmu.cc> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00077.html>.

* modules/canonicalize (Depends-on): Add stdlib-h.

3 months agofile-has-acl: port to Linux 6.12 + NFS listxattr
Paul Eggert [Fri, 10 Jan 2025 04:37:13 +0000 (20:37 -0800)]
file-has-acl: port to Linux 6.12 + NFS listxattr

* lib/file-has-acl.c (get_aclinfo): Try the getxattr-related calls
even if [l]listxattr fails with EACCES.  Problem reported by
Pádraig Brady <https://bugs.gnu.org/74692#25>.  Also, treat E2BIG
like EACCES.

3 months agofcntl-h: port better to musl on GNU/Linux
Paul Eggert [Wed, 8 Jan 2025 08:32:23 +0000 (00:32 -0800)]
fcntl-h: port better to musl on GNU/Linux

* lib/fcntl.in.h (O_SEARCH): Redefine to O_RDONLY on musl,
which mistakenly defines it to be O_PATH on GNU/Linux.
Problem reported by Lasse Collin in:
https://bugs.gnu.org/75405

3 months agoservent tests: Fix failure on 32-bit native Windows.
Collin Funk [Mon, 6 Jan 2025 21:56:40 +0000 (13:56 -0800)]
servent tests: Fix failure on 32-bit native Windows.

* tests/test-servent.c (getservbyname, getservbyport)
[_WIN32 && !_WIN64 && !__CYGWIN__]: Disable signature check.
* doc/posix-functions/getservbyname.texi: Document the incompatible
__stdcall function signature.
* doc/posix-functions/getservbyport.texi: Likewise.

3 months agosigsegv tests: Work around a longjmp bug on GNU/Hurd.
Bruno Haible [Mon, 6 Jan 2025 00:16:11 +0000 (01:16 +0100)]
sigsegv tests: Work around a longjmp bug on GNU/Hurd.

* tests/test-sigsegv-catch-stackoverflow1.c (_FORTIFY_SOURCE,
__USE_FORTIFY_LEVEL): Undefine, as a workaround to the Hurd longjmp bug.
* tests/test-sigsegv-catch-stackoverflow2.c (_FORTIFY_SOURCE,
__USE_FORTIFY_LEVEL): Likewise.
* doc/posix-functions/longjmp.texi: Document the Hurd bug.

3 months agoxstrtol, xstrtoll tests: Avoid test failure after 2024-07-25 change.
Bruno Haible [Sun, 5 Jan 2025 17:52:47 +0000 (18:52 +0100)]
xstrtol, xstrtoll tests: Avoid test failure after 2024-07-25 change.

* tests/test-xstrtol.c (main): Update expected test results regarding
Cygwin 2.9.0.

3 months agotests: Don't use module 'getcwd' as dependency.
Bruno Haible [Sun, 5 Jan 2025 12:21:35 +0000 (13:21 +0100)]
tests: Don't use module 'getcwd' as dependency.

* modules/getcwd (Comment): New section.
* modules/xgetcwd (Comment): Likewise.
* modules/xgetcwd-lgpl: New file, based on modules/xgetcwd.
* modules/chown-tests (Depends-on): Add xgetcwd-lgpl. Remove xgetcwd.
* modules/fchownat-tests (Depends-on): Likewise.
* modules/fdutimensat-tests (Depends-on): Likewise.
* modules/futimens-tests (Depends-on): Likewise.
* modules/lchown-tests (Depends-on): Likewise.
* modules/stat-time-tests (Depends-on): Likewise.
* modules/utime-tests (Depends-on): Likewise.
* modules/utimens-tests (Depends-on): Likewise.
* modules/utimensat-tests (Depends-on): Likewise.

4 months agoautoupdate
Paul Eggert [Wed, 1 Jan 2025 22:52:39 +0000 (14:52 -0800)]
autoupdate

4 months agomaint: update copyrights by hand
Paul Eggert [Wed, 1 Jan 2025 19:31:58 +0000 (11:31 -0800)]
maint: update copyrights by hand

This fixes some copyright dates that were not updated
correctly by "make update-copyright".

4 months agomaint: run 'make update-copyright'
Pádraig Brady [Wed, 1 Jan 2025 09:24:36 +0000 (09:24 +0000)]
maint: run 'make update-copyright'

4 months agomaint: update update-copyright for Emacs
Paul Eggert [Wed, 1 Jan 2025 07:46:36 +0000 (23:46 -0800)]
maint: update update-copyright for Emacs

* build-aux/update-copyright: Add support for Emacs, which
uses file names like Changelog.1 that are not man pages,
and file names like emacs.1.in that are man page templates.

4 months agoservent tests: Fix failure due to missing htons declaration.
Collin Funk [Wed, 1 Jan 2025 03:51:26 +0000 (19:51 -0800)]
servent tests: Fix failure due to missing htons declaration.

* modules/servent-tests (Depends-on): Add htonl.
(Makefile.am): Link program to $(HTONL_LIB).
* tests/test-servent.c (main): Fix formatting and typo.

4 months agoservent: Make sure netdb.h is generated.
Collin Funk [Wed, 1 Jan 2025 03:43:28 +0000 (19:43 -0800)]
servent: Make sure netdb.h is generated.

* modules/servent (Depends-on): Add netdb-h.

4 months agogetcwd: Return "/bin" instead of "//bin" on Adélie Linux.
Bruno Haible [Tue, 31 Dec 2024 18:38:42 +0000 (19:38 +0100)]
getcwd: Return "/bin" instead of "//bin" on Adélie Linux.

Reported by Zach van Rijn <me@zv.io> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-04/msg00072.html>
and <https://git.adelielinux.org/adelie/packages/-/issues/987>.

* lib/getcwd.c (__getcwd_generic): Remove a trailing slash from the
result of readlink().

4 months agoservent: Add tests.
Collin Funk [Tue, 31 Dec 2024 03:00:01 +0000 (19:00 -0800)]
servent: Add tests.

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

4 months agombfile: Support pushback characters also right before EOF.
Bruno Haible [Tue, 31 Dec 2024 01:09:47 +0000 (02:09 +0100)]
mbfile: Support pushback characters also right before EOF.

* lib/mbfile.h (mbfile_multi_getc): Read pushed-back character before
testing for sticky EOF.
* tests/test-mbfile.c (main): Test pushback at EOF.

4 months agombfile: Allow 2 pushback characters.
Bruno Haible [Tue, 31 Dec 2024 00:39:03 +0000 (01:39 +0100)]
mbfile: Allow 2 pushback characters.

* lib/mbfile.h: Include <stdlib.h>.
(MBFILE_MAX_PUSHBACK): New macro.
(struct mbfile_multi): Replace field 'have_pushback' with
'pushback_count'. Make field 'pushback' an array.
(mbfile_multi_getc, mbfile_multi_ungetc): Handle multiple pushback
characters.
(mbf_init): Update.

4 months agobcp47: Handle language variants.
Bruno Haible [Tue, 31 Dec 2024 00:07:47 +0000 (01:07 +0100)]
bcp47: Handle language variants.

Reported by Balló György <ballogyor@gmail.com> at
<https://savannah.gnu.org/bugs/?66620>.

* lib/bcp47.c (xpg_to_bcp47, bcp47_to_xpg): Handle variants.
* tests/test-bcp47.c (main): Test a regional variant.

4 months agodoc: Revisit some index entries.
Bruno Haible [Mon, 30 Dec 2024 14:38:51 +0000 (15:38 +0100)]
doc: Revisit some index entries.

* doc/attribute.texi: Refer to the 'attribute' module.
* doc/verify.texi: Refer to the 'verify' module.
* doc/noreturn.texi: Remove duplicate index entries.

4 months agodoc: Document the 'inline' module.
Bruno Haible [Mon, 30 Dec 2024 14:17:42 +0000 (15:17 +0100)]
doc: Document the 'inline' module.

* doc/static-inline.texi: Document the 'inline' module.
* m4/inline.m4: Fix comment.

4 months agosignal: Deprecate old stub module.
Bruno Haible [Mon, 30 Dec 2024 10:16:27 +0000 (11:16 +0100)]
signal: Deprecate old stub module.

* modules/signal: Mark as deprecated.

4 months agoqsort_r: Update documentation.
Bruno Haible [Sun, 29 Dec 2024 22:06:06 +0000 (23:06 +0100)]
qsort_r: Update documentation.

* modules/qsort_r (Description): Say "POSIX signature".
* doc/posix-functions/qsort_r.texi: Mention the qsort_r module.

4 months agogit-version-gen: reinstate executable permission
Pádraig Brady [Sun, 29 Dec 2024 21:39:42 +0000 (21:39 +0000)]
git-version-gen: reinstate executable permission

* build-aux/git-version-gen: chmod a+x

4 months agosig2str: Document a portability problem.
Bruno Haible [Sun, 29 Dec 2024 20:15:16 +0000 (21:15 +0100)]
sig2str: Document a portability problem.

* doc/posix-functions/sig2str.texi: Document IRIX problem.
* doc/posix-functions/str2sig.texi: Likewise.

4 months agodoc: Document the advanced FILE stream functions.
Bruno Haible [Sun, 29 Dec 2024 20:01:27 +0000 (21:01 +0100)]
doc: Document the advanced FILE stream functions.

* doc/stdioext.texi: New file.
* doc/gnulib.texi (Particular Modules): Include it.

4 months agosignal-h tests: Check that SIG2STR_MAX is properly defined.
Collin Funk [Sun, 29 Dec 2024 19:56:28 +0000 (11:56 -0800)]
signal-h tests: Check that SIG2STR_MAX is properly defined.

* modules/signal-h-tests (Depends-on): Add assert-h.
* tests/test-signal-h.c: Check that SIG2STR_MAX is defined to a
positive integer.

4 months agosig2str tests: Add signature check.
Collin Funk [Sun, 29 Dec 2024 19:30:59 +0000 (11:30 -0800)]
sig2str tests: Add signature check.

* modules/sig2str-tests (Files): Add tests/signature.h.
* tests/test-sig2str.c: Include signal.h instead of sig2str.h. Check the
function signature of sig2str and str2sig.

4 months agodoc: Document the modules for containers.
Bruno Haible [Sun, 29 Dec 2024 17:47:11 +0000 (18:47 +0100)]
doc: Document the modules for containers.

* doc/containers.texi: Document the modules for each container data
type.

4 months agodoc: Omit internal modules from the "Undocumented modules" index.
Bruno Haible [Sun, 29 Dec 2024 17:16:27 +0000 (18:16 +0100)]
doc: Omit internal modules from the "Undocumented modules" index.

* doc/internal-modules: New file.
* doc/Makefile (undocumented-modules.texi): Filter out the internal
modules.

4 months agodoc: Add missing module index.
Collin Funk [Sun, 29 Dec 2024 02:11:03 +0000 (18:11 -0800)]
doc: Add missing module index.

Suggested by Bruno Haible in:
<https://lists.gnu.org/archive/html/bug-gnulib/2024-12/msg00240.html>.

* doc/posix-functions/getservbyname.texi (getservbyname): Add module
index.
* doc/posix-functions/getservbyport.texi (getservbyport): Likewise.

4 months agodoc: Fix the previous commit.
Collin Funk [Sun, 29 Dec 2024 01:26:28 +0000 (17:26 -0800)]
doc: Fix the previous commit.

Suggested by Bruno Haible in:
<https://lists.gnu.org/archive/html/bug-gnulib/2024-12/msg00236.html>.

* doc/posix-functions/getservbyname.texi: Mention the Windows
declaration under "Portability problems fixed by Gnulib".
* doc/posix-functions/getservbyport.texi: Likewise.

4 months agodoc: Mention the servent module.
Collin Funk [Sun, 29 Dec 2024 00:19:01 +0000 (16:19 -0800)]
doc: Mention the servent module.

* doc/posix-functions/getservbyname.texi: Document that the servent
module will provide the declarations in netdb.h.
* doc/posix-functions/getservbyport.texi: Likewise.

4 months agogit-version-gen: avoid use of grep, suggested by Jim Meyering.
Simon Josefsson [Sat, 28 Dec 2024 20:19:18 +0000 (21:19 +0100)]
git-version-gen: avoid use of grep, suggested by Jim Meyering.

* build-aux/git-version-gen: Use /bin/sh case instead.

4 months agogit-version-gen: fix preceding change
Simon Josefsson [Sat, 28 Dec 2024 17:57:46 +0000 (18:57 +0100)]
git-version-gen: fix preceding change

* build-aux/git-version-gen: Do use *-git content when keyword
is not present.  Move post-processing later.  Doc fixes.

4 months agodoc: Omit deprecated modules from the "Undocumented modules" index.
Bruno Haible [Sat, 28 Dec 2024 19:16:40 +0000 (20:16 +0100)]
doc: Omit deprecated modules from the "Undocumented modules" index.

* doc/Makefile (undocumented-modules.texi): Filter out the deprecated
modules.

4 months agomaintainer-makefile: Improve gnulib-version derivation.
Simon Josefsson [Sat, 28 Dec 2024 18:46:30 +0000 (19:46 +0100)]
maintainer-makefile: Improve gnulib-version derivation.

* top/maint.mk (gnulib-version): Use git only when possible,
falling back to GNULIB_REVISION or ChangeLog date otherwise.  Use
consistent full identifier.

4 months agoannounce-gen: Support VPATH builds better.
Simon Josefsson [Sat, 28 Dec 2024 18:42:43 +0000 (19:42 +0100)]
announce-gen: Support VPATH builds better.

* build-aux/announce-gen: Pass -C$srcdir to git.

4 months agoendian: Fix link error on CentOS 5.
Bruno Haible [Sat, 28 Dec 2024 17:39:24 +0000 (18:39 +0100)]
endian: Fix link error on CentOS 5.

* m4/endian_h.m4 (gl_ENDIAN_H): Use AC_LINK_IFELSE, not
AC_COMPILE_IFELSE.

4 months agogit-version-gen: fix preceding change
Jim Meyering [Sat, 28 Dec 2024 17:42:21 +0000 (18:42 +0100)]
git-version-gen: fix preceding change

* build-aux/git-version-gen: Use the contents of the -git file
when its first line has the proper form (fixing a reversed test).
Also, reference the file only once, rather than three times.
Also, double quote $tarball_version_file in preexisting code.

4 months agogit-version-gen: fix preceding change
Jim Meyering [Sat, 28 Dec 2024 17:35:08 +0000 (09:35 -0800)]
git-version-gen: fix preceding change

* build-aux/git-version-gen: Use the contents of the -git file
when its first line has the proper form (fixing a reversed test).
Also, reference the file only once, rather than three times.
Also, double quote $tarball_version_file in preexisting code.

4 months agofile-has-acl: Fix compilation error on CentOS 6 (regression 2024-09-29).
Bruno Haible [Sat, 28 Dec 2024 17:26:39 +0000 (18:26 +0100)]
file-has-acl: Fix compilation error on CentOS 6 (regression 2024-09-29).

* lib/file-has-acl.c (XATTR_NAME_SMACK, XATTR_NAME_SELINUX): Add
fallback definitions.

4 months agoassert-h, verify: Make static_assert work in C++ mode on FreeBSD 11.
Bruno Haible [Sat, 28 Dec 2024 16:40:44 +0000 (17:40 +0100)]
assert-h, verify: Make static_assert work in C++ mode on FreeBSD 11.

* lib/verify.h (static_assert): Override when using old versions of
clang++.

4 months agoendian: Fix compilation error on NetBSD 7.1.
Bruno Haible [Sat, 28 Dec 2024 15:47:16 +0000 (16:47 +0100)]
endian: Fix compilation error on NetBSD 7.1.

* m4/endian_h.m4 (gl_ENDIAN_H): Test for <sys/endian.h>. Set
HAVE_SYS_ENDIAN_H.
* lib/endian.in.h: Test HAVE_SYS_ENDIAN_H as an alternative to
HAVE_ENDIAN_H.
* modules/endian (Makefile.am): Substitute HAVE_SYS_ENDIAN_H.

4 months agowchar-h: Fix wcrtomb prototype conflict in C++ mode on OpenBSD 6.0.
Bruno Haible [Sat, 28 Dec 2024 15:38:23 +0000 (16:38 +0100)]
wchar-h: Fix wcrtomb prototype conflict in C++ mode on OpenBSD 6.0.

* lib/wchar.in.h (rpl_mbstate_t): Don't define on OpenBSD.

4 months agostack-trace: Fix compilation errors on older BSD systems.
Bruno Haible [Sat, 28 Dec 2024 12:03:52 +0000 (13:03 +0100)]
stack-trace: Fix compilation errors on older BSD systems.

* m4/stack-trace.m4 (gl_STACK_TRACE_EARLY): Test whether we can link
with libexecinfo before modifying LIBS.

4 months agoRename module stdbool-h to bool.
Bruno Haible [Sat, 28 Dec 2024 05:08:15 +0000 (06:08 +0100)]
Rename module stdbool-h to bool.

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-12/msg00193.html>.

* modules/bool: Renamed from modules/stdbool-h.
* modules/bool-tests: Renamed from modules/stdbool-h-tests.
* modules/bool-c++-tests: Renamed from modules/stdbool-h-c++-tests.
* tests/test-bool.c: Renamed from tests/test-stdbool-h.c.
* tests/test-bool-c++.cc: Renamed from tests/test-stdbool-h-c++.cc.
* tests/test-bool-c++2.cc: Renamed from tests/test-stdbool-h-c++2.cc.
* modules/stdbool-h-c99-tests: Update.
* modules/stdbool-h-c99-c++-tests: Update.
* tests/test-stdbool-h-c99.c: Update.
* tests/test-stdbool-h-c99-c++.cc: Update.
* doc/posix-headers/stdbool.texi: Update.
* doc/gnulib-readme.texi: Update.
* doc/gnulib.texi: Update.
* modules/* (Depends-on): Update.
* modules/stdbool: Update.

4 months agoRename module wchar to wchar-h.
Bruno Haible [Fri, 27 Dec 2024 22:43:27 +0000 (23:43 +0100)]
Rename module wchar to wchar-h.

* modules/wchar-h: Renamed from modules/wchar.
* modules/wchar-h-tests: Renamed from modules/wchar-tests.
* modules/wchar-h-c++-tests: Renamed from modules/wchar-c++-tests.
* tests/test-wchar-h.c: Renamed from tests/test-wchar.c.
* tests/test-wchar-h-c++.cc: Renamed from tests/test-wchar-c++.cc.
* tests/test-wchar-h-c++2.cc: Renamed from tests/test-wchar-c++2.cc.
* tests/test-wchar-h-c++3.cc: Renamed from tests/test-wchar-c++3.cc.
* doc/posix-headers/wchar.texi: Update.
* modules/* (Depends-on): Update.
* modules/wchar: New file.

4 months agoRename module utmp to utmp-h.
Bruno Haible [Fri, 27 Dec 2024 22:43:25 +0000 (23:43 +0100)]
Rename module utmp to utmp-h.

* modules/utmp-h: Renamed from modules/utmp.
* modules/utmp-h-tests: Renamed from modules/utmp-tests.
* modules/utmp-h-c++-tests: Renamed from modules/utmp-c++-tests.
* tests/test-utmp-h.c: Renamed from tests/test-utmp.c.
* tests/test-utmp-h-c++.cc: Renamed from tests/test-utmp-c++.cc.
* doc/posix-headers/utmp.texi: Update.
* modules/* (Depends-on): Update.
* modules/utmp: New file.

4 months agoRename module unitypes to unitypes-h.
Bruno Haible [Fri, 27 Dec 2024 22:43:23 +0000 (23:43 +0100)]
Rename module unitypes to unitypes-h.

* modules/unitypes-h: Renamed from modules/unitypes.
* doc/libunistring.texi: Update.
* modules/* (Depends-on): Update.
* modules/unitypes: New file.

4 months agoRename module unistd to unistd-h.
Bruno Haible [Fri, 27 Dec 2024 22:41:53 +0000 (23:41 +0100)]
Rename module unistd to unistd-h.

* modules/unistd-h: Renamed from modules/unistd.
* modules/unistd-h-tests: Renamed from modules/unistd-tests.
* modules/unistd-h-c++-tests: Renamed from modules/unistd-c++-tests.
* tests/test-unistd-h.c: Renamed from tests/test-unistd.c.
* tests/test-unistd-h-c++.cc: Renamed from tests/test-unistd-c++.cc.
* doc/posix-headers/unistd.texi: Update.
* doc/posix-functions/_exit.texi: Update.
* modules/* (Depends-on): Update.
* modules/unistd: New file.

4 months agoRename module uchar-c23 to uchar-h-c23.
Bruno Haible [Fri, 27 Dec 2024 22:41:52 +0000 (23:41 +0100)]
Rename module uchar-c23 to uchar-h-c23.

* modules/uchar-h-c23: Renamed from modules/uchar-c23.
* lib/uchar.in.h: Update.
* doc/posix-headers/uchar.texi: Update.
* doc/posix-functions/mbrtoc32.texi: Update.
* doc/strings.texi: Update.
* modules/* (Depends-on): Update.
* modules/uchar-c23: New file.

4 months agoRename module uchar to uchar-h.
Bruno Haible [Fri, 27 Dec 2024 22:41:50 +0000 (23:41 +0100)]
Rename module uchar to uchar-h.

* modules/uchar-h: Renamed from modules/uchar.
* modules/uchar-h-tests: Renamed from modules/uchar-tests.
* modules/uchar-h-c++-tests: Renamed from modules/uchar-c++-tests.
* tests/test-uchar-h.c: Renamed from tests/test-uchar.c.
* tests/test-uchar-h-c++.cc: Renamed from tests/test-uchar-c++.cc.
* tests/test-uchar-h-c++2.cc: Renamed from tests/test-uchar-c++2.cc.
* doc/posix-headers/uchar.texi: Update.
* modules/* (Depends-on): Update.
* modules/uchar: New file.

4 months agoRename module termios to termios-h.
Bruno Haible [Fri, 27 Dec 2024 22:41:47 +0000 (23:41 +0100)]
Rename module termios to termios-h.

* modules/termios-h: Renamed from modules/termios.
* modules/termios-h-tests: Renamed from modules/termios-tests.
* modules/termios-h-c++-tests: Renamed from modules/termios-c++-tests.
* tests/test-termios-h.c: Renamed from tests/test-termios.c.
* tests/test-termios-h-c++.cc: Renamed from tests/test-termios-c++.cc.
* doc/posix-headers/termios.texi: Update.
* modules/* (Depends-on): Update.
* modules/termios: New file.

4 months agoRename module sys_wait to sys_wait-h.
Bruno Haible [Fri, 27 Dec 2024 22:41:45 +0000 (23:41 +0100)]
Rename module sys_wait to sys_wait-h.

* modules/sys_wait-h: Renamed from modules/sys_wait.
* modules/sys_wait-h-tests: Renamed from modules/sys_wait-tests.
* modules/sys_wait-h-c++-tests: Renamed from modules/sys_wait-c++-tests.
* tests/test-sys_wait-h.h: Renamed from tests/test-sys_wait.h.
* tests/test-sys_wait-h.c: Renamed from tests/test-sys_wait.c.
* tests/test-stdlib-h.c: Update.
* tests/test-sys_wait-h-c++.cc: Renamed from tests/test-sys_wait-c++.cc.
* doc/posix-headers/sys_wait.texi: Update.
* modules/* (Depends-on): Update.
* modules/sys_wait: New file.

4 months agoRename module sys_utsname to sys_utsname-h.
Bruno Haible [Fri, 27 Dec 2024 22:41:43 +0000 (23:41 +0100)]
Rename module sys_utsname to sys_utsname-h.

* modules/sys_utsname-h: Renamed from modules/sys_utsname.
* modules/sys_utsname-h-tests: Renamed from modules/sys_utsname-tests.
* modules/sys_utsname-h-c++-tests: Renamed from
modules/sys_utsname-c++-tests.
* tests/test-sys_utsname-h.c: Renamed from tests/test-sys_utsname.c.
* tests/test-sys_utsname-h-c++.cc: Renamed from
tests/test-sys_utsname-c++.cc.
* doc/posix-headers/sys_utsname.texi: Update.
* modules/* (Depends-on): Update.
* modules/sys_utsname: New file.

4 months agoRename module sys_un to sys_un-h.
Bruno Haible [Fri, 27 Dec 2024 22:41:42 +0000 (23:41 +0100)]
Rename module sys_un to sys_un-h.

* modules/sys_un-h: Renamed from modules/sys_un.
* modules/sys_un-h-tests: Renamed from modules/sys_un-tests.
* modules/sys_un-h-c++-tests: Renamed from modules/sys_un-c++-tests.
* tests/test-sys_un-h.c: Renamed from tests/test-sys_un.c.
* tests/test-sys_un-h-c++.cc: Renamed from tests/test-sys_un-c++.cc.
* doc/posix-headers/sys_un.texi: Update.
* modules/sys_un: New file.

4 months agoRename module sys_uio to sys_uio-h.
Bruno Haible [Fri, 27 Dec 2024 22:41:41 +0000 (23:41 +0100)]
Rename module sys_uio to sys_uio-h.

* modules/sys_uio-h: Renamed from modules/sys_uio.
* modules/sys_uio-h-tests: Renamed from modules/sys_uio-tests.
* modules/sys_uio-h-c++-tests: Renamed from modules/sys_uio-c++-tests.
* tests/test-sys_uio-h.c: Renamed from tests/test-sys_uio.c.
* tests/test-sys_uio-h-c++.cc: Renamed from tests/test-sys_uio-c++.cc.
* doc/posix-headers/sys_uio.texi: Update.
* modules/* (Depends-on): Update.
* modules/sys_uio: New file.

4 months agoRename module sys_types to sys_types-h.
Bruno Haible [Fri, 27 Dec 2024 22:41:40 +0000 (23:41 +0100)]
Rename module sys_types to sys_types-h.

* modules/sys_types-h: Renamed from modules/sys_types.
* modules/sys_types-h-tests: Renamed from modules/sys_types-tests.
* modules/sys_types-h-c++-tests: Renamed from
modules/sys_types-c++-tests.
* tests/test-sys_types-h.c: Renamed from tests/test-sys_types.c.
* tests/test-sys_types-h-c++.cc: Renamed from
tests/test-sys_types-c++.cc.
* doc/posix-headers/sys_types.texi: Update.
* modules/* (Depends-on): Update.
* modules/sys_types: New file.