mirror of
https://github.com/drasko/codezero.git
synced 2026-03-10 14:23:33 +01:00
os_readdir() now using utcb as dirent buffer.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user