In article <1143484821.2168.16.camel@leatherman> you wrote:It seems that what you are really looking for in your application is a monotonic clock. Linux has such thing since few releases. Using CLOCK_MONOTONIC (cf "man 3 clock_gettime") may look much less hacky than using the uptime ;-)Would it be possible to get the old behaviour back?
Why exactly do you want this behavior? Maybe a better explanation would
help stir this discussion.
I don't know why he wants it (uptime does not increase during
hibernation) but I want it so that I can tell if I should time out or
not on an alarm for inactivity in userspace! The alarm should fire if
there has been no activity for a while (30s) while activity is possible.
If the machine is suspended, no activity is possible, so the alarm
should not fire.
This is to counteract sysadamins playing with system time (e.g. syncing
with a net time server after bootup) which might cause artificial time
outs. Causing a timeout has nasty consequences when, for example, your
root fs is mounted over the net via daemons that do the network to-ing
and fro-ing from userspace. The only way they have of getting an
estimate of REAL time elapsed, without admin playing about messing
with them, is by surreptitiously snooping uptime, which more or less
represents kernel jiffies.