36 static void ngx_file_aio_event_handler(
ngx_event_t *ev);
61 aio->event.data = aio;
63 aio->event.log = file->
log;
64 #if (NGX_HAVE_AIO_SENDFILE)
65 aio->last_offset = -1;
74 "second aio post for \"%V\"", &file->
name);
79 "aio complete:%d @%O:%z %V",
91 "aio read \"%s\" failed", file->
name.
data);
98 aio->aiocb.aio_fildes = file->
fd;
99 aio->aiocb.aio_offset = offset;
100 aio->aiocb.aio_buf = buf;
101 aio->aiocb.aio_nbytes = size;
102 #if (NGX_HAVE_KQUEUE)
103 aio->aiocb.aio_sigevent.sigev_notify_kqueue =
ngx_kqueue;
104 aio->aiocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
105 aio->aiocb.aio_sigevent.sigev_value.sigval_ptr = ev;
107 ev->
handler = ngx_file_aio_event_handler;
109 n = aio_read(&aio->aiocb);
119 "aio_read(\"%V\") failed", &file->
name);
130 "aio_read: fd:%d %d", file->
fd, n);
136 return ngx_file_aio_result(aio->file, aio, ev);
146 n = aio_error(&aio->aiocb);
149 "aio_error: fd:%d %d", file->
fd, n);
156 "aio_error(\"%V\") failed", &file->
name);
164 "aio_read(\"%V\") still in progress",
171 n = aio_return(&aio->aiocb);
179 "aio_return(\"%V\") failed", &file->
name);
189 "aio_return: fd:%d %d", file->
fd, n);
203 "aio event handler fd:%d %V", aio->fd, &aio->
file->
name);
205 if (ngx_file_aio_result(aio->file, aio, ev) !=
NGX_AGAIN) {