subject

Suppose we have a program that calls two functions do_f1() and do_f2() in that order. a. After calling do_f1(), it sends SIGSUR1 signal to its parent.
b. Before calling do_f2 (), it waits for SIGUSR2 signal, which will be sent from another process, so don't worry about who sends the signal SIGUSR2.
You are asked to implement this program and use sigsuspend() to wait for a signal.
// all the necessary libraries are included
do f1() { /* ... */ } /* Suppose these functions are already */
do_f2() { /* ... */} /* implemented for you. So, just use them */
static int sigreceived = 0;
void my_sig_handler (int signo) {
sigreceived = 1;
}
void main() {
struct sigaction act;
sigset_t blockmask, sigmask;
do f1() ;
/* (a) show how to send SIGUSR1 to the parent process */
/* (b) show how to set up the necessary structures and masks and then wait for SIGUSR2 using sigsuspent() */
do_f2();
}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
For her science class, elaine is creating a presentation on weather in the united states. she wants to make the presentation beautiful and interesting by drawing simple cloud or wave shapes. which is the best way for elaine to draw these shapes?
Answers: 1
question
Computers and Technology, 23.06.2019 01:30
Which tab is used to change the theme of a photo album slide show? a. design b. view c. transitions d. home
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
Which statistical function in a spreadsheet you to see how far each number varies, on average, from the average value of the list?
Answers: 2
question
Computers and Technology, 23.06.2019 22:30
Lakendra finished working on her monthly report. in looking it over, she saw that it had large blocks of white space. what steps could lakendra take to reduce the amount of white space?
Answers: 3
You know the right answer?
Suppose we have a program that calls two functions do_f1() and do_f2() in that order. a. After call...
Questions