summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-24 21:48:52 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-24 21:48:52 +0000
commita9ea7088e35a3479c83f0aaa6858ef0281b2a89f (patch)
treeb88c7382ffe6905b124fd34e5e00627beda304ed /cpukit
parent2010-06-24 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-a9ea7088e35a3479c83f0aaa6858ef0281b2a89f.tar.bz2
2010-06-24 Joel Sherrill <joel.sherrilL@OARcorp.com>
* libcsupport/src/read.c, libcsupport/src/write.c: read(2) and write(2) should return 0 when passed a count of 0 after verifying other possible errors.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog6
-rw-r--r--cpukit/libcsupport/src/read.c4
-rw-r--r--cpukit/libcsupport/src/write.c4
3 files changed, 12 insertions, 2 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index c368d7101b..db4f81cb0e 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,11 @@
2010-06-24 Joel Sherrill <joel.sherrilL@OARcorp.com>
+ * libcsupport/src/read.c, libcsupport/src/write.c: read(2) and write(2)
+ should return 0 when passed a count of 0 after verifying other
+ possible errors.
+
+2010-06-24 Joel Sherrill <joel.sherrilL@OARcorp.com>
+
* libfs/src/imfs/imfs_creat.c: Fix warning.
2010-06-24 Joel Sherrill <joel.sherrilL@OARcorp.com>
diff --git a/cpukit/libcsupport/src/read.c b/cpukit/libcsupport/src/read.c
index 4e44eec4ff..34d07085b6 100644
--- a/cpukit/libcsupport/src/read.c
+++ b/cpukit/libcsupport/src/read.c
@@ -34,10 +34,12 @@ ssize_t read(
rtems_libio_check_count( count );
rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ );
+ if ( count == 0 )
+ return 0;
+
/*
* Now process the read().
*/
-
if ( !iop->handlers->read_h )
rtems_set_errno_and_return_minus_one( ENOTSUP );
diff --git a/cpukit/libcsupport/src/write.c b/cpukit/libcsupport/src/write.c
index 3bda204015..0193466bd5 100644
--- a/cpukit/libcsupport/src/write.c
+++ b/cpukit/libcsupport/src/write.c
@@ -41,10 +41,12 @@ ssize_t write(
rtems_libio_check_count( count );
rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
+ if ( count == 0 )
+ return 0;
+
/*
* Now process the write() request.
*/
-
if ( !iop->handlers->write_h )
rtems_set_errno_and_return_minus_one( ENOTSUP );