SOLVED:Computer Systems Project 6

$55.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (5 votes)

turnin code: cs_p6

Have your main program do this:

alarm(90);
p6siggy(); // linked from our public directory (see below)
while ( ! done) // done is a global flag init’d to false
sleep(1);

Each time the program receives any of these signals:
SIGHUP
SIGTERM
SIGUSR1
SIGUSR2
it should print:
received SIGxxxx where xxxx is replaced by the name of the signal.

For SIGTERM, in addition to the print above, the handler should set the done
flag to true and then main should terminate with return code 222.

At the end, your program should print:
HANDLED usr1 A usr2 B hup C term D
where A, B, C, D are replaced by the number of type of signal that
you handled.
Also, print:
TOTAL HANDLED N
where N is replaced by the total number of signals handled.

Your program should link with a function named p6siggy from:
/nfshome/rbutler/public/courses/cs/p6siggy.o

——–

TURNIN info:
You should submit a tar file of a directory which contains all of the
required files (makefile, C source files, header files, etc).
Sample tar command to create a tar file from a dir:
tar cvf p6.tar ./p6dir ## do *NOT* use full pathname of the dir
After un-tarring the project, we will cd to the dir containing it and type:
rm -rf p6
rm -f *.o
make
It should build an executable named p6.

********
The submitted file must:
– be a tar file
– un-tar into the *correct* set of files (above)
– build an executable named p6
else it will NOT be graded further.
********