change delegation for to_read_description
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / foll-fork.c
1 #include <stdio.h>
2 #include <unistd.h>
3 #include <stdlib.h>
4
5 #ifdef PROTOTYPES
6 void callee (int i)
7 #else
8 void callee (i)
9 int i;
10 #endif
11 {
12 /* Any output corrupts GDB CLI expect strings.
13 printf("callee: %d\n", i); */
14 }
15
16 #ifdef PROTOTYPES
17 int main (void)
18 #else
19 main ()
20 #endif
21 {
22 int pid;
23 int v = 5;
24
25 pid = fork ();
26 if (pid == 0) /* set breakpoint here */
27 {
28 v++;
29 /* printf ("I'm the child!\n"); */
30 callee (getpid ());
31 }
32 else
33 {
34 v--;
35 /* printf ("I'm the proud parent of child #%d!\n", pid); */
36 callee (getpid ());
37 }
38
39 exit (0); /* at exit */
40 }
This page took 0.032628 seconds and 4 git commands to generate.