summaryrefslogtreecommitdiffhomepage
path: root/auto/events
blob: 1ca6e7cd5b841a7ced53bf5ef7bf64d8ecf35746 (plain) (blame)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196

# Copyright (C) Igor Sysoev
# Copyright (C) NGINX, Inc.


# Linux epoll.

nxt_feature="Linux epoll"
nxt_feature_name=NXT_HAVE_EPOLL
nxt_feature_run=
nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <sys/epoll.h>
                  #include <unistd.h>

                  int main(void) {
                      int  n;

                      n = epoll_create(1);
                      close(n);
                      return 0;
                  }"
. auto/feature

if [ $nxt_found = yes ]; then
    NXT_HAVE_EPOLL=YES

    nxt_feature="Linux signalfd()"
    nxt_feature_name=NXT_HAVE_SIGNALFD
    nxt_feature_run=
    nxt_feature_incs=
    nxt_feature_libs=
    nxt_feature_test="#include <signal.h>
                      #include <sys/signalfd.h>
                      #include <unistd.h>

                      int main(void) {
                          int       n;
                          sigset_t  mask;

                          sigemptyset(&mask);
                          n = signalfd(-1, &mask, 0);
                          close(n);
                          return 0;
                      }"
    . auto/feature


    nxt_feature="Linux eventfd()"
    nxt_feature_name=NXT_HAVE_EVENTFD
    nxt_feature_run=
    nxt_feature_incs=
    nxt_feature_libs=
    nxt_feature_test="#include <sys/eventfd.h>
                      #include <unistd.h>

                      int main(void) {
                          int  n;

                          n = eventfd(0, 0);
                          close(n);
                          return 0;
                      }"
    . auto/feature

else
    NXT_HAVE_EPOLL=NO
fi


# FreeBSD, MacOSX, NetBSD, OpenBSD kqueue.

nxt_feature="kqueue"
nxt_feature_name=NXT_HAVE_KQUEUE
nxt_feature_run=
nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <sys/types.h>
                  #include <sys/event.h>
                  #include <unistd.h>

                  int main(void) {
                      int  n;

                      n = kqueue();
                      close(n);
                      return 0;
                  }"
. auto/feature

if [ $nxt_found = yes ]; then
    NXT_HAVE_KQUEUE=YES

    nxt_feature="kqueue EVFILT_USER"
    nxt_feature_name=NXT_HAVE_EVFILT_USER
    nxt_feature_run=
    nxt_feature_incs=
    nxt_feature_libs=
    nxt_feature_test="#include <stdlib.h>
                      #include <sys/types.h>
                      #include <sys/event.h>

                      int main(void) {
                          struct kevent  kev;

                          kev.filter = EVFILT_USER;
                          kevent(0, &kev, 1, NULL, 0, NULL);
                          return 0;
                      }"
    . auto/feature

else
    NXT_HAVE_KQUEUE=NO
fi


# Solaris event port.

nxt_feature="Solaris event port"
nxt_feature_name=NXT_HAVE_EVENTPORT
nxt_feature_run=
nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <port.h>
                  #include <unistd.h>

                  int main(void) {
                      int  n;

                      n = port_create();
                      close(n);
                      return 0;
                  }"
. auto/feature

if [ $nxt_found = yes ]; then
    NXT_HAVE_EVENTPORT=YES
else
    NXT_HAVE_EVENTPORT=NO
fi


# Solaris, HP-UX, IRIX, Tru64 UNIX /dev/poll.

nxt_feature="/dev/poll"
nxt_feature_name=NXT_HAVE_DEVPOLL
nxt_feature_run=yes
nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <fcntl.h>
                  #include <sys/ioctl.h>
                  #include <sys/devpoll.h>
                  #include <unistd.h>

                  int main(void) {
                      int  n;

                      n = open(\"/dev/poll\", O_RDWR);
                      close(n);
                      return 0;
                  }"
. auto/feature

if [ $nxt_found = yes ]; then
    NXT_HAVE_DEVPOLL=YES
else
    NXT_HAVE_DEVPOLL=NO
fi


# AIX pollset.

nxt_feature="AIX pollset"
nxt_feature_name=NXT_HAVE_POLLSET
nxt_feature_run=yes
nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <fcntl.h>
                  #include <sys/poll.h>
                  #include <sys/pollset.h>
                  #include <unistd.h>

                  int main(void) {
                      pollset_t  n;

                      n = pollset_create(-1);
                      pollset_destroy(n);
                      return 0;
                  }"
. auto/feature

if [ $nxt_found = yes ]; then
    NXT_HAVE_POLLSET=YES
else
    NXT_HAVE_POLLSET=NO
fi