CS318 - Pintos
Pintos source browser for JHU CS318 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
}
lib.h
CHILD_CNT
#define CHILD_CNT
Runs 4 child-linear processes at once.
Definition:
page-parallel.c:7
CHECK
#define CHECK(SUCCESS,...)
Takes an expression to test for SUCCESS and a message, which may include printf-style arguments.
Definition:
lib.h:29
exec
pid_t exec(const char *file)
Definition:
syscall.c:79
arc4::i
uint8_t i
Definition:
arc4.h:11
wait
static void wait(struct intq *q, struct thread **waiter)
main.h
pid_t
int pid_t
Process identifier.
Definition:
syscall.h:8
test_main
void test_main(void)
tests/main.h
Definition:
page-parallel.c:10
Generated on Thu Aug 22 2019 10:19:15 for CS318 - Pintos by
1.8.16