All Forums |
Register |
Login |
Search |
Subscriptions |
My Profile |
Inbox |
Tool Warehouse |
FAQs |
Resources |
Help |
Member List |
Address Book |
Logout |
|
|
FD_ISSET macro not defined correctly
|
Logged in as: Guest |
Users viewing this topic: none |
|
Login  |
|
|
FD_ISSET macro not defined correctly - Mar. 13, '06, 6:42:46 AM
|
|
|
shailishi
Posts: 15
Joined: Jan. 6, '06,
Status: offline
|
FD_ISSET macro works fine but if you use !FD_ISSET, it wont work and give unexpected result.
fix: either use !(FD_ISSET) or u may add the same in FD_ISSET macro in sys/time.h file.(brackets are missing)
FYI: Specific to SUA/WINDOWS2003
|
|
|
RE: FD_ISSET macro not defined correctly - May 25, '06, 3:48:01 PM
|
|
|
rfoletta
Posts: 9
Joined: May 17, '06,
Status: offline
|
I also found that
FD_SET(lastfd-1,&fdset);
does not work either.
To fix I had to do the following:
FD_SET((lastfd-1),&fdset);
|
|
|
RE: FD_ISSET macro not defined correctly - May 25, '06, 4:56:38 PM
|
|
|
Rodney
Posts: 3695
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
Technically all of the FD_* macros on 5.2 are broken (3.0 and 3.5 are fine).
Someone rewrote them for 5.2 (reasons unknown) and didn't guard the args right
on the expanded side.
I've submitted a request for the fix for 6.0 (Vista) just now.
[update]
This is correct. You can edit <sys/time.h> and replace with this.
(Again only needed for 5.2/SUA. Interix 3.0 & 3.5 are fine.)
#define FD_CLR(p1, p2) (((fd_set FAR *)(p2))->fds_bits[(p1)/_NFDBITS] &= ~(((fdmask_t)1) << ((p1) % _NFDBITS)))
#define FD_ISSET(p1, p2) \
((fd_set FAR *)(p2))->fds_bits[((p1) / _NFDBITS)] & (((fdmask_t)1) << ((p1) % _NFDBITS))
#define FD_SET(p1, p2)(((fd_set FAR *)(p2))->fds_bits[(p1)/_NFDBITS] |= (((fdmask_t)1) << ((p1) % _NFDBITS)))
#define FD_ZERO(p1) (void) memset((p1), 0, sizeof(*(p1)))
< Message edited by Rodney -- May 25, '06, 5:00:56 PM >
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
|
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|
|