Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Version II void handler(int signum) gn (e, -3); int main (void) int i, p[2], writefd[4]; pid t pid[4]; signal(SIGUSR1, handler) for(1-8; i 0) kill (pid[i],
Version II void handler(int signum) gn (e, -3); int main (void) int i, p[2], writefd[4]; pid t pid[4]; signal(SIGUSR1, handler) for(1-8; i 0) kill (pid[i], SIGUSR1); gnl(i, pid[i]); close(p[e]) writefd[i] P[1] write(writefd[1], &pid[9], sizeof(pid_t)) close(writefd[3]); wait(NULL); write(writefd[2], &pid[1], sizeof(pid_t)) gn1(-1,-2); return 0; Version II void handler(int signum) gn (e, -3); int main (void) int i, p[2], writefd[4]; pid t pid[4]; signal(SIGUSR1, handler) for(1-8; i 0) kill (pid[i], SIGUSR1); gnl(i, pid[i]); close(p[e]) writefd[i] P[1] write(writefd[1], &pid[9], sizeof(pid_t)) close(writefd[3]); wait(NULL); write(writefd[2], &pid[1], sizeof(pid_t)) gn1(-1,-2); return 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started