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:12:11 +0300
committerChristopher Faylor <me@cgf.cx>2001-11-14 07:12:11 +0300
commit65814395b660eb3a58c3776606b6323c2386d044 (patch)
treed08da3ef90f2a6e2a2bd740237066e0deb33e42f
parentb83587946b32247b86846551d8ae27044f3ed60c (diff)
* syscalls.cc (_write): Allow zero length as per SUSv2.
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/syscalls.cc3
2 files changed, 7 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index ba6e5ea05..ad64ad241 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2001-11-13 Christopher Faylor <cgf@redhat.com>
+
+ * syscalls.cc (_write): Allow zero length as per SUSv2.
+
2001-11-13 Corinna Vinschen <corinna@vinschen.de>
* dir.cc (mkdir): Add HIDDEN file attribute if file has leading dot
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 307d61885..848e0e44f 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;