1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <unistd.h> 4 5 /* There is a global_i in foll-exec, which exec's us. We 6 should not be able to see that other definition of global_i 7 after we are exec'd. 8 */ 9 int global_i = 0; 10 11 int main (int argc, char **argv) 12 { 13 /* There is a local_j in foll-exec, which exec's us. We 14 should not be able to see that other definition of local_j 15 after we are exec'd. 16 */ 17 int local_j = argc; /* after-exec */ 18 char * s; 19 20 printf ("Hello from execd-prog...\n"); 21 if (argc != 2) 22 { 23 printf ("expected one string argument\n"); 24 exit (-1); 25 } 26 s = argv[1]; 27 printf ("argument received: %s\n", s); 28 } 29