[gdb/syscalls] Sync with strace v6.13
[binutils-gdb.git] / gdb / testsuite / gdb.base / execd-prog.c
blob39cb210e0760e2aed58ee33cb83af7b7f7a6ec14
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <unistd.h>
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;
11 int main (int argc, char **argv)
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.
17 int local_j = argc; /* after-exec */
18 char * s;
20 printf ("Hello from execd-prog...\n");
21 if (argc != 2)
23 printf ("expected one string argument\n");
24 exit (-1);
26 s = argv[1];
27 printf ("argument received: %s\n", s);
29 return 0;