summaryrefslogtreecommitdiffhomepage
path: root/src/mypoll.h
blob: 114c0f81be775d2e06f42feffdbeca4c1f5f61bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef MYPOLL_H
#define MYPOLL_H

#include <sys/select.h>

#ifdef HAVE_POLL_H
#include <poll.h>
typedef struct pollfd pollfd_struct;
#else
typedef struct mypollfd {
	int   fd;
	short events;
	short revents;
} pollfd_struct;
#endif

#define MYPOLL_READ (1<<1)
#define MYPOLL_WRITE (1<<2)

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

#endif