46 lines
1.6 KiB
Diff
46 lines
1.6 KiB
Diff
Index: nginx-1.2.9/auto/unix
|
|
===================================================================
|
|
--- nginx-1.2.9.orig/auto/unix
|
|
+++ nginx-1.2.9/auto/unix
|
|
@@ -396,7 +396,11 @@ if [ $NGX_FILE_AIO = YES ]; then
|
|
#include <sys/syscall.h>"
|
|
ngx_feature_path=
|
|
ngx_feature_libs=
|
|
- ngx_feature_test="int n = SYS_eventfd;
|
|
+ ngx_feature_test="#ifdef SYS_eventfd
|
|
+ int n = SYS_eventfd;
|
|
+ #else
|
|
+ int n = SYS_eventfd2;
|
|
+ #endif
|
|
struct iocb iocb;
|
|
iocb.aio_lio_opcode = IOCB_CMD_PREAD;
|
|
iocb.aio_flags = IOCB_FLAG_RESFD;
|
|
Index: nginx-1.2.9/src/event/modules/ngx_epoll_module.c
|
|
===================================================================
|
|
--- nginx-1.2.9.orig/src/event/modules/ngx_epoll_module.c
|
|
+++ nginx-1.2.9/src/event/modules/ngx_epoll_module.c
|
|
@@ -70,10 +70,7 @@ int epoll_wait(int epfd, struct epoll_ev
|
|
|
|
#if (NGX_HAVE_FILE_AIO)
|
|
|
|
-#define SYS_io_setup 245
|
|
-#define SYS_io_destroy 246
|
|
-#define SYS_io_getevents 247
|
|
-#define SYS_eventfd 323
|
|
+#include <sys/syscall.h>
|
|
|
|
typedef u_int aio_context_t;
|
|
|
|
@@ -225,7 +222,11 @@ ngx_epoll_aio_init(ngx_cycle_t *cycle, n
|
|
int n;
|
|
struct epoll_event ee;
|
|
|
|
+#ifdef SYS_eventfd
|
|
ngx_eventfd = syscall(SYS_eventfd, 0);
|
|
+#else
|
|
+ ngx_eventfd = syscall(SYS_eventfd2, 0, 0);
|
|
+#endif
|
|
|
|
if (ngx_eventfd == -1) {
|
|
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
|