Re: [PATCH 0/4] Cross compiling sharutils

Eric Blake <[email protected]> Wed, 20 May 2015 22:05:14 -0600
Newsgroups gmane.comp.gnu.utils.bugs
Organization Red Hat, Inc.
Message-ID <[email protected]>
On 05/20/2015 09:51 PM, Bruce Korb wrote:
> On 05/19/15 19:56, Eli Zaretskii wrote:
>>> Date: Tue, 19 May 2015 19:57:25 -0600
>>> From: Eric Blake <[email protected]>
>>> Cc: bug-gnu-utils <[email protected]>
>>>
>>> That is, the few platforms where O_BINARY is non-zero probably already
>>> support "rb" as a mode for popen (are there any besides Cygwin and
>>> mingw?).
>>
>> DJGPP.
> 
> That answers the question, "Does popen support "rb" as an open mode?"
> The other question is:  "Is O_BINARY non-zero on DJGPP, too?"  I would
> expect.
> 
> Actually, since we're also dealing with glibc, which is perfect in every
> way
> and has no need of facilitating cross platform development, O_BINARY
> is not defined:

gnulib does:

#ifndef O_BINARY
#define O_BINARY 0
#endif

which is perfectly fine; you can then use 'if (O_BINARY)' throughout
your code to bracket code that is only needed on platforms where text is
different from binary.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc (application/pgp-signature, 604 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJVXVl7AAoJEKeha0olJ0NqiRQH/iXMM7F7/43QEto0DhBlMK9q
y91vRjs+SNbnWSaxC39Ihbn1xUkLqiryn8nIdQtYuAayOvIP7FqsGon6DEbTlrru
pf9Qw21r2gs77julIMlca6ksrQ9+8SHheO1fdnWI9QJX2XYZ9eRDO/gkDx6ktqyY
PlQrTRog/HiRuqHGOzoHNiJ+y6YFMf6XsZ+fTMibWKVq0fiJZfSQ9Be83NjpDMTz
ZSr+jrswQ+zGen+d24L4Oxwl29iX6R3Tjct8AN7RsCu6a6ovYaPduX2mY89OF67H
8Xm1xMRrpaMLcqDxk/fsrFFqmYS1yQ9hWd/+bYJM75CgfLqMPevdQSq1Yc95Hv0=
=ltpY
-----END PGP SIGNATURE-----