os_readdir() now using utcb as dirent buffer.

This commit is contained in:
Bahadir Balban
2008-04-13 16:32:34 +01:00
parent 2efffdfa88
commit 7b2f9f96cf
11 changed files with 46 additions and 21 deletions

View File

@@ -257,6 +257,13 @@ int sys_readdir(l4id_t sender, int fd, void *buf, int count)
/* Get the task */
BUG_ON(!(t = find_task(sender)));
/* Check address is in task's utcb */
if ((unsigned long)buf < t->utcb_address ||
(unsigned long)buf > t->utcb_address + PAGE_SIZE) {
l4_ipc_return(-EINVAL);
return 0;
}
/* Convert fd to vnum. */
BUG_ON((vnum = t->fd[fd]) < 0);

View File

@@ -141,8 +141,8 @@ int task_utcb_attach(struct tcb *t)
if ((unsigned long)shmaddr != t->utcb_address)
return -EINVAL;
//printf("%s: Mapped utcb of task %d @ 0x%x\n",
// __TASKNAME__, t->tid, shmaddr);
printf("%s: Mapped utcb of task %d @ 0x%x\n",
__TASKNAME__, t->tid, shmaddr);
return 0;