This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: FD_SETSIZE and sizeof(fd_set)


> >
> > 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]