Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / gdb6 / gdb / testsuite / gdb.base / foll-exec.c
blob1b760903dd70a2e9b22103a131bd9439815c8d49
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <unistd.h>
4 #include <string.h>
7 int global_i = 100;
9 #ifdef PROTOTYPES
10 int main (void)
11 #else
12 main ()
13 #endif
15 int local_j = global_i+1;
16 int local_k = local_j+1;
18 printf ("foll-exec is about to execlp(execd-prog)...\n");
20 execlp ("gdb.base/execd-prog",
21 "gdb.base/execd-prog",
22 "execlp arg1 from foll-exec",
23 (char *)0);
25 printf ("foll-exec is about to execl(execd-prog)...\n");
27 execl ("gdb.base/execd-prog",
28 "gdb.base/execd-prog",
29 "execl arg1 from foll-exec",
30 "execl arg2 from foll-exec",
31 (char *)0);
34 static char * argv[] = {
35 (char *)"gdb.base/execd-prog",
36 (char *)"execv arg1 from foll-exec",
37 (char *)0};
39 printf ("foll-exec is about to execv(execd-prog)...\n");
41 execv ("gdb.base/execd-prog", argv);