NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NetBSD and _POSIX_C_SOURCE



On Sun, 05 May 2019 01:11:05 +0700
Robert Elz <kre%munnari.OZ.AU@localhost> wrote:

>     Date:        Sat, 4 May 2019 12:15:08 +0100
>     From:        Sad Clouds <cryintothebluesky%gmail.com@localhost>
>     Message-ID:
> <20190504121508.a491df867c439cd122ce32b7%googlemail.com@localhost>
> 
>   | So if I'm not mistaken, then defining only _POSIX_C_SOURCE=200809L
>   | explicitly hides _NETBSD_SOURCE,
> 
> Correct.
> 
>   | hence if I want POSIX + all NetBSD
>   | extensions then it looks like I need to define both?
> 
> Or just define nothing, or just _NETBSD_SOURCE ... that is essentially
> a superset of POSIX (or all the POSIX that we have anyway - you can't
> make more appear by magic by defining _POSIX_C_SOURCE).
> 
> Usually defining one (or more) of the standards specific versions is
> useful only when you want to limit the program to use only what the
> standard says exists, as you want to be able to move it to other
> systems that also support that standard, and for that to work, you
> need to avoid local extensions.
> 
> If there something the you're not getting without defining any of
> these things which _POSIX_C_SOURCE=200809L is providing for you?
> 
> kre
> 
> 

Yes, so the problem here is I want to stick mainly to POSIX, since the
code has to run on Linux, Solaris, etc. But each of the OSes has
incompatible extensions, for example, cpu affinity APIs, so if I
define _POSIX_C_SOURCE=200809L on NetBSD, then cpuset_t type is no
longer available.

What I'm trying to avoid is setting _NETBSD_SOURCE and getting some
"improved" NetBSD types/functions which directly conflict with POSIX. 



Home | Main Index | Thread Index | Old Index