Answered step by step
Verified Expert Solution
Question
1 Approved Answer
TEST.FILE IS A RANDOM TEXT FILE. I AM UNABLE TO ATTATCH IT HERE. Assignment: Write six C programs AA.c, BB.c, CC.c, DD.c, EE.c and FF.c,
TEST.FILE IS A RANDOM TEXT FILE. I AM UNABLE TO ATTATCH IT HERE.
Assignment: Write six C programs AA.c, BB.c, CC.c, DD.c, EE.c and FF.c, with executable codes in files AA, BB, CC, DD, EE and FF, that function as follows: 1. First you run your code AA (as a process, call it Process A). Process A creates three processes a process with code BB (call it Process B), a process with code CC (call it Process C1) and another process with code CC (call it Cla). Then Process A waits one of its children to terminate. 2. Process B creates file "XYZ.txt" and writes the last 200 characters from file test.file (the one from Labl) into it, and then it terminates. 3. Process C1 enters infinite loop (include "uslecp(100)" in cach loop iteration). 4. Process Cla enters infinite loop 5. When process A continues, it creates three new processes: a process with code DD, call it Process D, a process with code CC, call it Process C2, and a process with code EE, cll it Process E. Then Process A waits for Process D to terminate. 6. Process E reads file XYZtxt, character by character, and each character is printed as read. Then Process E deletes the file and terminates. 7. Process D creates a process with code CC,c sec (use system call "usleep"). it Process C3, and then Process D waits for 0.5 8. When Process D continues, it creates new process which executes Unix command: ps -u user- name user-name your user name 9. Process D waits for ps process to terminate, then it kills its second child (Process C3) and then it exits. 10. Process A now continues. It kills its remaining three child processes (CI, Cla and C2) and sleeps for 0.25 sec 11. When is awaken, Process A prompts for an arbitrary string of characters and you are to provide it from a keyboard. Then Process A prompts for an arbitrary integer and you are to provide it from a keyboard; For reading a value for an integer above (named say xyzlnteger) use the following C statements: int xyzlnteger scanf("%d", &xyzinteger 12. Then, Process A creates new process from code FF (call it Process F). Then Process A terminates. Assignment: Write six C programs AA.c, BB.c, CC.c, DD.c, EE.c and FF.c, with executable codes in files AA, BB, CC, DD, EE and FF, that function as follows: 1. First you run your code AA (as a process, call it Process A). Process A creates three processes a process with code BB (call it Process B), a process with code CC (call it Process C1) and another process with code CC (call it Cla). Then Process A waits one of its children to terminate. 2. Process B creates file "XYZ.txt" and writes the last 200 characters from file test.file (the one from Labl) into it, and then it terminates. 3. Process C1 enters infinite loop (include "uslecp(100)" in cach loop iteration). 4. Process Cla enters infinite loop 5. When process A continues, it creates three new processes: a process with code DD, call it Process D, a process with code CC, call it Process C2, and a process with code EE, cll it Process E. Then Process A waits for Process D to terminate. 6. Process E reads file XYZtxt, character by character, and each character is printed as read. Then Process E deletes the file and terminates. 7. Process D creates a process with code CC,c sec (use system call "usleep"). it Process C3, and then Process D waits for 0.5 8. When Process D continues, it creates new process which executes Unix command: ps -u user- name user-name your user name 9. Process D waits for ps process to terminate, then it kills its second child (Process C3) and then it exits. 10. Process A now continues. It kills its remaining three child processes (CI, Cla and C2) and sleeps for 0.25 sec 11. When is awaken, Process A prompts for an arbitrary string of characters and you are to provide it from a keyboard. Then Process A prompts for an arbitrary integer and you are to provide it from a keyboard; For reading a value for an integer above (named say xyzlnteger) use the following C statements: int xyzlnteger scanf("%d", &xyzinteger 12. Then, Process A creates new process from code FF (call it Process F). Then Process A terminatesStep 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