linux-origin
[Top] [All Lists]

Re: unsigned long jiffies

To: John Hawkes <hawkes@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: unsigned long jiffies
From: Ralf Baechle <ralf@xxxxxxxxxxx>
Date: Tue, 23 May 2000 00:37:06 +0200
Cc: linux-origin <linux-origin@xxxxxxxxxxx>
In-reply-to: <059901bfc43b$866bf5c0$1d70eea9@seattle.sgi.com>; from hawkes@cthulhu.engr.sgi.com on Mon, May 22, 2000 at 03:17:31PM -0700
References: <059901bfc43b$866bf5c0$1d70eea9@seattle.sgi.com>
Sender: owner-linux-origin@xxxxxxxxxxx
On Mon, May 22, 2000 at 03:17:31PM -0700, John Hawkes wrote:

> Is there a reason, other than historical, why "jiffies" is "unsigned
> long"?  Isn't that a 64-bit type in a 64-bit kernel?

At HZ = 100Hz a 32-bit variable would overflow after about 457 days.  In
real live this has been an actual problem :-)  Some people run their
systems at HZ 1024Hz or even 10kHz.

> A more general question: I have an application that gets information
> from the kernel through a read of a /proc node, formatted via a struct
> that has fields that are typed in ways that change in size, depending
> upon whether it's dealing with a 32-bit kernel or a 64-bit kernel.  I'd
> like to be able to have this 32-bit app work with a 64-bit kernel.  Is
> there a general protocol to support this?

About which proc-file are we talking?  In general you should probably
just design the file's format such that it can be parsed unambiguously;
generally there ASCII files are somewhat preffered.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>