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 06:00
What are the most likely causes of conflict at the meeting? check all that apply.
Answers: 1
question
Computers and Technology, 22.06.2019 10:20
Shown below is the start of a coding region within the fist exon of a gene. 5'--3' 3'--5' how many cas9 pam sequences are present?
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
Donna and her team of five have invented a new gadget for the science exhibition in their college. which intellectual property right will protect their invention?
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Jennifer has to set up a network in a factory with an environment that has a lot of electrical interference. which cable would she prefer to use? jennifer would prefer to use because its metal sheath reduces interference.
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
History, 14.04.2020 10:35
question
Geography, 14.04.2020 10:35
question
Mathematics, 14.04.2020 10:36
question
Biology, 14.04.2020 10:36
question
Mathematics, 14.04.2020 10:37
Questions on the website: 13722363