From owner-freebsd-current@FreeBSD.ORG Tue Jan 28 17:35:28 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C1F592A; Tue, 28 Jan 2014 17:35:28 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6575A1504; Tue, 28 Jan 2014 17:35:28 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5A1F5B9DD; Tue, 28 Jan 2014 12:35:27 -0500 (EST) From: John Baldwin To: freebsd-current@freebsd.org Subject: Re: any use for sys/sys/selinfo.h outside the kernel ? Date: Tue, 28 Jan 2014 12:11:17 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <20140122223836.GA292@onelab2.iet.unipi.it> In-Reply-To: <20140122223836.GA292@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201401281211.17679.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 28 Jan 2014 12:35:27 -0500 (EST) Cc: Luigi Rizzo , current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2014 17:35:28 -0000 On Wednesday, January 22, 2014 5:38:36 pm Luigi Rizzo wrote: > Looking at sys/sys/selinfo.h i see that parts of it are in > > #ifdef _KERNEL > ... > #endif > > but it seems to me that also the remaining content (definition > of struct selinfo) is only of use within the kernel -- or possibly > to programs who want to peek into kmem. > > So i wonder, does it make sense to have the #ifdef _KERNEL guard > at all, or should we push it to the entire content of the file ? > > Same goes probably for other files in sys/sys describing kernel > data structures, e.g. sys/sys/socketvar.h etc. Some things (ab)use socket ones (probably lsof for example). I'm not sure of any that need selinfo, though they may need it indirectly. For example, since lsof wants to look at sockets, it needs sockbuf, and sockbuf needs selinfo, etc. -- John Baldwin