This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cygwin's writev() non-standard behavior
- From: "qq qq" <miska0000 at gmx dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 23 Apr 2014 16:53:36 +0200
- Subject: Re: Cygwin's writev() non-standard behavior
- Authentication-results: sourceware.org; auth=none
> 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 ?
> so your argument is flawed - you have triggered undefined behavior.
Same difference:
$ cat test.c
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <sys/uio.h>
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)
 Âperror("writev");
Âreturn 0;
}
Linux:
$ gcc -Wall test.c
$ ./a.out
Cygwin:
$ gcc -Wall test.c
$ ./a.exe
writev: Invalid argument
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple