Question: Task 2 : read Write a small C program that opens a file ( / usr / lib / locale / locale - archive on
Task : read
Write a small C program that opens a file usrliblocalelocalearchive on the department servers is a reasonable choice due to its size; though it is rather small by today's standards and reads the contents of that file using the read system call. Write this code in a manner that allows you to easily change the number of bytes read use a #define for the array size and argument to read
Your program must not print anything doing so will skew the timings discussed below
Run this program with sizes and yes all of these; it shouldn't take that long and record the running time with the time program on the commandline eg at the prompt, type time a out and record the "real" time Plot the results; can you infer any characteristics about the system?
Task : fread
Copy your program from above and modify it to use the fread library function in place of the read system call and fopen instead of open
Run the program with the same sizes and above and plot the execution times.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
