[6577] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: How can Emacs get a unique ID per Linux reboot?

daemon@ATHENA.MIT.EDU (Ph. Marek)
Tue Jun 1 02:26:04 1999

Date: 	Tue, 01 Jun 1999 08:30:06 +0200
To: "H. Peter Anvin" <hpa@transmeta.com>, linux-scsi@vger.rutgers.edu
From: "Ph. Marek" <marek@bmlv.gv.at>
In-Reply-To: <37536BD4.E97E0724@transmeta.com>

>Richard Gooch wrote:
>> 
>> H. Peter Anvin writes:
>> > Richard Gooch wrote:
>> > >
>> > > H. Peter Anvin writes:
>> > > > Get the current uptime from /proc/uptime and subtract that from the
>> > > > current time.
>> > >
>> > > Won't that foul up if the system is suspended (system clock is
>> > > restored from hwclock on resume)?
>> > > And probably also when settimeofday() is called?
>> >
>> > No, and yes, respectively.
>> 
>> ??? AFAIK, /proc/uptime stops ticking over when the system is
>> suspended. However, since the current time is "restored" after a
>> resume, the two values will not track. The computed "boot time" will
>> drift forward by as many seconds as the system was suspended.
>> Is this not correct?
>> 
>
>If so, then that's a bug in /proc/uptime IMNSHO.
I posted a patch some time ago that tracked the "suspended time" too and
return it in another field in /proc/uptime. BTW, it set the date/time of
/proc/uptime to the last reboot.

Won't work if you change date/time, too.


What you want is a reboot counter, which could be easily made. eg.
/etc/reboots 





-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post