mirror of
https://github.com/drasko/codezero.git
synced 2026-03-02 18:43:16 +01:00
Changes towards exit. Need to fix thread suspend first.
This commit is contained in:
@@ -105,7 +105,6 @@ int sys_fork(struct tcb *parent)
|
||||
task_add_global(child);
|
||||
|
||||
/* Start forked child. */
|
||||
printf("%s/%s: Starting forked child.\n", __TASKNAME__, __FUNCTION__);
|
||||
l4_thread_control(THREAD_RUN, &ids);
|
||||
|
||||
/* Return child tid to parent */
|
||||
|
||||
@@ -371,13 +371,19 @@ int fsync_common(struct tcb *task, int fd)
|
||||
int err;
|
||||
|
||||
/* Check fd validity */
|
||||
if (fd < 0 || fd > TASK_FILES_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* If we don't know about the file, even if it was
|
||||
* opened by the vfs, it is sure that there's no
|
||||
* pending IO on it. We simply return.
|
||||
*/
|
||||
if (!task->files->fd[fd].vmfile)
|
||||
if ((err = file_open(task, fd)) < 0)
|
||||
return err;
|
||||
return 0;
|
||||
|
||||
/* Finish I/O on file */
|
||||
BUG_ON(!(f = task->files->fd[fd].vmfile));
|
||||
if ((err = flush_file_pages(f)) < 0)
|
||||
if ((err = flush_file_pages(task->files->fd[fd].vmfile)) < 0)
|
||||
return err;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -33,6 +33,11 @@ void *utcb_vaddr_new(void)
|
||||
return address_new(&utcb_vaddr_pool, 1);
|
||||
}
|
||||
|
||||
int utcb_vaddr_del(void *utcb_addr)
|
||||
{
|
||||
return address_del(&utcb_vaddr_pool, utcb_addr, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends utcb address information to requester task, allocates
|
||||
* an address if it doesn't exist and the requester is asking
|
||||
|
||||
Reference in New Issue
Block a user