3 ms·
The version of cat.c here: http://www.scs.stanford.edu/histar/src/pkg/cat/cat.c http://www.scs.stanford.edu/histar/src/pkg/cat/cat.c has 255 lines in the source
by GFK_of_xmaspast 11y ago
The version of cat.c here: http://www.scs.stanford.edu/histar/src/pkg/cat/cat.c http://www.scs.stanford.edu/histar/src/pkg/cat/cat.c has 255 lines in the source, and brings in these headers:
#include <sys/param.h>
#include <sys/stat.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
which are needed for things like memory allocation, filesystem access, io, and so on.
One can imagine alternative implementations of cat that are full of #ifdefs to handle all the glorious varieties of unix that have ever been out there.