| 1 |
/*********************************************************************** |
| 2 |
* Code listing from "Advanced Linux Programming," by CodeSourcery LLC * |
| 3 |
* Copyright (C) 2001 by New Riders Publishing * |
| 4 |
* See COPYRIGHT for license information. * |
| 5 |
***********************************************************************/ |
| 6 |
|
| 7 |
#include <stdio.h> |
| 8 |
#include <unistd.h> |
| 9 |
|
| 10 |
int main () |
| 11 |
{ |
| 12 |
printf ("The process id is %d\n", (int) getpid ()); |
| 13 |
printf ("The parent process id is %d\n", (int) getppid ()); |
| 14 |
return 0; |
| 15 |
} |