Fread() and Fwrite() can return negative values, change type to reflect that

This commit is contained in:
Panu Matilainen 2007-07-12 11:06:16 +03:00
parent cf85c830fb
commit d52a645802
2 changed files with 4 additions and 4 deletions

View File

@ -2821,7 +2821,7 @@ const char *Fstrerror(FD_t fd)
#define FDIOVEC(_fd, _vec) \
((fdGetIo(_fd) && fdGetIo(_fd)->_vec) ? fdGetIo(_fd)->_vec : NULL)
size_t Fread(void *buf, size_t size, size_t nmemb, FD_t fd) {
ssize_t Fread(void *buf, size_t size, size_t nmemb, FD_t fd) {
fdio_read_function_t _read;
int rc;
@ -2843,7 +2843,7 @@ DBGIO(fd, (stderr, "==> Fread(%p,%u,%u,%p) %s\n", buf, (unsigned)size, (unsigned
return rc;
}
size_t Fwrite(const void *buf, size_t size, size_t nmemb, FD_t fd)
ssize_t Fwrite(const void *buf, size_t size, size_t nmemb, FD_t fd)
{
fdio_write_function_t _write;
int rc;

View File

@ -240,7 +240,7 @@ struct FDIO_s {
* fread(3) clone.
*/
/*@-incondefs@*/
size_t Fread(/*@out@*/ void * buf, size_t size, size_t nmemb, FD_t fd)
ssize_t Fread(/*@out@*/ void * buf, size_t size, size_t nmemb, FD_t fd)
/*@globals fileSystem @*/
/*@modifies fd, *buf, fileSystem @*/
/*@requires maxSet(buf) >= (nmemb - 1) @*/
@ -251,7 +251,7 @@ size_t Fread(/*@out@*/ void * buf, size_t size, size_t nmemb, FD_t fd)
* fwrite(3) clone.
*/
/*@-incondefs@*/
size_t Fwrite(const void * buf, size_t size, size_t nmemb, FD_t fd)
ssize_t Fwrite(const void * buf, size_t size, size_t nmemb, FD_t fd)
/*@globals fileSystem @*/
/*@modifies fd, fileSystem @*/
/*@requires maxRead(buf) >= nmemb @*/;