Few fixes in libposix error checking.

size_t is a non-negative type and negative error checking didn't work. Now fixed.
Fixed various issues with reading file pages in the sys_read() path.
This commit is contained in:
Bahadir Balban
2008-04-20 02:12:53 +01:00
parent 8b3fedc18d
commit 9992d100d7
6 changed files with 33 additions and 27 deletions

View File

@@ -55,13 +55,13 @@ static inline void write_mr(unsigned int offset, unsigned int val)
static inline void copy_to_utcb(void *arg, int offset, int size)
{
BUG_ON(size > PAGE_SIZE);
memcpy(utcb_page, arg, size);
BUG_ON(offset + size > PAGE_SIZE);
memcpy(utcb_page + offset, arg, size);
}
static inline void copy_from_utcb(void *buf, int offset, int size)
{
BUG_ON(size > PAGE_SIZE);
BUG_ON(offset + size > PAGE_SIZE);
memcpy(buf, utcb_page + offset, size);
}