Question: #includesys/types.h #include #include #include #include linux/sched.h> int g-2: int sub func(void arg) 9 g 100: printf(I am a new child as a thread: my process

 #includesys/types.h #include #include #include #include linux/sched.h> int g-2: int sub func(void

#includesys/types.h #include #include #include #include linux/sched.h> int g-2: int sub func(void arg) 9 g 100: printf("I am a new child as a thread: my process id is: %d g5%d ", getpido. 9): printf("My parent process id is: %d ", getppid()); / return O int main(void) int I 3: printf("PID(%d) : Parent g5%d, l:%d ", getpid(), g, l): int "dynamic malloc(4096 sizeof(int)) //statement A clone (sub_func, (void"Xdynamic 4095), CLONE VM I CLONE_THREAD I CLONESIGHAND, NULL): //statement B sleep(1) printf("PID(%d) : Parent g5%d, l5%d ", getpid(), g, l): return C (a) Compile (with or without #include-linux/sched.h>), and briefly explain why you may have compile errors/warnings without #include (b) After successfully compile the program, executeclone (c) Show the values of g and I printed by the parent process and the child process (by the clone0 system call). Explain why you get those values

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!