Re: /proc/cpuinfo verbiage differ unnecessarily between ports...

Pauline Middelink (middelin@polyware.nl)
Sat, 4 Sep 1999 13:58:54 +0200


On Fri, Sep 03, 1999 at 12:51:04PM -0500, Mark H. Wood wrote:
> Hear, hear.
>
> I've created a patch that flattens out the IPV4 statistics into individual
> longs retrievable via sysctl (so you can still find them in /proc if you
> want them there) that I mean to hack into UCD SNMP at some point, for just
> this reason (among others).
>
> There's still a problem though, if I understand sysctl's argument
> structure: you can only fetch (or set) one thing at a time. That means
> that a monitoring tool could be causing quite a lot of context-switching.
> A better way would be (say) a sysctln() that would take a whole list of
> items and return them all in a single pair of context switches.
> (*Setting* N items in one call leads to difficulties with partial success,
> so maybe it should be a read-only sysjustshowmen(). :-)

I talked with Steven a while back about this, but it is perfectly
permissable to give the sysctl call a larger buffer than is needed
for the data and let it fill in the space which is available with
the requested values.

sysctl({VM_NET,NET_ROUTE,NET_ROUTE_METRIC,0},buf,sizeof(buf)
^ no route given, so
all routes are returned (if possible).

The problem is that this results in quite a nice race condition
when some route gets added between sysctl's

Met vriendelijke groet,
Pauline Middelink

-- 
PGP Key fingerprint = DE 6B D0 D9 19 AD A7 A0  58 A3 06 9D B6 34 39 E2
For more details look at my website http://www.polyware.nl/~middelin

- 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/