Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Development mailing list

Subject: Re: [hwloc-devel] hwloc-1.7 issues
From: Paul Hargrove (phhargrove_at_[hidden])
Date: 2013-04-30 04:12:37

On Mon, Apr 29, 2013 at 6:36 AM, Brice Goglin <Brice.Goglin_at_[hidden]> wrote:

> > but I am getting many other warnings and another
> > error on FreeBSD 9.1:
> >
> > /usr/include/sys/sysctl.h:799: error: expected declaration specifiers or
> '...' before 'u_int'
> > topology-freebsd.c: In function 'hwloc_freebsd_node_meminfo_info':
> > topology-freebsd.c:173: warning: passing argument 2 of 'sysctl' makes
> pointer from integer without a cast
> > topology-freebsd.c:173: warning: passing argument 5 of 'sysctl' makes
> integer from pointer without a cast
> > topology-freebsd.c:173: error: too many arguments to function 'sysctl'
> >
> >
> > I wonder if this CFLAGS=-D_POSIX_SOURCE is supported by FreeBSD headers.
> I could not fix this. Google says that FreeBSD does not define u_int
> when _POSIX_SOURCE, so the sysctl() prototype cannot be correct. I tend
> to think you should remove _POSIX_SOURCE on this FreeBSD release.

sysctl() is not defined by any POSIX standard, right?
On FreeBSD, defining _POSIX_SOURCE is intended to suppress definitions of
all non-POSIX functions, types, constants, etc.
This is different than Linux, but that doesn't make it wrong.
See, for instance:

So, what else is one to expect when defining _POSIX_SOURCE and including
then including the non-POSIX header sys/sysctl.h?
I agree that one cannot expect to build hwloc on FreeBSD w/ strict POSIX
source enforced.


Paul H. Hargrove                          PHHargrove_at_[hidden]
Future Technologies Group
Computer and Data Sciences Department     Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory     Fax: +1-510-486-6900