X-Spam-Check-By: sourceware.org Date: Thu, 12 Jan 2006 13:47:10 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Define _POSIX_SOURCE in cygwin's features.h? Message-ID: <20060112184710.GF30108@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <20060112175908 DOT GB30108 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 06:13:16PM -0000, Dave Korn wrote: >Christopher Faylor wrote: >>_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 > >... which is equally something that belongs to and is under control of the >user's application, and is a way for the user's application to specify (to the >compiler, C runtime, and whoever else) that it's compliant and requires/copes >with POSIX compliant source in the system header files. ...which doesn't really invalidate the question of whether cygwin should be trying to set up its headers the same way as linux. >>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. > >I think it means that whoever you were talking to in the IRC channel >should have defined _POSIX_SOURCE in their application, and the bug is >that they didn't when they should have. Ok. I assumed that some header set _GNU_SOURCE but apparently I was wrong. I should have checked. Just to add even more clarification, this wasn't some guy writing a program for his class assignment. It was someone trying to port a standard linux/unix application. The program had a test for _POSIX_SOURCE which would have worked correctly under Cygwin. I don't know if it was setting _GNU_SOURCE to get this or if the _POSIX_SOURCE test just wasn't discovered by configure. So, maybe this boils down to the question of whether there's something about Cygwin which makes configure think it shouldn't set _POSIX_SOURCE or _GNU_SOURCE. Maybe it is just that uname doesn't return the string "linux". Again, I'm not really interested in hearing what someone should have done or should have known to do. If there is a way to make porting a program to cygwin easier without requiring some special knowledge that isn't required on linux, then I'll probably take steps to make that happen. 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/