tinyproxy/src/mypoll.h

32 lines
494 B
C
Raw Normal View History

#ifndef MYPOLL_H
#define MYPOLL_H
2020-09-16 03:01:01 +08:00
#include "config.h"
#ifdef HAVE_POLL_H
#define SELECT_OR_POLL "poll"
2020-09-16 03:01:01 +08:00
#include <poll.h>
typedef struct pollfd pollfd_struct;
2020-09-16 03:01:01 +08:00
#define MYPOLL_READ POLLIN
#define MYPOLL_WRITE POLLOUT
#else
2020-09-16 03:01:01 +08:00
#define SELECT_OR_POLL "select"
2020-09-16 03:01:01 +08:00
#include <sys/select.h>
typedef struct mypollfd {
int fd;
short events;
short revents;
} pollfd_struct;
#define MYPOLL_READ (1<<1)
#define MYPOLL_WRITE (1<<2)
2020-09-16 03:01:01 +08:00
#endif
int mypoll(pollfd_struct* fds, int nfds, int timeout);
#endif