From owner-freebsd-net@FreeBSD.ORG Tue Jan 26 20:52:12 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3159106566B; Tue, 26 Jan 2010 20:52:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B34958FC15; Tue, 26 Jan 2010 20:52:12 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 5F31746B38; Tue, 26 Jan 2010 15:52:12 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 9DE5E8A024; Tue, 26 Jan 2010 15:52:11 -0500 (EST) From: John Baldwin To: d@delphij.net Date: Tue, 26 Jan 2010 15:48:21 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20100120; KDE/4.3.1; amd64; ; ) References: <4B5E16DB.2080203@delphij.net> <201001261140.51006.jhb@freebsd.org> <4B5F4ED6.1070400@delphij.net> In-Reply-To: <4B5F4ED6.1070400@delphij.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201001261548.21455.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 26 Jan 2010 15:52:11 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: delphij@freebsd.org, freebsd-net@freebsd.org, Robert Watson Subject: Re: [PATCH] Interface description X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2010 20:52:13 -0000 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