OT: Linux uptime can't be more than 496 days!

Sebastian Edman sebastian at egf.net
Wed Oct 31 02:52:53 PST 2001


Disregard my previous post, long produces a float precision variable not an 
integer. Sorry.

/seb

At 11:41 2001-10-31, I wrote:
>At 21:57 2001-10-30, you wrote:
>Hello,
>
>http://www.kerneltrap.com/article.php?sid=354&mode=thread&order=0
>
>When I pull out my calculator I get nothing that makes sense about this.
>An extract from the page above...
>--- snip ---
>struct sysinfo { long uptime; /* Seconds since boot */
>--- snip ---
>A long is 4 bytes right? that makes 2^32-1 seconds unsigned and (2^32)/2
>seconds signed. Which is 4,294,967,295 (unsigned) and 2,147,483,648
>(signed).
>Calculating this to days would mean
>2.1 billion /60 /60 /24 = 24,855 days.
>hmm, 496? where does that number come from?
>And, since this number is signed (as defined above) it would wrap around 
>to a negative value...
>Well to tell you the truth, I'm a bit lost here. Where does my logic fail?
>
>/sebastian
>
>--
>Unsubscribe: send email to listar at linuxfromscratch.org
>and put 'unsubscribe lfs-support' in the subject header of the message

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message



More information about the lfs-support mailing list