OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gdb/] [gdb-6.8/] [gdb-6.8.openrisc-2.1/] [gdb/] [testsuite/] [gdb.base/] [foll-fork.c] - Diff between revs 24 and 33

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 24 Rev 33
#include <stdio.h>
#include <stdio.h>
#include <unistd.h>
#include <unistd.h>
 
 
#ifdef PROTOTYPES
#ifdef PROTOTYPES
void callee (int i)
void callee (int i)
#else
#else
void callee (i)
void callee (i)
  int  i;
  int  i;
#endif
#endif
{
{
  printf("callee: %d\n", i);
  printf("callee: %d\n", i);
}
}
 
 
#ifdef PROTOTYPES
#ifdef PROTOTYPES
int main (void)
int main (void)
#else
#else
main ()
main ()
#endif
#endif
{
{
  int  pid;
  int  pid;
  int  v = 5;
  int  v = 5;
 
 
  pid = fork ();
  pid = fork ();
  if (pid == 0)
  if (pid == 0)
    {
    {
      v++;
      v++;
      /* printf ("I'm the child!\n"); */
      /* printf ("I'm the child!\n"); */
    }
    }
  else
  else
    {
    {
      v--;
      v--;
      /* printf ("I'm the proud parent of child #%d!\n", pid); */
      /* printf ("I'm the proud parent of child #%d!\n", pid); */
    }
    }
}
}
 
 

powered by: WebSVN 2.1.0

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