minix/test/test12.c
Ben Gras 5977114c42 tests cleanup
. make common.o link with the tests instead of being
	  #included as common.c
	. fix warnings about missing prototypes by declaring functions
	  static
	. reduces some duplicated code

Change-Id: Ic2a765d7f5886add5863190efec3fdd2d2ea2137
2013-04-17 22:00:59 +00:00

38 lines
570 B
C

/* 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 */
}