This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin's writev() non-standard behavior


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]