FD_ISSET() - what does it mean?

FD_ISSET() - what does it mean?

Post by Nancy A. Mill » Thu, 20 Apr 1995 04:00:00



I'm trying to use the select() call to handle IO for multiple sockets.
I'm a little confused about the FD_ISSET() macro.  The man page for
select(3C) says this:

Quote:> FD_ISSET() is nonzero if fd is a member of fdset, zero otherwise.

I had assumed FD_ISSET() was supposed to be used to test whether
fd was ready for IO (after the select() call was made).  If this
is not the case, how do you tell which file descriptors are ready
for IO after the select() call returns??

Thanks,
Nancy

 
 
 

FD_ISSET() - what does it mean?

Post by Jeff Dickso » Thu, 20 Apr 1995 04:00:00



Quote:

> I'm trying to use the select() call to handle IO for multiple sockets.
> I'm a little confused about the FD_ISSET() macro.  The man page for
> select(3C) says this:

> > FD_ISSET() is nonzero if fd is a member of fdset, zero otherwise.

> I had assumed FD_ISSET() was supposed to be used to test whether
> fd was ready for IO (after the select() call was made).  If this
> is not the case, how do you tell which file descriptors are ready
> for IO after the select() call returns??

> Thanks,
> Nancy

Have you read the man page? FD_ISSET use is explained therein. It
does pretty much what the name suggests and that is test whether a
particular descripter is set. You see select just returns to you
the number of descriptors that are ready for IO. Finding out which
is what the FD_ISSET macro is for.

Jeff

 
 
 

FD_ISSET() - what does it mean?

Post by Patrick Horg » Thu, 20 Apr 1995 04:00:00


After the call to select, the fdset is a subset of the set you put in it
originally!  If you passed the fdset for read access, any bits still
pulled up after the select are fds that have data ready for you to read.

Patrick
--
   _______________________________________________________________________
  /  These opinions are mine, and not Amdahl's (except by coincidence;).  \
 |                                                       (\                |
 |  Patrick J. Horgan         Amdahl Corporation          \\    Have       |

 |  Phone : (408)992-2779     P.O. Box 3470 M/S 316         \\/    Will    |
 |  FAX   : (408)773-0833     Sunnyvale, CA 94088-3470     _/\\     Travel |
  \___________________________O16-2294________________________\)__________/

 
 
 

FD_ISSET() - what does it mean?

Post by Matt DiM » Fri, 21 Apr 1995 04:00:00




    >
    >> FD_ISSET() is nonzero if fd is a member of fdset, zero otherwise.
    >
    >I had assumed FD_ISSET() was supposed to be used to test whether
    >fd was ready for IO (after the select() call was made).  If this

You are correct.  The tricky thing going on here is that select(2) actually
modifies the fd_set you pass in, removing the unready fd's from the set.

-Matt

 
 
 

1. It`s IMPORTANT!!!

Muy buenas!!!,
Le escribo ya que tengo algunos problemas y dudas acerca de linux.
Espero que tu/Usted me pueda hechar una mano, ya que poco a poco me
estoy desesperando... He escrito muchsimos emilios a los diferentes
grupos de noticias, pero nadie me puede ayudar...:
Desde principios del verano del 97, llevo utilizando la versin de
S.u.S.E. Linux 5.2 (Krnl: 2.0.33, Xfree:3.3.2, con la version beta del
KDE.) Es la versin alemana que incluye 4 CD`s...
Mis dudas son:
1. ?Linux es compatible con mi procesador K6-2 a 350Mhz? Supongo que si,
ya que funciona,,, pero he odo algo por lo del cach de segundo
nivl...He odo que hace falta un patch para Linux que haga que Linux
utilice el cach de segundo nivel...?Es verdad?
2.En mi otro ordenador (un Pentium 133 con tarjeta grfica S3 Virge) he
conseguido hacer que funcione todo perfectamente. Todo, incluido el
entorno grfico...
Pero en mi nuevo ordenador (un K6-2/350 en placa ASUS P5A con tarjeta
grfica Trident 3DImge975 de 4 Mb) no consigo configurar el entorno
grfico. Cuando intento configurar la tarjeta grfica, con el programa
incluido en mi versin S.u.S.E. "YaST" o bien con el programa estndar,
me sale una ventana peque?a (ms o menos de 4cm de alto y tan ancha como
la pantalla) con mil lineas movindose de desordenadamente... Levemente
se v, que es el entorno grfico de "FVWM2"...pero en ese estado no se
puede hacer nada de nada...Me paso a la consola desde la cual he
ejecutado "startx" y presiono Ctrl&C...Desde la primera consola al
parecer no aparecen errores y parece estar todo bien...He probado mil
configuraciones diferentes de resolucin y colores pero nada,
tampoco...Mi targeta (Trident 3d Imge 975) est en la base de datos de
las targetas soportadas, pero aun as no la reconoce bien. En la caja de
versin de Linux pone que mi targeta est soportada, y ms alante pone
que estn soportadas experimentalmente y adems sin aceleracin... Esto
ltimo (que est en modo experimental) lo acabo de ver ahora y no me lo
imaginaba... <---puede ser que mi problema sea por los drivers??? A ver
si ahora me conecto, mando este mensaje y busco el driver
acutalizado...   Ahora que he visto que los drivers, para mi tarjeta
grfica, que incluye mi versin de Linux son experimentales me parece un
poco estpida haberte hecho esta pregunta... pero an as gracias por
leerla...
3. Por ltimo,: ?Sabes de algn programa para entrar en Internet por
RED? Para que desde el Pentium pueda entrar en internet con el K6. Tipo
"Internet-Share"....      Muchas gracias en adelanto, Daniel     --->

2. ipfilter WARNING: ddi_installdrv: no major number for ipf WARNING: mod_installdrv: Cannot install ipf

3. Please Help....it′s a very small thing!!!!.PLEASE

4. Could someone comment on my IPTABLES script?

5. Help me !!!!!! I have no Idea it′s crucial

6. logcheck.ignore syntax

7. It`s IMPORTANT!!!

8. Unix accounts....

9. ICT what does it really mean; GMT can it be done?

10. What the (Insert Explicitive) does this mean (doing a make && make install)

11. What are the most popular means of doing web development?

12. The meaning of DOS

13. FD_ISSET ,select,FD_ZERO .. problems