P09 lab code added
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
//***************************************************************************
|
||||
// File: ProcA4.c
|
||||
// Original Author: M. Thaler (Modul BSY)
|
||||
//***************************************************************************
|
||||
|
||||
//***************************************************************************
|
||||
// system includes
|
||||
//***************************************************************************
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
//***************************************************************************
|
||||
// Function: main(), parameter: none
|
||||
//***************************************************************************
|
||||
|
||||
int main(void) {
|
||||
fork();
|
||||
fork();
|
||||
fork();
|
||||
fork();
|
||||
printf("PID: %d\t PPID: %d\n", getpid(), getppid());
|
||||
sleep(10); // keep processes in system to display their "stammbaum"
|
||||
exit(0);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
@@ -0,0 +1,27 @@
|
||||
# *************************************************************
|
||||
# Original Autor: M. Thaler (Modul BSY)
|
||||
# *************************************************************
|
||||
|
||||
CMP= gcc
|
||||
CMPFLAGS= -Wall
|
||||
LDFLAGS=
|
||||
EXENAMES= ProcA3.e
|
||||
FNAME= ProcA3
|
||||
LIBNAME=
|
||||
|
||||
$(EXENAMES): $(FNAME).o
|
||||
$(CMP) $(FNAME).o $(LIBNAME) $(LDFLAGS) -o $@
|
||||
|
||||
.c.o:
|
||||
$(CMP) -c $(CMPFLAGS) $<
|
||||
|
||||
.cc.o:
|
||||
$(CMP) -c $(CMPFLAGS) $<
|
||||
|
||||
clean:
|
||||
rm -f *.o $(EXENAMES)
|
||||
|
||||
all:
|
||||
@make clean
|
||||
@make
|
||||
|
||||
Reference in New Issue
Block a user