Question: Code in C according to following program Post with photos . 1 INSTRUCTIONS Use Linux as your working OS. Read all the questions before you


Code in C according to following program Post with photos .
1 INSTRUCTIONS Use Linux as your working OS. Read all the questions before you begin coding. A server program is one that provides services. That is, it takes requests from client programs and provides a response. 2 QUESTIONS Total Marks: 15 (1) Write a server program that prints the contents of a file name sent to it. A client must accept the desired file name from the user and send it to the server. The program must be invoked using one executable - however, the client and the server must run as separate processes. The exectuable will accept one file name and print its contents. The user quits the program using the special string END. That is, the user types END when asked for a file name, if he wants to stop the program. Use shared memory to communicate the file name between the client and the server. Make sure that there are no orphan processes due to your program. Test your program using small text files. [5 Marks] (2) Make a copy of the above program and modify it such that the client and the server run as separate executables, The server must always run. The user will restart only the client and not the server for each run of the program Only one client will run at a time. [5 Marks] (3) Write a program to find the time taken to execute the program in test.c, which is attached. The file test.c must not be modified. The contents of test.c must not be copied to your program (assume that only its executable is available to you) (5 marks) Example output: ./a.out Waited for a long time Time taken=1.668945 s Hint: Use clock_gettime() to get the current time. test.c #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
