Question: Using C make a program that creates a child process and the child process prints when it is created and then goes into a infinite

Using C make a program that creates a child process and the child process prints when it is created and then goes into a infinite loop to wait for a signal. In the main function for the parent process, list several signals the the user can choose from to send to the child process, get the number for the signal from the user, and send it to the child process. When the child process receives a signal, print out that it has and which signal it received. Have the parent process wait on the child to process to finish and then print out "All done!"

Example runs:

Child process created!

Enter the number for the signal you want to send.

SIGHUP 1

SIGINT 2

SIGFPE 8

SIGSEGV 11

SIGTERM 15

Number: 1

Child process received signal: SIGHUP

All done!

Child process created!

Enter the number for the signal you want to send.

SIGHUP 1

SIGINT 2

SIGFPE 8

SIGSEGV 11

SIGTERM 15

Number: 8

Child process received signal:

SIGFPE All done!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!