Re: boot-time: straighten code

2023-08-13 Thread Corwin Brust
On Sun, Aug 13, 2023 at 8:07 PM Po Lu wrote: > > Bruno Haible writes: > > > Po Lu wrote: > >> Both of your patches appear to work. > > > > Thanks for the confirmation. As you know, I'm using a Termux environment > > Regular merges from Gnulib into Emacs should facilitate that, since I've > set as

Re: boot-time: straighten code

2023-08-13 Thread Po Lu
Bruno Haible writes: > Po Lu wrote: >> Both of your patches appear to work. > > Thanks for the confirmation. As you know, I'm using a Termux environment > for testing on Android. This has only approximately, not exactly, the same > include files and libc as what you are using when you compile wit

stdint: Fix configure test result with gcc 4.7 or 4.8

2023-08-13 Thread Bruno Haible
On GNU/kFreeBSD 7 (32-bit), which uses gcc 4.7.2, a current coreutils snapshot fails to build, with this error: CC lib/libcoreutils_a-xmalloc.o In file included from /usr/include/sys/kern/types.h:71:0, from /usr/include/sys/kern/param.h:67, from /usr/inclu

Fix some test module descriptions

2023-08-13 Thread Bruno Haible
This command shows that there are some unit tests that #include "macros.h", but the file tests/macros.h is missing from the module description. for m in $(./gnulib-tool --find $(fgrep -rl 'include "macros.h"' tests) | LC_ALL=C sort -u); do if grep '^tests/macros\.h$' modules/$m >/dev/null; then

Re: boot-time: straighten code

2023-08-13 Thread Bruno Haible
Po Lu wrote: > Both of your patches appear to work. Thanks for the confirmation. As you know, I'm using a Termux environment for testing on Android. This has only approximately, not exactly, the same include files and libc as what you are using when you compile with some Android NDK. Therefore I'm

Re: boot-time: straighten code

2023-08-13 Thread Po Lu
Bruno Haible writes: > Po Lu wrote: >> During the automated build of the Android port, the following errors >> were encountered with the Android NDK r10b and __ANDROID_API__ set to 8 >> (which is the oldest configuration Emacs supports.) >> ... >> boot-time.c: In function 'get_boot_time_uncached'

nproc, physmem: Use sysctl() as a fallback on GNU/kFreeBSD

2023-08-13 Thread Bruno Haible
There was no need to disable the use of sysctl() on GNU/kFreeBSD on 2020-02-02, since the glibc change re was only regarding Linux [1]. Fortunately that change was not a regression, since sysconf() apparently produces the same values as sysctl(); nevertheless, it's useful to have a fallback (for

physmem: Add tests

2023-08-13 Thread Bruno Haible
I'd like to see the results of the 'physmem' module. This is not easily possible through coreutils, nor is it convenient to compile a file manually with -DDEBUG. A unit test is a more automatic way to check the API's results. 2023-08-13 Bruno Haible physmem: Add tests. * tests

Re: readutmp, boot-time: Use the BSD sysctl as fallback

2023-08-13 Thread Bruno Haible
Pádraig Brady wrote: > I notice coreutils CI now failing with: > >In file included from lib/readutmp.c:47: >/usr/include/x86_64-linux-gnu/sys/sysctl.h:21:2: error: >#warning "The header is deprecated and will be removed." > [-Werror=cpp] > 21 | #warning "The header is deprecated

[PATCH 2/2] fts: improve memory-allocation errno handling

2023-08-13 Thread Paul Eggert
* lib/fts.c (fts_read, fts_build): When enter_dir or setup_dir fails, report its errno value back to the user. (internal_function): Preserve errno. * modules/fts (Depends-on): Add calloc-posix, free-posix, malloc-posix, and realloc-posix, for better errno handling on allocation failures. --- Chang

[PATCH 1/2] hash: set errno on failure

2023-08-13 Thread Paul Eggert
* lib/hash.c: Include errno.h. (compute_bucket_size, hash_initialize, hash_rehash) (hash_insert_if_absent): Set errno reliably on failure. (hash_free): Preserve errno, like plain 'free'. * modules/hash (Depends-on): Depend on calloc-posix, free-posix, malloc-posix, so that errno is set reliably. --

Re: boot-time: straighten code

2023-08-13 Thread Bruno Haible
Po Lu wrote: > During the automated build of the Android port, the following errors > were encountered with the Android NDK r10b and __ANDROID_API__ set to 8 > (which is the oldest configuration Emacs supports.) > ... > boot-time.c: In function 'get_boot_time_uncached': > boot-time.c:111:26: error:

Re: boot-time: straighten code

2023-08-13 Thread Bruno Haible
Po Lu wrote: > During the automated build of the Android port, the following errors > were encountered with the Android NDK r10b and __ANDROID_API__ set to 8 > (which is the oldest configuration Emacs supports.)... > > In file included from boot-time.c:54:0: > boot-time-aux.h: In function 'get_lin

Re: boot-time: straighten code

2023-08-13 Thread Bruno Haible
Po Lu wrote: > During the automated build of the Android port, the following errors > were encountered with the Android NDK r10b and __ANDROID_API__ set to 8 > (which is the oldest configuration Emacs supports.) > ... > boot-time.c:111:26: note: each undeclared identifier is reported only once > f

Re: readutmp, boot-time: Use the BSD sysctl as fallback

2023-08-13 Thread Pádraig Brady
On 12/08/2023 14:22, Bruno Haible wrote: The best approaches to get the boot time access some files. For the case of programs that execute in Docker containers on Linux, we have the fallback that relies on the kernel's uptime counter — although it produces wrong values in a VM that has been put t