tcpdump mailing list archives

Re: Problems with select (the other way around...)


From: Ricardo Balbinot <rbalbinot () gmail com>
Date: Sat, 16 May 2009 11:09:33 -0300

tks.. a noob question (should have read the man page carefully).

Regards,
Ricardo

2009/5/15 Michael Richardson <mcr () sandelman ottawa on ca>


"Ricardo" == Ricardo Balbinot <rbalbinot () gmail com> writes:
   Ricardo> tv.tv_sec = 1;
   Ricardo> tv.tv_usec = 0;
   Ricardo> FD_ZERO(&rfds);
   Ricardo> FD_SET(handle_fd,&rfds);
   Ricardo> retval = select(1, &rfds, NULL, NULL, &tv);

The first argument to select is the highest FD that you want to look at.
Essentially, this sizes the bitfields ("fdsets").

"
      nfds  is the highest-numbered file descriptor in any of the three
sets,
      plus 1.
"

so, you need to set it to "handle_fd + 1"

--
]     Y'avait une poule de jammé dans l'muffler!!!!!!!!!        |
 firewalls  [
]   Michael Richardson, Sandelman Software Works, Ottawa, ON    |net
architect[
] mcr () sandelman ottawa on ca http://www.sandelman.ottawa.on.ca/ |device
driver[
] panic("Just another Debian GNU/Linux using, kernel hacking, security
guy"); [

-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.




-- 
-------------------------------
Me. Ricardo Balbinot
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: