Skip to content
This repository has been archived by the owner on Jul 10, 2020. It is now read-only.

Commit

Permalink
Grant
Browse files Browse the repository at this point in the history
  • Loading branch information
grantborthwick committed Oct 28, 2012
1 parent 6b06411 commit 3063806
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/lib/user/syscall.c
Expand Up @@ -103,7 +103,6 @@ remove (const char *file)
int
open (const char *file)
{
printf("attemping OPEN\n");
return syscall1 (SYS_OPEN, file);
}

Expand Down
10 changes: 10 additions & 0 deletions src/userprog/process.c
Expand Up @@ -139,6 +139,16 @@ release_child (struct wait_status *cs)
int
process_wait (tid_t child_tid)
{
while(1){}
struct list_elem * e;
struct thread * t = NULL;
struct thread * cur = thread_current();
for (e = list_begin (&cur->children); e != list_end (&cur->children);e = list_next (e)){
struct thread * t2 = list_entry (e, struct thread, allelem);
if (t2->tid == child_tid){t = t2; break;}
}
if (t == NULL){return -1;}
sema_down(&(t->wait_status->dead));
return -1;
}

Expand Down
4 changes: 2 additions & 2 deletions src/userprog/syscall.c
Expand Up @@ -200,8 +200,8 @@ sys_exec (const char *ufile)
static int
sys_wait (tid_t child)
{
/* Add code */
thread_exit ();
process_wait(child);
//thread_exit ();
}

/* Create system call. */
Expand Down

0 comments on commit 3063806

Please sign in to comment.