delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/01/12/15:38:12

X-Spam-Check-By: sourceware.org
Message-ID: <43C6BBA5.9000809@users.sourceforge.net>
Date: Thu, 12 Jan 2006 14:27:17 -0600
From: "Yaakov S (Cygwin Ports)" <yselkowitz AT users DOT sourceforge DOT net>
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Define _POSIX_SOURCE in cygwin's features.h?
References: <20060112173104 DOT GA30011 AT trixie DOT casa DOT cgf DOT cx> <43C69B77 DOT 1070304 AT users DOT sourceforge DOT net> <20060112182017 DOT GD30108 AT trixie DOT casa DOT cgf DOT cx>
In-Reply-To: <20060112182017.GD30108@trixie.casa.cgf.cx>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Christopher Faylor wrote:

> 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.

Right now, all _POSIX_SOURCE seems to do is exclude a number of
constants and functions from being defined, supposedly because they
aren't part of the POSIX standard.

Now, newlib != glibc, but the examples I mentioned before could be
compared to their glib counterparts (see below regarding <sys/select.h>).

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

OK, but I think these are uncommon cases; I've built a *LOT* of packages
of all types, and this has not generally been a problem.

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

gmime2:

gmime-gpg-context.c: In function `gpg_ctx_op_step':
gmime-gpg-context.c:1089: error: `fd_set' undeclared (first use in this
function)
gmime-gpg-context.c:1089: error: (Each undeclared identifier is reported
only once
gmime-gpg-context.c:1089: error: for each function it appears in.)
gmime-gpg-context.c:1089: error: parse error before "rdset"
gmime-gpg-context.c:1096: error: `rdset' undeclared (first use in this
function)
gmime-gpg-context.c:1114: error: `wrset' undeclared (first use in this
function)
gmime-gpg-context.c:1124: error: `wrsetp' undeclared (first use in this
function)

fd_set is defined in <sys/types.h> (which is also called by
<sys/select.h>, but only if !defined(_POSIX_SOURCE)), but with this
condition:

/* We don't define fd_set and friends if we are compiling POSIX
   source, or if we have included (or may include as indicated
   by __USE_W32_SOCKETS) the W32api winsock[2].h header which
   defines Windows versions of them.   Note that a program which
   includes the W32api winsock[2].h header must know what it is doing;
   it must not call the cygwin32 select function.
*/
# if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined
(__USE_W32_SOCKETS))

AFAICS, in glibc, fd_set is (independent of _POSIX_SOURCE) defined via
<sys/select.h>.

Since _POSIX_SOURCE on Cygwin doesn't add anything, I can't remember a
case that I've had to *add* such a define.


Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDxrujpiWmPGlmQSMRAiZtAKCW/vRO4Ihfop9vJLdKYs0mPvNCgwCfUHh/
3ziKVCCYkJnGCTnMtgkirec=
=bUjT
-----END PGP SIGNATURE-----

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019