Part of
the homework for 22C:112, Spring 2008
by
Douglas W. Jones
THE UNIVERSITY
OF IOWA
Department of Computer Science
Background: The shell command cat f copies file f to standard output by opening the file and reading it using a sequence of calls to the read() system service.
Linux (and several other Unix variants) allow a second mechanism to read a file. The mmap() system service can be used to map a file into the virtual address space of a running program. (use the shell command man to get documentation.)
In Linux and other Unix variants, you can get the size of an open file by calling lseek(fd,0,SEEK_END).
The Assignment: