blob: ff90822d6201f0474ff8b09c92b5f89211572d86 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/* test 12 */
/* Copyright (C) 1987 by Martin Leisner. All rights reserved. */
/* Used by permission. */
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#define NUM_TIMES 1000
int max_error = 2;
#include "common.h"
int main(void);
int main()
{
register int i;
int k;
start(12);
for (i = 0; i < NUM_TIMES; i++) switch (fork()) {
case 0: exit(1); break;
case -1:
printf("fork broke\n");
exit(1);
default: wait(&k); break;
}
quit();
return(-1); /* impossible */
}
|