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.
This commit is contained in:
Joel Sherrill
2010-06-24 21:48:52 +00:00
parent efd6e8e5a0
commit a9ea7088e3
3 changed files with 12 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
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> 2010-06-24 Joel Sherrill <joel.sherrilL@OARcorp.com>
* libfs/src/imfs/imfs_creat.c: Fix warning. * libfs/src/imfs/imfs_creat.c: Fix warning.

View File

@@ -34,10 +34,12 @@ ssize_t read(
rtems_libio_check_count( count ); rtems_libio_check_count( count );
rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ );
if ( count == 0 )
return 0;
/* /*
* Now process the read(). * Now process the read().
*/ */
if ( !iop->handlers->read_h ) if ( !iop->handlers->read_h )
rtems_set_errno_and_return_minus_one( ENOTSUP ); rtems_set_errno_and_return_minus_one( ENOTSUP );

View File

@@ -41,10 +41,12 @@ ssize_t write(
rtems_libio_check_count( count ); rtems_libio_check_count( count );
rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
if ( count == 0 )
return 0;
/* /*
* Now process the write() request. * Now process the write() request.
*/ */
if ( !iop->handlers->write_h ) if ( !iop->handlers->write_h )
rtems_set_errno_and_return_minus_one( ENOTSUP ); rtems_set_errno_and_return_minus_one( ENOTSUP );