Peter Memishian writes:
> 
>  > Suggestion on existing solutions still welcome...
> 
> Can you elaborate on why you need to do this within the kernel?

In addition to that (which I think is a pretty good question), I can
answer the bit about locks: there aren't any.

The SIOCGLIFNUM interface is Solaris-specific and only semi-useful.
To use it effectively, you have to pad the number it returns with some
small amount (say 10 entries), then be prepared to try and try again
on SIOCGLIFCONF if the buffer happens to be too small.  (It can be if
there's someone busily plumbing up interfaces as you're making these
calls.)

When the "L"-type ioctls were added (Solaris 8, I think; part of the
IPv6 work), there were some anomalies.  The old standard BSD
SIOCGIFCONF interface just has you allocate an arbitrary size buffer,
then reallocate and retry (usually doubling size on each iteration) if
the returned size is within one entry of full.  That interface was
simpler (no need or way to get a count first) and generally worked
fine.

I don't know why SIOCGLIFNUM was added -- it wasn't really necessary,
and can't be made to be _precise_ -- but all it can do is given you a
rough starting point.

-- 
James Carlson, Solaris Networking              <[EMAIL PROTECTED]>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to