Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 May 2010 03:11:06 +0300
From:      Giorgos Keramidas <keramida@freebsd.org>
To:        Maxim Sobolev <sobomax@freebsd.org>
Cc:        current@freebsd.org
Subject:   Re: SYSCTL_XXX(9) manual page deficiency
Message-ID:  <877hn3tmjp.fsf@kobe.laptop>
In-Reply-To: <4BCF5BAF.7010501@FreeBSD.org> (Maxim Sobolev's message of "Wed,  21 Apr 2010 13:10:23 -0700")
References:  <4BCF5BAF.7010501@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 21 Apr 2010 13:10:23 -0700, Maxim Sobolev <sobomax@FreeBSD.org> wrote:
> Hi,
>
> According to the manual page for the SYSCTL_XXX(9) family of
> functions, in order to use them one needs to include sys/types.h and
> sys/sysctl.h. However, if you do just that the code doesn't compile
> due to missing DATA_SET() macros, which is defined in
> sys/linker_set.h. My question is whether or not sysctl.h should
> include sys/linker_set.h or manual page to be extended to also
> suggests that this include is required to use those functions?

linker_set.h is a relatively small header that defines only a minimal
amount of macros in the public namespace.

Some of these symbols are a bit generic, e.g. SET_BEGIN, SET_END,
SET_ENTRY, SET_FOREACH and SET_ITEM might conflict with symbol names
from other code.

On the other hand, the XXX_SET() code is only visible at the end of the
SYSCTL_XXX() macros only for kernel code, and it has been there for a
*very* long time: since phk committed revision 11863 in 1995.  If there
ever was a consumer of the kernel API of sysctl.h who had problems with
the generic XXX_SET() macros in linker_set.h we'd probably know by now.

IMO adding linker_set.h to sysctl.h is fine.




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