From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19870 invoked by alias); 23 Apr 2014 16:24:59 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 19842 invoked by uid 89); 23 Apr 2014 16:24:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Apr 2014 16:24:58 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3NFeK2G030831 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 23 Apr 2014 11:40:21 -0400 Received: from [10.3.113.108] (ovpn-113-108.phx2.redhat.com [10.3.113.108]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3NFeKw8026162 for ; Wed, 23 Apr 2014 11:40:20 -0400 Message-ID: <5357DEE4.1080802@redhat.com> Date: Wed, 23 Apr 2014 16:24:00 -0000 From: Eric Blake User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: Cygwin's writev() non-standard behavior References: <20140423145338.163340@gmx.com> In-Reply-To: <20140423145338.163340@gmx.com> OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0R6gkWoJtv7qKGheWpviAD8EwgDV1lIbi" X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00521.txt.bz2 --0R6gkWoJtv7qKGheWpviAD8EwgDV1lIbi Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-length: 1121 On 04/23/2014 08:53 AM, qq qq wrote: [your mailer should really be taught to use In-Reply-To correctly; it's annoying that every message from you starts a new thread] >> furthermore, cygwin should emulate Linux behavior, even if POSIX >> doesn't define the behavior. >=20 > And which is why I compared Linux vs. Cygwin in my original post ? If you'll note, I was trying to be careful in my reply - I'm not opposed to a change in cygwin, and in fact welcome one to bring us into consistency with Linux behavior; but at the same time, I'm also pointing out that your program is not portable and therefore it may be worth fixing the portability assumptions in your program instead of waiting on cygwin to provide the specific undefined behavior that you want to use. > int main() > { > struct iovec vec; > int fd =3D open("test.out", O_WRONLY | O_CREAT, 0666); > memset(&vec, 0, sizeof(vec)); > if (writev(fd, &vec, 0) < 0) POSIX allows, but not requires, writev() to fail with EINVAL when iovcnt is 0. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --0R6gkWoJtv7qKGheWpviAD8EwgDV1lIbi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 604 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTV97kAAoJEKeha0olJ0NqMfcH/1nv9NgVK+L1CzMZAJDdqlBl LiDglhiiK4qJYseXaqxcOIoyJi+iUcIeHlXwGPJlNxqZGSaizDqBrtbW9mPZqDcf 1wecOWwX9KBYkdLx4Bl0X8u8QpO76mBsZILKriI2baAM3uiSUurlsbSDmuFHq2BM KGZW0zocYuWBlcefQPUfMXzgM7KPsHm6q/rWwrAgdQQNXWWAUWTh5N/BzLZzUspf DbMKWDf8EX2+jbw37JYeW7H5DWwBtQx8EvGdebjParbCTwOOxoMet1vNN6ra7rS2 Z+8QveNDWdWn6tgw7i4ZzcYF8XIdRHlG720jI1PF110/Njk43gEmtatL3W6emBw= =rLCc -----END PGP SIGNATURE----- --0R6gkWoJtv7qKGheWpviAD8EwgDV1lIbi--