1-Which of the following are valid possible outputs for the program?
Answer-Option-(E) BCDA
2- If you run this program, how many processes will be created (parent + # of children)?
Answer-There is basically 2 child processes in the program 1 parent .
3-If printf ("E" ) ; 1s inserted on Line 18, how many times will E print?
Answer- 1 time
2Processes. Use the following assumptions to answer the questions: » All processes run to completion and no system calls will fail printf ( is atomic and calls fflush (stdout) after printing argument...
1. (20 pts.) Consider the following C program. Assume that all functions complete successfully. Complete the Process Model, given that the process id's (pids) are as shown for each process created. Fill in the boxes for each variable, p1 and p2, showing how the values change in each process. Just cross out old values (don't erase). int main ) Process Model int p1 = o, p2-0; pl-fork ) if (pl !# 0) p2 fork ( ); if (plp2 0) printf...
Directions: use only the signal mechanism system calls don’t use ( wait() or pipe() )in this problem. You can still read/write from/to a file. You must use ( kill() and pause() ) system calls. rewrite code below to do kill and pause system calls #include <fcntl.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/wait.h> // Function ptototypes int readX(); void writeX(int); int main() { int pid; // pid: used to keep track of the child process int x...
GIVEN CODE- FILL IN THE
BLANK!
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
// Function ptototypes
int readX();
void writeX(int);
int main() /// chi read x ---> divi ---> write x into file
---> par read x --> sub--> write x into file---> chi
read x-->etc
{
int pid;
// pid: used to keep track of the child
process
int x = 19530; // x:
our value as integer
...