Permalink
Browse files

Grant

  • Loading branch information...
1 parent 6b06411 commit 306380690a31281cb087e4b0006843a6b42aef98 @grantborthwick committed Oct 28, 2012
Showing with 12 additions and 3 deletions.
  1. +0 −1 src/lib/user/syscall.c
  2. +10 −0 src/userprog/process.c
  3. +2 −2 src/userprog/syscall.c
View
@@ -103,7 +103,6 @@ remove (const char *file)
int
open (const char *file)
{
- printf("attemping OPEN\n");
return syscall1 (SYS_OPEN, file);
}
View
@@ -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;
}
View
@@ -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. */

0 comments on commit 3063806

Please sign in to comment.