As usual, keep a log in the file lab6.txt of what you do in the lab so that you can reproduce the results later. This should not merely be a transcript of what you typed: it should be more like a true lab notebook, in which you briefly note down what you did and what happened.
For this laboratory, you will implement the same program using both buffered and unbuffered I/O, and compare the resulting implementations and performance.
Rewrite the binsort program you wrote for Homework 6 so that it uses system calls rather than <stdio.h> to do its I/O. If standard input is a regular file, your program should initially allocate enough memory to hold all the data in that file all at once, rather than the usual algorithm of reallocating memory as you go. However, if the regular file grows while you are reading it, your program should still work, by allocating more memory after the initial file size has been read.
Call the rewritten program binsortu. Measure any differences in performance between binsort and binsortu using the time command.
Submit the following files.
All files should be ASCII text files, with no carriage returns, and with no more than 200 columns per line. The C source file should contain no more than 132 columns per line. The shell commands
expand lab6.txt binsort.txt | awk '/\r/ || 200 < length' expand catb.c catu.c binsort.c | awk '/\r/ || 132 < length'
should output nothing.