1 /*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 */ 7 8 #ifndef lint 9 static char copyright[] = 10 "@(#) Copyright (c) 1989, 1993\n\ 11 The Regents of the University of California. All rights reserved.\n"; 12 #endif /* not lint */ 13 14 #ifndef lint 15 static char sccsid[] = "@(#)x.c 8.1 (Berkeley) 06/04/93"; 16 #endif /* not lint */ 17 18 main() 19 { 20 register int i; 21 22 for (i = 0; i < 100000; i++) 23 if (vfork() == 0) { 24 printf("child: %d\n", getpid()); 25 exit(0); 26 } else { 27 printf("parent: %d\n", getpid()); 28 wait(0); 29 } 30 } 31