
#ifdef USE_POLL
#define fd_set my_fd_set
#define FD_SET poll_fd_set
#define FD_ZERO poll_fd_zero
#include <sys/poll.h>

typedef struct POLL_FD_SET {struct pollfd fd[FD_SETSIZE]; int max} my_fd_set;


int poll_fd_set(my_fd_set f, int fd, int readfd, int flags)
{
	
}
int poll_fd_zero(my_fd_set f, int fd)
{

}
int poll_fd_isset(my_fd_set f, int fd, int readfd, int flags)
{

}
int poll_select(int tablesize, my_fd_set *readfd, my_fd_set *writefd, my_fd_set *exceptfd, struct timeval *timeout))
{
	int r;
	int msec = timeout->tv_usec /1000 + timeout->tv_sec*1000;
	int i;
	return poll(readfd->fd,readfd->max,msec);
}


int poll(struct pollfd *ufds, unsigned int nfds, int time­out);




           #define POLLIN      0x0001    /* There is data to read */
           #define POLLPRI     0x0002    /* There is urgent data to read */
           #define POLLOUT     0x0004    /* Writing now will not block */
           #define POLLERR     0x0008    /* Error condition */
           #define POLLHUP     0x0010    /* Hung up */
           #define POLLNVAL    0x0020    /* Invalid request: fd not open */

p

void nntp_wait(void)
{
        static int last_give;
        int i,nc;
	int snooze;
        static int xlast;
        fd_set readfd,writefd,exceptfd,writecopy;
        static int curtime=0;
        
        timeout.tv_sec = 0; /*Wake up once a second*/
        timeout.tv_usec = 500000;
again:
        FD_ZERO(&readfd);
        FD_ZERO(&writefd);
        FD_ZERO(&exceptfd);
        for (i=0; i<nchan; i++) if ((chan[i]!=INVALID_SOCKET) && (chan_out[i]!=INVALID_SOCKET)) {
                FD_SET(chan[i],&writefd);
                FD_SET(chan[i],&exceptfd);
                FD_SET(chan_out[i],&writefd);
                FD_SET(chan_out[i],&exceptfd);
        }
        timecopy = timeout; /* Because linux clears the value each call */
        if (x_listen!=INVALID_SOCKET) FD_SET(x_listen,&readfd);
	for (i=0; i<nlisten; i++) { /* listening on other ports */
		FD_SET(l_chan[i],&readfd);
	}