Re: SYSCTL_XXX(9) manual page deficiency

From: Giorgos Keramidas <keramida_at_freebsd.org>
Date: Mon, 17 May 2010 03:11:06 +0300
On Wed, 21 Apr 2010 13:10:23 -0700, Maxim Sobolev <sobomax_at_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.
Received on Sun May 16 2010 - 22:30:50 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:03 UTC