Re: PROPOSAL: dot-proc interface [was: /proc stuff]

From: Jakob Østergaard (jakob@unthought.net)
Date: Sun Nov 11 2001 - 14:43:05 EST


On Sun, Nov 11, 2001 at 12:06:00PM +0200, Kai Henningsen wrote:
> jakob@unthought.net (Jakob ¥stergaard) wrote on 04.11.01 in <20011104211118.U14001@unthought.net>:
...
> >
> > A regex won't tell me if 345987 is a signed or unsigned 32-bit or 64-bit
> > integer, or if it's a double.
>
> You do not *need* that information at runtime. If you think you do, you're
> doing something badly wrong.

I would prefer to have the information at compile-time, so that I would get
a compiler error if I did something wrong.

But that's unrealistic - some counter could change it's type from kernel
release to kernel release.

Now, my program needs to deal with the data, perform operations on it,
so naturally I need to know what kind of data I'm dealing with. Most likely,
my software will *expect* some certain type, but if I have no way of verifying
that my assumption is correct, I will lose sooner or later...

>
> I cannot even imagine what program would want that information.

Uh. Any program using /proc data ?

>
> > Sure, implement arbitrary precision arithmetic in every single app out there
> > using /proc....
>
> Bullshit. Implement whatever arithmetic is right *for your problem*. And
> notice when the value you get doesn't fit so you can tell the user he
> needs a newer version. That's all.
>
> There's no reason whatsoever to care what data type the kernel used.

So my program runs for two months and then aborts with an error because
some counter just happened to no longer fit into whatever type I assumed
it was ?

Come on - you just can't code like that...

-- 
................................................................
:   jakob@unthought.net   : And I see the elder races,         :
:.........................: putrid forms of man                :
:   Jakob Østergaard      : See him rise and claim the earth,  :
:        OZ9ABN           : his downfall is at hand.           :
:.........................:............{Konkhra}...............:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Nov 15 2001 - 21:00:26 EST