URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
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); */
|
}
|
}
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.