Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jan 2010 15:48:21 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        d@delphij.net
Cc:        delphij@freebsd.org, freebsd-net@freebsd.org, Robert Watson <rwatson@freebsd.org>
Subject:   Re: [PATCH] Interface description
Message-ID:  <201001261548.21455.jhb@freebsd.org>
In-Reply-To: <4B5F4ED6.1070400@delphij.net>
References:  <4B5E16DB.2080203@delphij.net> <201001261140.51006.jhb@freebsd.org> <4B5F4ED6.1070400@delphij.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 26 January 2010 3:21:42 pm Xin LI wrote:
> On 2010/01/26 08:40, John Baldwin wrote:
> > I just have two suggestions/comments:
> > @@ -295,6 +295,7 @@ struct      ifreq {
> [...]
> > I prefer to not have this all on one line, but to instead be:
> [...]
> > Even better would be to actually define a separate type earlier
> > in the file I think:
> [...]
> > I think caddr_t is deprecated in favor of void * for new APIs at least.
> 
> I have split it into another type and used void *, also updated the
> manual page.
> 
> > Second, it would be nice if SIOCGIFDESCR provided length feedback to userland
> > similar to sysctl(3).  Maybe change the code to set ifr.ifr_buffer.length to
> > the required length when returning ENAMETOOLONG.  Userland can then just skip
> > to that length directly, or instead use an idiom similar to sysctl where it
> > does the following:
> 
> Done in a slightly different way.  It seems to be slightly wasteful (not
> a big deal, though) to ioctl every time to obtain the length, so I used
> an arbitrary number (2^6) and make the program to adapt to larger number
> if kernel gave feedback with ENAMETOOLONG, and the buffer/length would
> be used the next call.

Ok.  My final suggestion is to start each sentence in the manual page on a
new line as that is our style for manpages to ease the work of translators.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001261548.21455.jhb>