From owner-freebsd-arch@FreeBSD.ORG Sat Dec 29 00:31:05 2007 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A84616A417; Sat, 29 Dec 2007 00:31:05 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id EE59113C447; Sat, 29 Dec 2007 00:31:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 41C2F47CAC; Fri, 28 Dec 2007 19:31:04 -0500 (EST) Date: Sat, 29 Dec 2007 00:31:04 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: <200712281745.08144.jhb@freebsd.org> Message-ID: <20071229002903.M45653@fledge.watson.org> References: <200712271704.44796.jhb@FreeBSD.org> <200712281745.08144.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-arch@freebsd.org Subject: Re: kernel features MIB X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2007 00:31:05 -0000 On Fri, 28 Dec 2007, John Baldwin wrote: > On Thursday 27 December 2007 05:04:44 pm John Baldwin wrote: > >> At work we don't have a pretty API for this at all, but I'm thinking for >> FreeBSD we can do this: >> >> FEATURE(foo, "description of foo") >> >> which is a macro to create the 'kern.features.foo' node and set it to 1. >> Then we could have a routine in libc: >> >> int feature_present(const char *name); >> >> That returns a boolean to indicate if a given feature is present or not by >> invoking sysctlbyname(3), etc. >> >> Any objections to the idea? > > So here's a bikeshed question I have no idea for. Which header should > feature_present()'s prototype go in? I anticipate this routine being used > in libc itself, so I don't think it can go into libutil. #include feature_check(2)? Does POSIX talk about the namespace for non-portable names being passed to sysconf(3)? Robert N M Watson Computer Laboratory University of Cambridge