Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 08 Dec 2002 22:13:33 +0100
From:      Marc Recht <marc@informatik.uni-bremen.de>
To:        David Schultz <dschultz@uclink.Berkeley.EDU>
Cc:        freebsd-standards@FreeBSD.ORG
Subject:   Re: POSIX and the real life or FreeBSD too strict ?
Message-ID:  <758430000.1039382013@leeloo.intern.geht.de>
In-Reply-To: <20021208203949.GA535@HAL9000.homeunix.com>
References:  <584000000.1039360297@leeloo.intern.geht.de> <20021208203949.GA535@HAL9000.homeunix.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
> What you're asking for is reasonable, but there's a problem of
> namespace pollution.  A application that uses only POSIX features
> is supposed to compile on a conforming implementation when
> _POSIX_C_SOURCE is appropriately defined.  If standard headers add
> extra symbols and macros that are not specified in POSIX, you
> can't make that guarantee due to potential name conflicts.  The
> whole point of using _POSIX_SOURCE is to turn of extensions that
> might break things.
I don't say that there might be a perfect solution, but breaking source 
compatibility to other UNIX implementation is IMHO worse.

> By the way, Solaris also has the behavior you're complaining
> about, but there is a workaround.  If you define _POSIX_C_SOURCE,
Hmm, not from my last experiences.. (But, I'm not doing that much on 
Solaris.)

> you get precisely the features specified in POSIX, and if you
> additionally define __EXTENSIONS__, you get everything.  I'm not
IMHO something like that is absolutly neccessary.
> sure what ``other UNIX implementations'' you've been looking at,
> but a cursory glance at glibc reveals that it is in the same boat
> as FreeBSD.


I've tried the following two sources on FreeBSD-current (today), FreeBSD 
4.7-RC, NetBSD 1.6 (gcc2.95),
Solaris 8/Sparc (gcc 3.0) and Gentoo Linux (gcc 3.2, today).
gcc -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE_=600 
-D_XOPEN_SOURCE_EXTENDED=1
On -current both sources can't be compiled. On FreeBSD 4.x the first can't 
be compiled (because of _SC_PAGE_SIZE). All other OSes compiled them just 
fine.

1)
#include <unistd.h>
#include <stdio.h>
int main() {
   long l = 0;
   l = sysconf(_SC_PAGE_SIZE);
   printf ("\nsize: %ld\n", l);
   return 0;
}

2)
#include <sys/types.h>
#include <sys/file.h>

int main() {
   return 0;
}

Regards,
Marc

"Premature optimization is the root of all evil." -- Donald E. Knuth
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE987X97YQCetAaG3MRAsMwAKCIrNAx4UU25nrBSdMqoFG9xfDKFACfWcXM
Diqjdhj5yUPwYnpmY3Mm57A=
=GgMd
-----END PGP SIGNATURE-----

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