PKUOS - Pintos
Pintos source browser for PKU Operating System course
src
tests
vm
page-parallel.c
Go to the documentation of this file.
1
/** Runs 4 child-linear processes at once. */
2
3
#include <syscall.h>
4
#include "
tests/lib.h
"
5
#include "
tests/main.h
"
6
7
#define CHILD_CNT 4
8
9
void
10
test_main
(
void
)
11
{
12
pid_t
children[
CHILD_CNT
];
13
int
i;
14
15
for
(i = 0; i <
CHILD_CNT
; i++)
16
CHECK
((children[i] =
exec
(
"child-linear"
)) != -1,
17
"exec \"child-linear\""
);
18
19
for
(i = 0; i <
CHILD_CNT
; i++)
20
CHECK
(
wait
(children[i]) == 0x42,
"wait for child %d"
, i);
21
}
wait
static void wait(struct intq *q, struct thread **waiter)
exec
pid_t exec(const char *file)
Definition:
syscall.c:79
pid_t
int pid_t
Process identifier.
Definition:
syscall.h:8
lib.h
CHECK
#define CHECK(SUCCESS,...)
Takes an expression to test for SUCCESS and a message, which may include printf-style arguments.
Definition:
lib.h:29
main.h
test_main
void test_main(void)
tests/main.h
Definition:
page-parallel.c:10
CHILD_CNT
#define CHILD_CNT
Runs 4 child-linear processes at once.
Definition:
page-parallel.c:7
Generated on Thu Nov 4 2021 19:31:01 for PKUOS - Pintos by
1.9.2