Gak, the days before select.    I remember writing some terminal programs where I had to fork and do the synchronous read in each direction separately.