test program for select()

Jim Nance (jlnance@avanticorp.com)
Wed, 8 Jan 1997 08:32:34 -0500 (EST)


Hi All,
Thanks to the debugging efforts of Petr Vandrovec, the test program
that someone (I forget who) requested for select() is now available.
It could be a lot more fancy. It could even have comments so people
know what it was doing. I will add those later :-) Its operation is
pretty simple:

1) First it calls pipe() in a loop until pipe() fails. At this point it
has almost all the file descriptors available to the process.

2) It forks. The parrent writes a string into each pipe, and then closes
all the pipes. The child does a select() on all the file descriptors
looking for data to read or files being closes. After it gets the
number of these events that it thinks it should have, it returns to
a waiting parrent.

Hopefully this will be useful.

Jim