Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / pmax / test / t07.c
blob09075aa5334aeedbd208da8aa7511541e8fdd6a5
1 int foo;
2 int foo1;
4 main(argc, argv)
5 char **argv;
7 int i, j;
9 for (i = 0; i < 10; i++) {
10 printf("main: bla %d pid %d\n", j = bla(), getpid());
11 if (j == 1)
12 exit(0);
16 bla()
18 int i;
20 foo = 0;
21 switch(fork()) {
22 case 0: /* child */
23 foo = 30;
24 for (i = 0; i < 10; i++) {
25 printf("child %d, foo %d\n", i, foo);
26 bar(foo);
27 foo++;
29 return(1);
31 case -1:
32 perror("fork");
33 return(2);
35 default:
36 for (i = 0; i < 10; i++) {
37 printf("parent %d foo %d\n", i, foo);
38 bar(foo);
39 foo++;
41 return(0);
45 bar(a)
47 printf("bar(%d) pid %d\n", a, getpid());