From: "John W. Linville" <[EMAIL PROTECTED]>
Date: Thu, 28 Jul 2005 15:47:02 -0400

> On Thu, Jul 28, 2005 at 12:38:53PM -0700, David S. Miller wrote:
> > Probably it is better to define the ethtool object returned to the
> > user as some kind of TLV, so the size doesn't matter.
> 
> Can you point Jon at a good example of this?

Netlink uses this kind of thing a lot, but not too much ethtool
stuff does.  But something like:

struct ethtool_perm_addr {
       unsigned int cmd;
       int size;
       char data[0];
};

and the user says how large his buffer is in the request,
and if that is not large enough you return -ETOOBIG or
some similarly discernable error code so that userspace
can allocate a larger buffer.  In fact, the kernel can
rewrite the "size" field in this case to indicate how
large the buffer needs to be to hold the full address.

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to