lkml.org 
[lkml]   [1997]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjecttest program for select()
Date
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

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.018 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site