OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.base/] [foll-fork.c] - Blame information for rev 24

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
#include <stdio.h>
2
#include <unistd.h>
3
 
4
#ifdef PROTOTYPES
5
void callee (int i)
6
#else
7
void callee (i)
8
  int  i;
9
#endif
10
{
11
  printf("callee: %d\n", i);
12
}
13
 
14
#ifdef PROTOTYPES
15
int main (void)
16
#else
17
main ()
18
#endif
19
{
20
  int  pid;
21
  int  v = 5;
22
 
23
  pid = fork ();
24
  if (pid == 0)
25
    {
26
      v++;
27
      /* printf ("I'm the child!\n"); */
28
    }
29
  else
30
    {
31
      v--;
32
      /* printf ("I'm the proud parent of child #%d!\n", pid); */
33
    }
34
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.