Mail Archives: djgpp/1997/05/06/07:18:31
Hi ,
I have problems with select function .
Take a look at this :
fd_set readset , writeset ;
int max_fd=2;
FD_ZERO(&readset);
FD_ZERO(&writeset);
FD_SET(fileno(stdin),&readset);
FD_SET(fileno(stdout),&writeset);
FD_SET(fileno(stderr),&writeset);
select(max_fd+1,&readset,&writeset,NULL,0);
if(FD_ISSET(fileno(stdin),&readset))
...
if(FD_ISSET(fileno(stdout),&writeset))
...
if(FD_ISSET(fileno(stderr),&writeset))
...
That if() ... part is never reached : select function returns EBADF error .
Could you tell me why this happens and how to make it work ?
I need that very much .
Yours ,
Marcin
miki AT icslab8 DOT isclab DOT agh DOT edu DOT pl
- Raw text -