comparison src/event/modules/ngx_kqueue_module.c @ 356:2e3cbc1bbe3c

nginx-0.0.7-2004-06-16-19:32:11 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 16 Jun 2004 15:32:11 +0000
parents ba876b26b76d
children 54f76b0b8dca
comparison
equal deleted inserted replaced
355:0fb6c53fb135 356:2e3cbc1bbe3c
14 int changes; 14 int changes;
15 int events; 15 int events;
16 } ngx_kqueue_conf_t; 16 } ngx_kqueue_conf_t;
17 17
18 18
19 static int ngx_kqueue_init(ngx_cycle_t *cycle); 19 static ngx_int_t ngx_kqueue_init(ngx_cycle_t *cycle);
20 static void ngx_kqueue_done(ngx_cycle_t *cycle); 20 static void ngx_kqueue_done(ngx_cycle_t *cycle);
21 static int ngx_kqueue_add_event(ngx_event_t *ev, int event, u_int flags); 21 static ngx_int_t ngx_kqueue_add_event(ngx_event_t *ev, int event, u_int flags);
22 static int ngx_kqueue_del_event(ngx_event_t *ev, int event, u_int flags); 22 static ngx_int_t ngx_kqueue_del_event(ngx_event_t *ev, int event, u_int flags);
23 static int ngx_kqueue_set_event(ngx_event_t *ev, int filter, u_int flags); 23 static ngx_int_t ngx_kqueue_set_event(ngx_event_t *ev, int filter, u_int flags);
24 static int ngx_kqueue_process_events(ngx_cycle_t *cycle); 24 static ngx_int_t ngx_kqueue_process_events(ngx_cycle_t *cycle);
25 static ngx_inline void ngx_kqueue_dump_event(ngx_log_t *log, 25 static ngx_inline void ngx_kqueue_dump_event(ngx_log_t *log,
26 struct kevent *kev); 26 struct kevent *kev);
27 27
28 static void *ngx_kqueue_create_conf(ngx_cycle_t *cycle); 28 static void *ngx_kqueue_create_conf(ngx_cycle_t *cycle);
29 static char *ngx_kqueue_init_conf(ngx_cycle_t *cycle, void *conf); 29 static char *ngx_kqueue_init_conf(ngx_cycle_t *cycle, void *conf);
85 NULL /* init child */ 85 NULL /* init child */
86 }; 86 };
87 87
88 88
89 89
90 static int ngx_kqueue_init(ngx_cycle_t *cycle) 90 static ngx_int_t ngx_kqueue_init(ngx_cycle_t *cycle)
91 { 91 {
92 struct timespec ts; 92 struct timespec ts;
93 ngx_kqueue_conf_t *kcf; 93 ngx_kqueue_conf_t *kcf;
94 94
95 kcf = ngx_event_get_conf(cycle->conf_ctx, ngx_kqueue_module); 95 kcf = ngx_event_get_conf(cycle->conf_ctx, ngx_kqueue_module);
182 nchanges = 0; 182 nchanges = 0;
183 nevents = 0; 183 nevents = 0;
184 } 184 }
185 185
186 186
187 static int ngx_kqueue_add_event(ngx_event_t *ev, int event, u_int flags) 187 static ngx_int_t ngx_kqueue_add_event(ngx_event_t *ev, int event, u_int flags)
188 { 188 {
189 ngx_event_t *e; 189 ngx_event_t *e;
190 ngx_connection_t *c; 190 ngx_connection_t *c;
191 191
192 ev->active = 1; 192 ev->active = 1;
227 227
228 return ngx_kqueue_set_event(ev, event, EV_ADD|EV_ENABLE|flags); 228 return ngx_kqueue_set_event(ev, event, EV_ADD|EV_ENABLE|flags);
229 } 229 }
230 230
231 231
232 static int ngx_kqueue_del_event(ngx_event_t *ev, int event, u_int flags) 232 static ngx_int_t ngx_kqueue_del_event(ngx_event_t *ev, int event, u_int flags)
233 { 233 {
234 ngx_event_t *e; 234 ngx_event_t *e;
235 235
236 ev->active = 0; 236 ev->active = 0;
237 ev->disabled = 0; 237 ev->disabled = 0;
274 return ngx_kqueue_set_event(ev, event, 274 return ngx_kqueue_set_event(ev, event,
275 flags & NGX_DISABLE_EVENT ? EV_DISABLE : EV_DELETE); 275 flags & NGX_DISABLE_EVENT ? EV_DISABLE : EV_DELETE);
276 } 276 }
277 277
278 278
279 static int ngx_kqueue_set_event(ngx_event_t *ev, int filter, u_int flags) 279 static ngx_int_t ngx_kqueue_set_event(ngx_event_t *ev, int filter, u_int flags)
280 { 280 {
281 struct timespec ts; 281 struct timespec ts;
282 ngx_connection_t *c; 282 ngx_connection_t *c;
283 283
284 c = ev->data; 284 c = ev->data;