X-Spam-Check-By: sourceware.org Date: Thu, 12 Jan 2006 12:59:08 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Define _POSIX_SOURCE in cygwin's features.h? Message-ID: <20060112175908.GB30108@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <20060112173104 DOT GA30011 AT trixie DOT casa DOT cgf DOT cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Thu, Jan 12, 2006 at 05:40:35PM -0000, Dave Korn wrote: >Christopher Faylor wrote: >>Someone on the cygwin irc channel had a problem building a package >>which would have been solved if Cygwin defined _POSIX_SOURCE. >> >>I know that Cygwin is not fully POSIX compliant (I really really do) >>but I'm wondering if setting _POSIX_SOURCE in the cygwin headers >>wouldn't solve more porting problems than it creates. >> >>Any opinions on this? Eric? >> >>P.S. I know that Cygwin isn't fully compliant with POSIX >>specifications. > >As far as I can tell by googling, _POSIX_SOURCE, despite the leading >underscore, is in fact a user-land feature test macro that it is up to >each individual application to decide whether to switch it on or not >according to whether the application itself is compliant or not. No need to use google. Just grep for it in /usr/include on linux. _POSIX_SOURCE is defined in features.h on linux under control of the _GNU_SOURCE macro. /* If _GNU_SOURCE was defined by the user, turn on all the other features. */ #ifdef _GNU_SOURCE # undef _ISOC99_SOURCE # define _ISOC99_SOURCE 1 # undef _POSIX_SOURCE # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 199506L # undef _XOPEN_SOURCE # define _XOPEN_SOURCE 600 # undef _XOPEN_SOURCE_EXTENDED # define _XOPEN_SOURCE_EXTENDED 1 # undef _LARGEFILE64_SOURCE # define _LARGEFILE64_SOURCE 1 # undef _BSD_SOURCE # define _BSD_SOURCE 1 # undef _SVID_SOURCE # define _SVID_SOURCE 1 #endif So, let me clarify. Should we define _POSIX_SOURCE similarly to the way that linux does it? This may mean that we have to define _GNU_SOURCE also and maybe that's not a good idea but, again, it might solve more problems than it causes. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/