SIGIO appears to be edge triggered, therefore we need to read continuously until no more data is available