Fixed resource leakage during connection accept(2)
[middleman.git] / include / compat.h
1 #ifndef COMPAT_H
2 #define COMPAT_H
3
4 #define pthread_mutex_t int
5 #define pthread_rwlock_t int
6 #define pthread_t int
7 #define pthread_attr_t int
8 #define PTHREAD_MUTEX_INITIALIZER 0
9 #define pthread_attr_init(attr) (*(attr)=0)
10 #define pthread_attr_destroy(attr)
11 #define pthread_attr_setdetachstate(attr,state)
12 #define pthread_attr_setschedpolicy(attr,policy)
13 #define pthread_mutex_init(mutex,attr)
14 #define pthread_mutex_lock(mutex)
15 #define pthread_mutex_unlock(mutex)
16 #define pthread_rwlock_init(lock,attr)
17 #define pthread_rwlock_destroy(lock)
18 #define pthread_rwlock_rdlock(lock)
19 #define pthread_rwlock_wrlock(lock)
20 #define pthread_rwlock_unlock(lock)
21 /* pthread_create(thread,attr,start_routine,arg) not ignorable */
22
23 #ifndef HAVE_POLL
24
25 struct pollfd {
26         int fd;
27         short events;
28         short revents;
29 };
30
31 #define POLLIN         0x0001
32 #define POLLNORM       POLLIN
33 #define POLLPRI                POLLIN
34 #define POLLOUT                0x0008
35 #define POLLERR                0x0010
36 #define POLLHUP                0x0020
37 #define POLLNVAL       0x0040
38 #define POLLRDNORM     POLLIN
39 #define POLLRDBAND     POLLIN
40 #define POLLWRNORM     POLLOUT
41 #define POLLWRBAND     POLLOUT
42 #define POLLMSG                0x0800
43
44 #define __INVALIDPOLL  ~(POLLIN | POLLOUT)
45
46 #endif                          /* HAVE_POLL */
47
48 #endif                          /* COMPAT_H */