On 17 February 2017 at 11:20, Paolo Bonzini <pbonz...@redhat.com> wrote: > > > On 17/02/2017 11:18, Peter Maydell wrote: >> Defining _XOPEN_SOURCE is easy enough, and I think we should >> do it unconditionally. We should check what effect this has >> on the BSD hosts though I guess. (You could argue that we >> should be defining _XOPEN_SOURCE anyway for the benefit of >> the non-glibc BSD/Solaris/etc platforms.) > > Sounds good, then I think we should define it to 700 just like glibc does.
Unfortunately this idea turns out to break OSX compiles, because on OSX saying _XOPEN_SOURCE=anything disables all the non-X/Open APIs (which you get by default, and some of which like mkdtemp we use). Looking at the manpage for Solaris https://www.freebsd.org/cgi/man.cgi?query=standards&apropos=0&sektion=0&manpath=SunOS+5.8&format=html it seems to also go with "_XOPEN_SOURCE means *only* those functions", though its mechanism for saying "and the other stuff too" is different (define __EXTENSION__). So perhaps we'd better stick with "only define this for Linux hosts". thanks -- PMM