[Vala] How to wrap select(2)'s fd_set?



Hi,

I'd like to complete more of the posix wrapper, namely select(2) and the 
required datatypes. The respective man page excerpt is:


NAME
      select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O 
multiplexing

SYNOPSIS
      /* According to POSIX.1-2001 */
      #include <sys/select.h>

      int select(int nfds, fd_set *readfds, fd_set *writefds,
                 fd_set *exceptfds, struct timeval *timeout);

      void FD_CLR(int fd, fd_set *set);
      int  FD_ISSET(int fd, fd_set *set);
      void FD_SET(int fd, fd_set *set);
      void FD_ZERO(fd_set *set);

The select call is not so much a problem, but I'd like advise on how to map 
fd_set and its associated functions. We need to make that a class, right?

If I recall we have a TimeVal already somewhere in glib-2.0, is this the same 
as struct timeval, i.e. can we reuse it?

Thanks,

Mickey.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]