IO blocking routines rewritten - hopefully adequate now.