Mercurial > hg > nginx
comparison src/event/modules/ngx_aio_module.c @ 114:ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 07 Jul 2003 06:11:50 +0000 |
parents | a23d010f356d |
children | ef8c87afcfc5 |
comparison
equal
deleted
inserted
replaced
113:d7f606e25b99 | 114:ac69ab96328d |
---|---|
7 #if (HAVE_KQUEUE) | 7 #if (HAVE_KQUEUE) |
8 #include <ngx_kqueue_module.h> | 8 #include <ngx_kqueue_module.h> |
9 #endif | 9 #endif |
10 | 10 |
11 | 11 |
12 static int ngx_aio_init(ngx_log_t *log); | 12 static int ngx_aio_init(ngx_cycle_t *cycle); |
13 static void ngx_aio_done(ngx_log_t *log); | 13 static void ngx_aio_done(ngx_cycle_t *cycle); |
14 static int ngx_aio_add_event(ngx_event_t *ev, int event, u_int flags); | 14 static int ngx_aio_add_event(ngx_event_t *ev, int event, u_int flags); |
15 static int ngx_aio_del_event(ngx_event_t *ev, int event, u_int flags); | 15 static int ngx_aio_del_event(ngx_event_t *ev, int event, u_int flags); |
16 static int ngx_aio_del_connection(ngx_connection_t *c); | 16 static int ngx_aio_del_connection(ngx_connection_t *c); |
17 static int ngx_aio_process_events(ngx_log_t *log); | 17 static int ngx_aio_process_events(ngx_log_t *log); |
18 | 18 |
50 ngx_module_t ngx_aio_module = { | 50 ngx_module_t ngx_aio_module = { |
51 NGX_MODULE, | 51 NGX_MODULE, |
52 &ngx_aio_module_ctx, /* module context */ | 52 &ngx_aio_module_ctx, /* module context */ |
53 NULL, /* module directives */ | 53 NULL, /* module directives */ |
54 NGX_EVENT_MODULE, /* module type */ | 54 NGX_EVENT_MODULE, /* module type */ |
55 NULL /* init module */ | 55 NULL, /* init module */ |
56 NULL /* init child */ | |
56 }; | 57 }; |
57 | 58 |
58 | 59 |
59 | 60 |
60 #if (HAVE_KQUEUE) | 61 #if (HAVE_KQUEUE) |
61 | 62 |
62 static int ngx_aio_init(ngx_log_t *log) | 63 static int ngx_aio_init(ngx_cycle_t *cycle) |
63 { | 64 { |
64 if (ngx_kqueue_module_ctx.actions.init(log) == NGX_ERROR) { | 65 if (ngx_kqueue_module_ctx.actions.init(cycle) == NGX_ERROR) { |
65 return NGX_ERROR; | 66 return NGX_ERROR; |
66 } | 67 } |
68 | |
69 ngx_io = ngx_os_aio; | |
67 | 70 |
68 ngx_event_flags = NGX_HAVE_AIO_EVENT|NGX_USE_AIO_EVENT; | 71 ngx_event_flags = NGX_HAVE_AIO_EVENT|NGX_USE_AIO_EVENT; |
69 ngx_event_actions = ngx_aio_module_ctx.actions; | 72 ngx_event_actions = ngx_aio_module_ctx.actions; |
70 ngx_io = ngx_os_aio; | |
71 | 73 |
72 | 74 |
73 return NGX_OK; | 75 return NGX_OK; |
74 } | 76 } |
75 | 77 |
76 | 78 |
77 static void ngx_aio_done(ngx_log_t *log) | 79 static void ngx_aio_done(ngx_cycle_t *cycle) |
78 { | 80 { |
79 ngx_kqueue_module_ctx.actions.done(log); | 81 ngx_kqueue_module_ctx.actions.done(cycle); |
80 } | 82 } |
81 | 83 |
82 | 84 |
83 /* The event adding and deleting are needed for the listening sockets */ | 85 /* The event adding and deleting are needed for the listening sockets */ |
84 | 86 |