[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: boot time on Linux
From: |
Bruno Haible |
Subject: |
Re: boot time on Linux |
Date: |
Thu, 10 Aug 2023 12:30:26 +0200 |
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
> >
> > Note that this uses the kernel's uptime counter, so it will not work well
> > when the user changes the current time manually. But this is rare on
> > Android.
It works well enough, that I'm adding it to Gnulib, through the attached patch.
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)
How did you run the program, and which of the two calls (clock_gettime, sysinfo)
failed for you? Maybe it depends not only on the Android version and device,
but also on the permissions required by the app?
Bruno
0001-readutmp-Return-a-boot-time-also-on-Android.patch
Description: Text Data
- Re: boot time on Linux, Paul Eggert, 2023/08/09
- Re: boot time on Linux, Bruno Haible, 2023/08/09
- Re: boot time on Linux, Po Lu, 2023/08/09
- Re: boot time on Linux, Bruno Haible, 2023/08/09
- Re: boot time on Linux,
Bruno Haible <=
- Re: boot time on Linux, Po Lu, 2023/08/10
- Re: boot time on Linux, Bruno Haible, 2023/08/10
- Re: boot time on Linux, Po Lu, 2023/08/10
- Re: boot time on Linux, Bruno Haible, 2023/08/10
- Re: boot time on Linux, Po Lu, 2023/08/11
Re: boot time on Linux, Natanael Copa, 2023/08/10