1#include "common.h"
2#include <cstdio>
3#include <cstdlib>
4#include <sys/wait.h>
5#include <unistd.h>
6
7char* bench_name;
8int bench_pno = -1;
9int bench_no = 0;
10int bench_run = 0;
11timeval_t tv, ttv;
12timezone_t tz;
13
14void bench_kernel()
15{
16 RUN_BENCH("FORK", 3)
17 {
18 for (int i = 0; i < 20; i++) {
19 int pid = fork();
20 if (pid < 0) {
21 return;
22 }
23 if (pid) {
24 wait(pid);
25 } else {
26 exit(0);
27 }
28 }
29 }
30}
31
32int main(int argc, char** argv)
33{
34 bench_kernel();
35 bench_pngloader();
36 printf("[BENCH END]\n\n");
37 fflush(stdout);
38 return 0;
39}