Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-11-14 07:13:10 +0300
committerChristopher Faylor <me@cgf.cx>2001-11-14 07:13:10 +0300
commitc9597ae2314b2e3f36139081f389b394203ea92c (patch)
tree70e26daa25f7f08df29202983b6f6c0c5ab4a714
parent1e5d06f2eac0f6655c6d67689f66786dde14fd86 (diff)
* syscalls.cc (_write): Allow zero length as per SUSv2.unlabeled-1.172.4
-rw-r--r--winsup/cygwin/syscalls.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 3b2104d7f..f181852ef 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -355,6 +355,9 @@ _read (int fd, void *ptr, size_t len)
extern "C" ssize_t
_write (int fd, const void *ptr, size_t len)
{
+ if (len == 0)
+ return 0;
+
if (__check_invalid_read_ptr_errno (ptr, len))
return -1;