Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to write three process in c language. to apply it in linx terminal Write Program for: a three separate HIERM Proc A SIGIERM

image text in transcribed

I need to write three process in c language. to apply it in linx terminal

image text in transcribed

image text in transcribed

image text in transcribed

Write Program for: a three separate HIERM Proc A SIGIERM SIGIERM SIGUSR1 (Proca SIGUSR2 (conut Up to Nchar PB Reat char from keyboard Process A Will be the parent. Process B read character send signal to A. and process A sends signal to process c to count the characters after after N number process A Sends signal to terminate both Proceres using for kol GNU nano 2.4 Sinclude #include #include #include #include #include sig atomic t sigusrl count=0; void handler (int signal number), { ++sigusri count; ring) int main() memset (esimler=shandleri ); toid() ; struct sigaction sa; memset (&sa, , sizeof (sa)); sa.sa handler=&handler; Compex 50 sigaction (IOR , &sa, ); printf("parent pid:%d ", (int)getpid()); sleep(20); -g.pdf return 0; File Edit View proi Search Tools Documents Help C X o o a #include #include #include #include #include #include #include sig_atomic t counterr= int z; void handler(int signal number) { ++Counterr; if(counterr==2) kill((int)getppid, SIGUSR2) int main(int arge, chart argvu z=(int)argv[1]; struct sigaction sa; memset(&sa,, sizeof(sa)) sa.sa_handler=&handler sigaction (SIGUSR1,&sa, NULL return ; process C Process A SIGTERM Process A SIGTERM SIGTERM SIGUSR2 SIGUSR1 SIGUSR2 Process b Process Count up to N char Read character from Process Bread character, send signal to A, A sends signal to c, to count the characcters, after N numbers process A sends a signal to teminate both processes Process A will be the parent. Process A takes argument N, then sends N to process C. * learn forks *exec() function Handler Sign and sig2 in process A Kill pid, SIGTERM) kills a process because of SIGTERM, you can change it SIGUSR1 and something else will happen Write Program for: a three separate HIERM Proc A SIGIERM SIGIERM SIGUSR1 (Proca SIGUSR2 (conut Up to Nchar PB Reat char from keyboard Process A Will be the parent. Process B read character send signal to A. and process A sends signal to process c to count the characters after after N number process A Sends signal to terminate both Proceres using for kol GNU nano 2.4 Sinclude #include #include #include #include #include sig atomic t sigusrl count=0; void handler (int signal number), { ++sigusri count; ring) int main() memset (esimler=shandleri ); toid() ; struct sigaction sa; memset (&sa, , sizeof (sa)); sa.sa handler=&handler; Compex 50 sigaction (IOR , &sa, ); printf("parent pid:%d ", (int)getpid()); sleep(20); -g.pdf return 0; File Edit View proi Search Tools Documents Help C X o o a #include #include #include #include #include #include #include sig_atomic t counterr= int z; void handler(int signal number) { ++Counterr; if(counterr==2) kill((int)getppid, SIGUSR2) int main(int arge, chart argvu z=(int)argv[1]; struct sigaction sa; memset(&sa,, sizeof(sa)) sa.sa_handler=&handler sigaction (SIGUSR1,&sa, NULL return ; process C Process A SIGTERM Process A SIGTERM SIGTERM SIGUSR2 SIGUSR1 SIGUSR2 Process b Process Count up to N char Read character from Process Bread character, send signal to A, A sends signal to c, to count the characcters, after N numbers process A sends a signal to teminate both processes Process A will be the parent. Process A takes argument N, then sends N to process C. * learn forks *exec() function Handler Sign and sig2 in process A Kill pid, SIGTERM) kills a process because of SIGTERM, you can change it SIGUSR1 and something else will happen

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions