bug#64937: boot time on Linux

2023-08-10 Thread Bruno Haible
Natanael Copa wrote: > There are machines without RTC (Raspberry PI for example), and in > this case the time stamp may end up to be the same every reboot (if > correctly set up it should save the shutdown time for the reboot and set > time to this on next boot, but there is no guarantee). Indeed,

bug#64937: boot time on Linux

2023-08-10 Thread Bruno Haible
Po Lu wrote: > >> Both clock_gettime (CLOCK_BOOTIME, ... sysinfo fail with AVC denial > >> errors and errno set to EACCESS. > > > > Was this inside Termux, or inside the Emacs app? > > Inside the Emacs app. Emacs does not have the following in AndroidManifest.xml, which Termux has: May

bug#64937: boot time on Linux

2023-08-10 Thread Natanael Copa
Hi, I had a quick look at the thread, and I have a few comments. 1) it is openrc's bootmisc ( https://github.com/OpenRC/openrc/blob/86efc43d0e0d7569f5d2e7a58b8c461ac9f7dae8/init.d/bootmisc.in#L197) that creates /var/run/utmp. There is no guarantee that this exists. You can for example run emacs in

bug#64937: boot time on Linux

2023-08-10 Thread Po Lu via GNU coreutils Bug Reports
Bruno Haible writes: > Po Lu wrote: >> Both clock_gettime (CLOCK_BOOTIME, ... sysinfo fail with AVC denial >> errors and errno set to EACCESS. > > Was this inside Termux, or inside the Emacs app? Inside the Emacs app. I'll try Termux soon: maybe the target SDK version is the culprit.

bug#64937: "who" reports funny dates

2023-08-10 Thread Thorsten Kukuk via GNU coreutils Bug Reports
On Thu, Aug 10, Bruno Haible wrote: > This is merely a warning, and it's already gone after today's refactorings > in Gnulib. To get past it, either remove '-Werror' from the Makefile, or > bootstrap against the current Gnulib: Thanks, I know how to get past it, else I couldn't have tested the re

bug#64937: "who" reports funny dates

2023-08-10 Thread Bruno Haible
Thorsten Kukuk wrote: > Not sure how relevant this code still is, but currently I get with this: > > lib/readutmp.c: In function 'get_boot_time_uncached': > lib/readutmp.c:326:35: error: declaration of 'up' shadows a previous local > [-Werror=shadow] > 326 | struct timespec up

bug#64937: boot time on Linux

2023-08-10 Thread Bruno Haible
Po Lu wrote: > Both clock_gettime (CLOCK_BOOTIME, ... sysinfo fail with AVC denial > errors and errno set to EACCESS. Was this inside Termux, or inside the Emacs app? Bruno

bug#64937: boot time on Linux

2023-08-10 Thread Po Lu via GNU coreutils Bug Reports
Bruno Haible writes: > I wrote: >> > No, it isn't. The attached file, when compiled and run under Termux (which >> > doesn't have particular permissions), prints e.g.: >> > >> > from clock : 1691616762.476870660 = 2023-08-09 21:32:42.476870660 >> > from sysinfo: 1691616762.329261637 = 2023-08-09

bug#64937: "who" reports funny dates

2023-08-10 Thread Thorsten Kukuk via GNU coreutils Bug Reports
Hi, currently testing current coreutils git checkout on a utmp/wtmp free machine, looks good so far. Except there is a compile problem with this patch: On Tue, Aug 08, Bruno Haible wrote: > 2023-08-08 Bruno Haible > > readutmp: Get the boot time with higher precision. > Suggest

bug#64937: boot time on Linux

2023-08-10 Thread Bruno Haible
I wrote: > > No, it isn't. The attached file, when compiled and run under Termux (which > > doesn't have particular permissions), prints e.g.: > > > > from clock : 1691616762.476870660 = 2023-08-09 21:32:42.476870660 > > from sysinfo: 1691616762.329261637 = 2023-08-09 21:32:42.329261637 > > > > No

bug#64937: boot time on Linux

2023-08-10 Thread Natanael Copa
On Thu, 10 Aug 2023 17:38:10 +0800 Po Lu wrote: > Natanael Copa writes: > > > 2) Even if it does exist, there is no guarantee that the timestamp is > > correct. There are machines without RTC (Raspberry PI for example), > > and in this case the time stamp may end up to be the same every reboot

bug#64937: boot time on Linux

2023-08-10 Thread Po Lu via GNU coreutils Bug Reports
Natanael Copa writes: > 2) Even if it does exist, there is no guarantee that the timestamp is > correct. There are machines without RTC (Raspberry PI for example), > and in this case the time stamp may end up to be the same every reboot > (if correctly set up it should save the shutdown time for

bug#64937: boot time on Linux

2023-08-10 Thread Po Lu via GNU coreutils Bug Reports
Paul Eggert writes: > On 2023-08-09 19:14, Po Lu wrote: >> This uses the uptime counter (which also results in an SELinux denial >> for me, but different Android distributions have SELinux policies of >> varying strictness), which cannot establish the precise time the system >> started > > Emacs