Back to index

glibc  2.9
Functions
tst-fdset.c File Reference
#include <stdio.h>
#include <sys/types.h>

Go to the source code of this file.

Functions

int main (void)

Function Documentation

int main ( void  )

Definition at line 25 of file tst-fdset.c.

{
  int retval = 0;
  int i;
  fd_set set;

  FD_ZERO (&set);
  for (i=0; i < FD_SETSIZE; ++i)
    {
      printf ("%d =>  check:", i);
      if (FD_ISSET (i, &set) == 0)
       fputs ("ok", stdout);
      else
       {
         fputs ("nok", stdout);
         retval = 1;
       }
      fputs (", set", stdout);
      FD_SET (i, &set);
      fputs (", check:", stdout);
      if (FD_ISSET (i, &set))
       fputs ("ok", stdout);
      else
       {
         fputs ("nok", stdout);
         retval = 1;
       }
      fputs (", clear", stdout);
      FD_CLR (i, &set);
      fputs (", check:", stdout);
      if (FD_ISSET (i, &set) == 0)
       puts ("ok");
      else
       {
         puts ("nok");
         retval = 1;
       }
    }

  return retval;
}

Here is the call graph for this function: