On 2023-08-12 20:26, Po Lu wrote:
In file included from boot-time.c:54:0:
boot-time-aux.h: In function 'get_linux_uptime':
boot-time-aux.h:70:3: error: implicit declaration of function 'sysinfo'
[-Werror=implicit-function-declaration]
if (sysinfo (&info) >= 0)
^
boot-time.c: In function
Paul Eggert writes:
> On 2023-08-11 14:49, Bruno Haible wrote:
>> Paul: With this simplification, you may consider using the 'boot-time' module
>> in Emacs. I bet that it produces a better result than Emacs' src/filelock.c
>> on many platforms. (I haven't tested it, but I could test it if you giv
On 2023-08-11 14:49, Bruno Haible wrote:
Paul: With this simplification, you may consider using the 'boot-time' module
in Emacs. I bet that it produces a better result than Emacs' src/filelock.c
on many platforms. (I haven't tested it, but I could test it if you give me
a manual testing recipe.)
Thanks for catching that. Emacs would likely prefer not having to depend
on c-strtod so I installed the attached further patch.From 5528e726e9cc1ff9a2c7a71100450c52b65e9e7f Mon Sep 17 00:00:00 2001
From: Paul Eggert
Date: Sat, 12 Aug 2023 16:54:51 -0700
Subject: [PATCH] boot-time,readutmp: do not
This code uses clock-relevant functions only on platforms
that do not need -lrt.
* m4/readutmp.m4 (gl_READUTMP): Do not require gl_CLOCK_TIME
or add CLOCK_TIME_LIB to READUTMP_LIB.
* modules/boot-time (Link): No need to link with CLOCK_TIME_LIB.
---
ChangeLog | 7 +++
m4/readutmp.m4
These modules should work well enough even if fopen is not fixed
to conform to fopen-gnu standards. The only gotcha I can see is
older fopen implementations that lack support for "e", and
a potential O_CLOEXEC leak is not worth worrying about.
* modules/boot-time (Depends-on):
* modules/readutmp (
boot-time code no longer needs it.
* modules/readutmp (Depends-on): Remove timespec_get.
---
ChangeLog| 4
modules/readutmp | 1 -
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 03120ec167..c1a8c8e37c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@
This is for Emacs, which does not use timespec_get now
and which likes to minimize dependencies.
Also, treat musl libc like recent glibc,
and fix a timespec_get return value typo.
* lib/boot-time-aux.h (get_linux_uptime):
Assume musl libc supports CLOCK_BOOTTIME.
(get_linux_boot_time_final_fallback
/proc/uptime contains a floating-point number with '.' as decimal separator.
It thus needs to be parsed with 'c_strtod', not 'strtod' (which expects a ','
on French and German locales).
2023-08-12 Bruno Haible
readutmp, boot-time: Fix parsing of /proc/uptime.
* lib/boot-time-a
Originally I wrote the readutmp.c code in such a way that, on Linux, we use the
fallback code for the boot time only if --enable-systemd is specified.
But the same fallback code is also useful on older systems or without systemd,
namely for processes which run in partial isolation from the file sy
With these two patches, read_utmp() and get_boot_time() succeed on Haiku.
Haiku has a get_system_info() call that is supposed to return the boot time.
But, like the sysctl on *BSD platforms, its value changes after the VM has
been put to sleep and resumed (and the date has changed, which happens
a
* lib/c-file-type.c: New file, containing all of the
old file-type except for the gettext call.
* lib/file-type.c (_): Remove; no longer used.
(file_type): Call c_file_type for most of the work.
* modules/c-file-type: New module.
* modules/file-type (Depends-on): Add c-file-type.
---
ChangeLog
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 to sleep and then resumed.
Similarly, it is
13 matches
Mail list logo