www.pudn.com > Tornado_Train_Workshop_demo_program.rar > select.c
#include "vxWorks.h"
#include "selectLib.h"
#include "string.h"
#include "sysLib.h"
int fdSet (fd, pFdSet)
int fd;
struct fd_set *pFdSet;
{
return (FD_SET (fd, pFdSet));
}
int fdClr (fd, pFdSet)
int fd;
struct fd_set *pFdSet;
{
return (FD_CLR (fd, pFdSet));
}
int fdIsSet (fd, pFdSet)
int fd;
struct fd_set *pFdSet;
{
return (FD_ISSET (fd, pFdSet));
}
void fdZero (pFdSet)
struct fd_set *pFdSet;
{
FD_ZERO (pFdSet);
}
void timevalSet (p, ticks)
struct timeval *p;
int ticks;
{
p->tv_sec = ticks / sysClkRateGet();
p->tv_usec = (ticks % sysClkRateGet()) * (1.0 / sysClkRateGet()) *
1000000;
}