X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 	tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4BB4CAFE.5070605@redhat.com>
Date: Thu, 01 Apr 2010 10:34:06 -0600
From: Eric Blake <eblake@redhat.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1 Thunderbird/3.0.3
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: fopen with "a+" does not respect setting file read position to   start of file
References: <B0E0B6C348D8AB4BAD6290DC0BDE99D47427D7442A@GVW1115EXC.americas.hpqcorp.net> <4BB482FA.3030201@ltu.se> <op.vahh3o181e62zd@balu.cs.uni-paderborn.de>
In-Reply-To: <op.vahh3o181e62zd@balu.cs.uni-paderborn.de>
Content-Type: multipart/signed; micalg=pgp-sha1;  protocol="application/pgp-signature";  boundary="------------enig944A91C66923355F862917B1"
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.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

--------------enig944A91C66923355F862917B1
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

On 04/01/2010 05:53 AM, Matthias Andree wrote:
>> Well if that worked previously it was a bug.
>=20
> Not a Cygwin defect, but an application bug, and what Gavin named "work
> around" is actually the right fix.
>=20
> POSIX explicitly states that the initial position beginning/end of file
> in append mode is implementation-defined, and the Cygwin documentation
> doesn't make promises either way. Linux and FreeBSD document BOF and
> EOF, respectively.

I agree that it is not a cygwin bug.  And I actually prefer Linux'
interpretation of BOF, since it matches with the POSIX requirement that
open(,O_APPEND|O_RDWR) be positioned at offset 0 and not at the end (it
is only fopen that is allowed, but not required, to be at the end).  In
fact, the release of m4 1.4.10 worked on cygwin and Linux but was broken
on BSD because of this very portability pitfall.

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig944A91C66923355F862917B1
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAku0ywEACgkQ84KuGfSFAYBP4ACfV1BGi7sPML01jLpul/N3OQSP
8ikAn0NarTjKWNVdDXQs5oqZ6ekOtIH/
=0YgL
-----END PGP SIGNATURE-----

--------------enig944A91C66923355F862917B1--
