This is the mail archive of the
cygwin
mailing list for the Cygwin project.
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:06:34 +0200
- Subject: Cygwin's writev() non-standard behavior
- Authentication-results: sourceware.org; auth=none
writev() does not accept count 0 but it should
$ cat test.c
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/uio.h>
int main()
{
Âstruct iovec vec;
Âmemset(&vec, 0, sizeof(vec));
Âif (writev(1, &vec, 0) < 0)
 Âperror("writev");
Âreturn 0;
}
Linux:
$ gcc -Wall test.c
$ ./a.out
Cygwin:
$ gcc -Wall test.c
$ ./a.exe
writev: Invalid argument
This behavior is buggy per:
   EINVAL ... the vector count count is less than zero or greater than the permitted maximum ...
--
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