aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-11-14 04:12:11 +0000
committerChristopher Faylor <me@cgf.cx>2001-11-14 04:12:11 +0000
commit65814395b660eb3a58c3776606b6323c2386d044 (patch)
treed08da3ef90f2a6e2a2bd740237066e0deb33e42f /winsup
parentb83587946b32247b86846551d8ae27044f3ed60c (diff)
downloadnewlib-65814395b660eb3a58c3776606b6323c2386d044.zip
newlib-65814395b660eb3a58c3776606b6323c2386d044.tar.gz
newlib-65814395b660eb3a58c3776606b6323c2386d044.tar.bz2
* syscalls.cc (_write): Allow zero length as per SUSv2.
Diffstat (limited to 'winsup')
-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 ba6e5ea..ad64ad2 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 307d618..848e0e4 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;