Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Requires Linux P1.c program #include #include #include int main (int argc, char *argv[]) { int printChar; if (argc != 2) { fprintf(stderr, usage: %s character

Requires Linux

P1.c program

#include #include #include

int main (int argc, char *argv[]) { int printChar;

if (argc != 2) { fprintf(stderr, "usage: %s character ", argv[0]); exit(1); }

printChar = argv[1][0]; int i = 1;

while (i

return 0; } image text in transcribed

1. Send your SECOND P1 a Continue signal (SIGCONT) from the keyboard by using the fg command (foreground) with the appropriate job_number, as in the following, assuming 4 is the job_number (use your own job_number, which you can see with the jobs command.): > fg %4 Now you should have the second P1 in the foreground, and the first P1 stopped. Now terminate both processes (using as many steps as you need to). What commands did you use to terminate them?

2. Open a second shell window. FROM THIS SECOND WINDOW, use the -u option with the ps command to obtain both your P1 process_ids. FROM YOUR SECOND SHELL WINDOW, terminate both your P1 processes by sending them each a SIGINT signal. What commands did you use?

3. Briefly describe the difference between SIGINT and SIGKILL (try google or man -7 signal in bash shell).

4. In question 1 above, the fg command was used to make a process resume. You could also get the process to resume by sending it the continue signal (SIGCONT), with your own PID, as in: > kill -SIGCONT PID

In the first shell window, run P1 with appropriate argument. In the second window, use ps to obtain the process_id of P1. FROM THE SECOND SHELL WINDOW: stop P1 continue (resume) P1 stop P1 continue (resume) P1 terminate P1 What commands did you use?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

More Books

Students also viewed these Databases questions

Question

1. Select the job or jobs to be analyzed.

Answered: 1 week ago