1 #include <unistd.h> 2 3 extern void print (char *); 4 5 #define PRINT_LOOP 10 6 7 void 8 th_main (char * arg) 9 { 10 int i; 11 for (i=0; i<PRINT_LOOP; i++) 12 print (arg); 13 } 14 15 int main (int argc, char ** argv) 16 { 17 if (argc != 1) 18 { 19 th_main ("aaa"); 20 return 0; 21 } 22 23 if (!vfork ()) 24 execlp (argv[0], argv[0], "", NULL); 25 th_main ("bbb"); 26 27 return 0; 28 } 29