Use read(2) and implement cat(1).