Like will be given instantly urgently please #include #include #include #include int main() {int newpid;printf("before: mypid is %d\n", getpid();if ((newpid = fork() == -1)perror("fork");else if...

Like will be given instantly urgently pleaseQuestion 1<br>In the code
#include #include #include #include int main() { int newpid; printf("before: mypid is %d\n", getpid(); if ((newpid = fork() == -1) perror("fork"); else if (newpid == 0}{ printf("l am the child %d now sleeping...\n",getpid()3; sleep(5); abort(); else( printf("l am the parent %d\n",getpid(); int status; int child_pid = wait(&status); printf("My child %d has terminated\n",child_pid); printf("l have received the status = %\n",status); int child_status = status >> 8; int signal = status & OX7F; int core = status & Ox80; printf("Child status = %d Signal = %d Core = %d\n", child_status, signal, core); "/>
Extracted text: Question 1 In the code "abort.c" (posted under Process Control), it uses hard-coded bit-manipulation to access the child process termination status. Rewrite this code using the bit-manipulation macros discussed in the lecture. Submit the source code and script files. PLEASE COMPLETE IN C abort.c #include #include #include #include #include int main() { int newpid; printf("before: mypid is %d\n", getpid(); if ((newpid = fork() == -1) perror("fork"); else if (newpid == 0}{ printf("l am the child %d now sleeping...\n",getpid()3; sleep(5); abort(); else( printf("l am the parent %d\n",getpid(); int status; int child_pid = wait(&status); printf("My child %d has terminated\n",child_pid); printf("l have received the status = %\n",status); int child_status = status >> 8; int signal = status & OX7F; int core = status & Ox80; printf("Child status = %d Signal = %d Core = %d\n", child_status, signal, core);
Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here