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 05:00
Are special characters that allow you to search for multiple words at the same time.
Answers: 2
question
Computers and Technology, 22.06.2019 20:10
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
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, 24.06.2019 02:30
Which option completes the explanation for conflict of interest in an organization
Answers: 1
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
question
Advanced Placement (AP), 05.04.2021 04:00
Questions on the website: 13722361