Cleaned up libposix mmap()

Now we have proper setting of errno and using pfn based mmap for both types of mmap calls.
This commit is contained in:
Bahadir Balban
2008-10-29 20:01:31 +02:00
parent 4046ad9e3f
commit 13b1b405a5
4 changed files with 60 additions and 29 deletions

View File

@@ -24,7 +24,7 @@ struct sys_mmap_args {
};
void *sys_mmap(struct tcb *sender, void *start, size_t length, int prot,
int flags, int fd, off_t offset);
int flags, int fd, off_t pfn);
int sys_munmap(struct tcb *sender, void *vaddr, unsigned long size);
int sys_msync(struct tcb *task, void *start, unsigned long length, int flags);

View File

@@ -110,17 +110,11 @@ void handle_requests(void)
ret = sys_lseek(sender, (int)mr[0], (off_t)mr[1], (int)mr[2]);
break;
case L4_IPC_TAG_MMAP2: {
case L4_IPC_TAG_MMAP: {
struct sys_mmap_args *args = (struct sys_mmap_args *)mr[0];
ret = (int)sys_mmap(sender, args->start, args->length, args->prot,
args->flags, args->fd, args->offset);
}
case L4_IPC_TAG_MMAP: {
struct sys_mmap_args *args = (struct sys_mmap_args *)&mr[0];
ret = (int)sys_mmap(sender, args->start, args->length, args->prot,
args->flags, args->fd, __pfn(args->offset));
break;
}
case L4_IPC_TAG_MUNMAP: {
ret = sys_munmap(sender, (void *)mr[0], (unsigned long)mr[1]);
break;