[threads] Remove mono_threads_create_thread (#4411)
[mono.git] / mono / utils / mono-poll.h
1 #ifndef MONO_POLL_H
2 #define MONO_POLL_H
3
4 #include <mono/utils/mono-publib.h>
5
6 #include <config.h>
7 #ifdef HAVE_SYS_TIME_H
8 #include <sys/time.h>
9 #endif
10 #include <sys/types.h>
11 #ifdef HAVE_UNISTD_H
12 #include <unistd.h>
13 #endif
14
15 #ifdef HAVE_POLL
16 #ifdef HAVE_POLL_H
17 #include <poll.h>
18 #elif defined(HAVE_SYS_POLL_H)
19 #include <sys/poll.h>
20 #endif
21
22 #define MONO_POLLIN             POLLIN
23 #define MONO_POLLPRI            POLLPRI
24 #define MONO_POLLOUT            POLLOUT
25 #define MONO_POLLERR            POLLERR
26 #define MONO_POLLHUP            POLLHUP
27 #define MONO_POLLNVAL           POLLNVAL
28
29 typedef struct pollfd mono_pollfd;
30
31 #else
32
33 #ifdef HOST_WIN32
34 #include <windows.h>
35 #endif
36 #define MONO_POLLIN             1
37 #define MONO_POLLPRI            2
38 #define MONO_POLLOUT            4
39 #define MONO_POLLERR            8
40 #define MONO_POLLHUP            0x10
41 #define MONO_POLLNVAL           0x20
42
43 typedef struct {
44         int fd;
45         short events;
46         short revents;
47 } mono_pollfd;
48
49 #endif
50
51 MONO_API int mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout);
52
53 #endif /* MONO_POLL_H */
54