gdb-intro-kwlug/examples/points/catch.c

32 lines
329 B
C
Raw Normal View History

/* catch.c -- Example for 'catch fork' and 'catch syscall'. */
#include <stdio.h>
#include <unistd.h>
void
test (void)
{
if (fork () == 0)
printf ("Child\n");
fork ();
}
void
another_test (const char *p)
{
chdir (p);
}
int
main (int argc, char **argv)
{
int a;
test ();
another_test (".");
return 0;
}