Signals C Write Two Programs Named Pingc Pongc Ping Iterate Sending Sigusr1 Sigusr2 Pong P Q37030703

Signals in C

Write two programs named ping.c, pong.c. The ping will iteratebetween sending SIGUSR1 and SIGUSR2 to pong, when pong receives thesignal from ping, it will print “#: pong received signal # fromping” and it will send SIGUSR2 to ping if it received SIGUSR1 orSIGUSR1 if it received SIGUSR2. When ping receives a signal frompong, it will print “#: ping received signal # from pong”.(you mayuse sleep function to slowdown the execution of the program). Thetwo processes are independent.

EXAMPLE

Terminal 1:

./ ping

0: ping received signal 12 from pong

1: ping received signal 10 from pong

2: ping received signal 12 from pong

3: ping

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.