btime in /proc/stat

Rob Kaper (cap@capsi.cx)
Wed, 24 Mar 1999 14:44:19 +0100


Last year I started programming on a utility that requires a unique boot id
to avoid that multiple instances running put multiple entries in a datafile
for one boot/uptime session.

At first I looked at the btime entry from /proc/stat but later discovered
it's unreliable. It's not a static boottime, but currentdate-uptime, which
thus might change after using clock, netdate, date -s, etc.

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Does the kernel create any entry that is unique to the current boot session?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
At the moment I use a work-around by creating an ID in rc.S and then using
it when starting the program in rc.local, but I would prefer to use an ID
provided by the kernel.

Regards, Rob

-- 
Rob Kaper | mail: cap@capsi.com + cap@capsi.net + cap@capsi.cx
          | web: http://capsi.com/ + http://capsi.cx/ - icq: 707085
          | "Got up early (as in before noon). A most confusing experience
          |  when the sun is coming up not going down." -- Alan Cox

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/