[lsb-discuss] help needed regarding select API
nayyar.ce at gmail.com
Wed Jun 14 03:52:14 PDT 2006
I am right now implementing test case for "select" API, and I have right now
come across a very typical problem. Might be I am knowing less about
My problem is that I have created two files as follows...
system("touch tmp1;echo absjkhsk>tmp1;chmod 400 tmp1");
system("touch tmp2;echo jhagsakjg>tmp2;chmod 200 tmp2");
Now I opened the files as follows..
Now I added both the file descriptors in "rfds" and "wfds" (Basically
defined as "fd_set rfds,wfds; ") as follows...
Where n is an integer.
Now I call the select function as follows.....
Now to my surprise fd_set "rfds" contain both fd1 and fd2 being
set.(Moreover I can't write on to fd1 using "write" ..after select returns
and fd_set "wfds" too contain both of the descriptors. Iam really surprised
at results. FD_ISSET is reporting +ve value for both the fds in both the
fd_sets. How this can be possible...Is this a bug in select ..or I am wrong
Thanks & Regards
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lsb-discuss