source: liacs/os/assignment1/parent0.c@ 95

Last change on this file since 95 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
RevLine 
[2]1/* version 0 ; sys name: parent0.c a simple parent
2child will be created;
3exact copy of parent;
4shares hardly anything with parent;
5child and parent share files though but no data/vars etc;
6child has its own address space.
7In this version we don't change the core image for the
8child 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
18int 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.