delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/06/07:18:31

Date: Tue, 6 May 1997 12:03:44 +0200
From: Marcin Citowicki <miki AT icslab2 DOT icslab DOT agh DOT edu DOT pl>
Message-Id: <199705061003.MAA00182@icslab2.icslab.agh.edu.pl>
To: djgpp AT delorie DOT com
Subject: select & DJGPP

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019