FD_SETSIZE and sizeof(fd_set)
Steven Bardwell
SBardwell@lbmsys.com
Thu Jun 23 11:36:00 GMT 2016
> >
> > There are (of course) a lot of other included files, and
> > <sys/select.h> is one of them. In my code it comes AFTER the
> > redefinition of FD_SETSIZE and <sys/types.h>. I don't think this
> > could be the issue.
>
> It is if you are mixing Windows API and Cygwin.
>
> Just look at sys/select.h and you'll understand.
> --
> René Berber
Here is a "program" that shows the issue I am worried about. It is so simple that I must be overlooking something really obvious:
#include <stdio.h>
#undef FD_SETSIZE
#define FD_SETSIZE 256
#include <sys/types.h>
#include <sys/select.h>
main()
{
fd_set rfds;
fprintf(stdout, "FD_SETSIZE=%d\n", FD_SETSIZE);
fprintf(stdout, "sizeof(fd_set)=%d\n", sizeof(fd_set));
}
Steve Bardwell
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list