public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: cygwin@cygwin.com
Subject: Re: Cygwin's writev() non-standard behavior
Date: Wed, 23 Apr 2014 16:24:00 -0000	[thread overview]
Message-ID: <5357DEE4.1080802@redhat.com> (raw)
In-Reply-To: <20140423145338.163340@gmx.com>

[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]

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

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2014-04-23 16:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-23 14:53 qq qq
2014-04-23 16:24 ` Eric Blake [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-04-23 15:48 qq qq
2014-04-23 16:44 ` Corinna Vinschen
2014-04-23 18:44 ` Christopher Faylor
2014-04-23 14:06 qq qq
2014-04-23 14:43 ` Eric Blake
2014-04-23 14:53   ` Eliot Moss
2014-04-23 15:29 ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5357DEE4.1080802@redhat.com \
    --to=eblake@redhat.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).