CS318 - Pintos
Pintos source browser for JHU CS318 course
wait-twice.c
Go to the documentation of this file.
1 /** Wait for a subprocess to finish, twice.
2  The first call must wait in the usual way and return the exit code.
3  The second wait call must return -1 immediately. */
4 
5 #include <syscall.h>
6 #include "tests/lib.h"
7 #include "tests/main.h"
8 
9 void
10 test_main (void)
11 {
12  pid_t child = exec ("child-simple");
13  msg ("wait(exec()) = %d", wait (child));
14  msg ("wait(exec()) = %d", wait (child));
15 }
lib.h
exec
pid_t exec(const char *file)
Definition: syscall.c:79
test_main
void test_main(void)
Wait for a subprocess to finish, twice.
Definition: wait-twice.c:10
wait
static void wait(struct intq *q, struct thread **waiter)
main.h
pid_t
int pid_t
Process identifier.
Definition: syscall.h:8
msg
void msg(const char *format,...)
Definition: lib.c:28