2005-04-21 16:53:53 +02:00
|
|
|
/* 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
|
2011-12-16 15:45:53 +01:00
|
|
|
#define MAX_ERROR 2
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2011-12-16 15:45:53 +01:00
|
|
|
#include "common.c"
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
_PROTOTYPE(int main, (void));
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
register int i;
|
|
|
|
int k;
|
|
|
|
|
2011-12-16 15:45:53 +01:00
|
|
|
start(12);
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
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 */
|
|
|
|
}
|
|
|
|
|