aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.hp/follow-exec.c
blob: c51fa52dcfd4b388d24ef054d9beaab995a12629 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdio.h>

int  global_i = 100;

main ()
{
  int  local_j = global_i+1;
  int  local_k = local_j+1;

  printf ("follow-exec is about to execlp(execd-program)...\n");

  execlp ("gdb.hp/execd-program",
          "gdb.hp/execd-program",
          "execlp arg1 from follow-exec",
          (char *)0);

  printf ("follow-exec is about to execl(execd-program)...\n");

  execl ("gdb.hp/execd-program",
         "gdb.hp/execd-program",
         "execl arg1 from follow-exec",
         "execl arg2 from follow-exec",
         (char *)0);

  {
    static char * argv[] = {
      "gdb.hp/execd-program",
      "execv arg1 from follow-exec",
      0};

    printf ("follow-exec is about to execv(execd-program)...\n");

    execv ("gdb.hp/execd-program", argv);
  }
}