Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Mar 2004 18:07:04 -0500 (EST)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        Archie Cobbs <archie@dellroad.org>
Cc:        freebsd-standards@freebsd.org
Subject:   _BSD_SOURCE vs. __BSD_VISIBLE
Message-ID:  <200403182307.i2IN7403029016@khavrinen.lcs.mit.edu>
In-Reply-To: <200403182233.i2IMXPuJ002724@arch20m.dellroad.org>
References:  <200403182233.i2IMXPuJ002724@arch20m.dellroad.org>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Thu, 18 Mar 2004 16:33:25 -0600 (CST), Archie Cobbs <archie@dellroad.org> said:

> On FreeBSD, _BSD_SOURCE is not recognized, but _POSIX_C_SOURCE is and
> it actually causes the BSD functions to be hidden. So I have to manually
> add __BSD_VISIBLE to get them on FreeBSD.

Then your code is wrong.  If you don't want POSIX namespace, then you
shouldn't be defining _POSIX_C_SOURCE.

Application code has no business defining __BSD_VISIBLE.

> Q1: Why does Linux require _BSD_SOURCE but FreeBSD requires __BSD_VISIBLE?

Because Linux (or more likely, glibc) made a bad decision.

> Q3: What is the right and portable set of flags to use?

None, unless your application is prepared to live within the
limitations of the namespaces it requests.  Don't ask for POSIX and
then expect something else.

-GAWollman



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