summaryrefslogtreecommitdiffhomepage
path: root/src/mypoll.h
blob: a33668027127ff6dca8fb40866e3f4483c52ea4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef MYPOLL_H
#define MYPOLL_H

#include "config.h"

#ifdef HAVE_POLL_H

#include <poll.h>
typedef struct pollfd pollfd_struct;

#define MYPOLL_READ POLLIN
#define MYPOLL_WRITE POLLOUT

#else

#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)
#endif

int mypoll(pollfd_struct* fds, int nfds, int timeout);

#endif