Last change
on this file since 202 was 2, checked in by Rick van der Zwet, 15 years ago |
Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)
|
File size:
662 bytes
|
Rev | Line | |
---|
[2] | 1 | /* version 0 ; sys name: parent0.c a simple parent
|
---|
| 2 | child will be created;
|
---|
| 3 | exact copy of parent;
|
---|
| 4 | shares hardly anything with parent;
|
---|
| 5 | child and parent share files though but no data/vars etc;
|
---|
| 6 | child has its own address space.
|
---|
| 7 | In this version we don't change the core image for the
|
---|
| 8 | child process. */
|
---|
| 9 | /*
|
---|
| 10 | #include <sys/wait.h>
|
---|
| 11 | #define NULL 0
|
---|
| 12 | */
|
---|
| 13 |
|
---|
| 14 | #include <stdio.h>
|
---|
| 15 | #include <unistd.h>
|
---|
| 16 | #include <stdlib.h>
|
---|
| 17 |
|
---|
| 18 | int main (void) {
|
---|
| 19 | int pidValue = fork();
|
---|
| 20 | printf("the value which is returned by fork: %d \n",
|
---|
| 21 | pidValue);
|
---|
| 22 | printf("pid: %d \n", getpid());
|
---|
| 23 | printf("Process[%d]: Parent or Child! terminating ... \n",
|
---|
| 24 | getpid());
|
---|
| 25 | exit(0);
|
---|
| 26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.