> Then I need the other /proc/* files as well, not just /proc/sys/*
IMHO whole /proc should be mirrored by sysctl. Then, we can in 2.7 slowly move
those only to /proc/sys. Ideally, only /proc/[pid]/ and /proc/sys/ should be
present in /proc/.
> It seems to me that the sysctl interface does not have any type checking,
> so if for example I want to read the jiffies counter and supply a 32-bit
> field, sysctl will happily give me the first/last 32 bits of a field that
> could as well be 64 bits (bit widths do sometimes change, even on architectures
> that do not change). How am I to know ?
From the sysctl() manpage:
size_t *oldlenp; /* available room for old value,
overwritten by actual size of old value */
So, it will happily give you first/last 32 bits (at least something and your
application won't crash UNhappily ;), however it will write to location pointed
by oldlenp that jiffies are 64 bits.
> This could be tightened up of course - but the problem of knowing which
> unit some number may be represented in is still there. For example,
> assuming I could read out partition sizes, well are they in blocks, bytes,
> kilobytes, or what ? Oh, I'm supposed to *know*, and *assume* such things
> never change ?
Obviously they shouldn't. Any reason to change them? If you decide it would
be nice to give you also size in something different from blocks, you can just
introduce new ctl with suffix e.g. kb or so.
--Petr "Pasky" Baudis
UN*X programmer, UN*X administrator, hobbies = IPv6, IRC Real Users hate Real Programmers. Public PGP key, geekcode and stuff: http://pasky.ji.cz/~pasky/ - 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/