k_kalyan
asked on
FD_CLR is crashing
In the following piece of code FD_CLR is crashing ?
Compiler : VC++ 6
OS : Win XP
The same piece of code is working in Linux.
Could u pls help me in resolving this.
========================== ========== =
fd_set rfds;
FD_CLR(0,&rfds); // Crashed, Reason : Unhandled Exception, Illegal Istruction.
FD_SET(0, &rfds);
retVal = select(0, NULL, NULL, NULL, &tv);
if (-1 == retVal)
{
// Action
}
========================== ========== =
Thanks for ur valuable time in helping me in this.
Compiler : VC++ 6
OS : Win XP
The same piece of code is working in Linux.
Could u pls help me in resolving this.
==========================
fd_set rfds;
FD_CLR(0,&rfds); // Crashed, Reason : Unhandled Exception, Illegal Istruction.
FD_SET(0, &rfds);
retVal = select(0, NULL, NULL, NULL, &tv);
if (-1 == retVal)
{
// Action
}
==========================
Thanks for ur valuable time in helping me in this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
fd_set rfds;
rfds.fd_count= 6;
FD_CLR( 0, &rfds ); // should avoid the crash