X-Spam-Check-By: sourceware.org
Date: Thu, 12 Jan 2006 13:20:17 -0500
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Define _POSIX_SOURCE in cygwin's features.h?
Message-ID: <20060112182017.GD30108@trixie.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
References: <20060112173104.GA30011@trixie.casa.cgf.cx> <43C69B77.1070304@users.sourceforge.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <43C69B77.1070304@users.sourceforge.net>
User-Agent: Mutt/1.5.11
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Thu, Jan 12, 2006 at 12:09:59PM -0600, Yaakov S (Cygwin Ports) wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>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.
>
>I think it would be the opposite.
>
>1) In glibc, _POSIX_SOURCE is defined by features.h based on a number of
>conditions[1].  The newlib/Cygwin features.h isn't nearly so thorough.

I am going to regret not making that clear, aren't I?

>2) After running a grep of /usr/include, it looks like arbitrarily
>defining _POSIX_SOURCE in Cygwin would cause a significant number of
>constants and functions to never be defined (and AFAICS there would be
>no simple way to undef it within code), without actually adding
>anything, for example:

I guess more subtext that you could read into my request would be that
we would make the headers work as closely as possible to linux when
_POSIX_SOURCE is defined.  The key here is to make things look more
like linux so that programs port more easily.

>3) I think that, in many cases, _POSIX_SOURCE is defined in code if
>desired (and that would have been the best solution in the
>aforementioned case).

So, that would imply that "we" really should actively fix up the headers
to make sure that it is properly handled.

>4) I'm sure I remember a few times that, even when _POSIX_SOURCE was
>defined in code, I had to #ifndef __CYGWIN__ that define due to compile
>errors; I can't remember having to manually add such a define, however.

I was hoping for concrete examples.  Do you have any?

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/

