diff options
author | Christopher Faylor <me@cgf.cx> | 2001-11-14 07:13:10 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-11-14 07:13:10 +0300 |
commit | c9597ae2314b2e3f36139081f389b394203ea92c (patch) | |
tree | 70e26daa25f7f08df29202983b6f6c0c5ab4a714 | |
parent | 1e5d06f2eac0f6655c6d67689f66786dde14fd86 (diff) |
* syscalls.cc (_write): Allow zero length as per SUSv2.unlabeled-1.172.4
-rw-r--r-- | winsup/cygwin/syscalls.cc | 3 |
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; |