These patches enable AIO and listio in tlibio.c for linux, mostly by reusing code that is already in tlibio.c, and makes non-blocking read()/write() actually work. Also, they change pipeio.c to use this. Comments:
1) Patch 0001 enables aio and other types of io in tlibio.c code. Note that this means programs using functions from tlibio need linking with libaio and librt,
2) Patch 0002 changes non-blocking io in tlibio, so that it doesn't report EAGAIN to the client, but rather waits with select() for the io to become available (it would be possible extend this by adding more wait types). Also, it makes some minor changes to pipeio to make it work (eg. make opening the pipe always block, regardless of non-blocking setting).
3) Patch 0003 adds a semaphore to pipeio, to ensure all children have opened their pipes before reading & writing takes place. This avoids situations where one child gets to open the pipe after the parent deleted it (eg. because of an error). Also, it should eliminate all empty reads.
4) Patch 0004 changes error handling in pipeio to interpret every negative number as -errno.
5) Patch 0005 changes the way the end of the test is handled - before, the test ended after the last child was dead, but possibly before all data was read. The new way is to read all data and only if no data can be read, see if the children are dead.
The patches should be applied in sequence. Signed-Off-By: Jiří Paleček <jpalecek@web.de>,
6 files changed