summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-08-28 08:12:35 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-08-28 08:12:35 +0000
commita962506498d3930bea4e34bc21d261613065f98f (patch)
treef401951eaab82203accb72c8b2205b9d91f7ee07 /auto
parent1163af9fae396700700824cca21309476cf5dd51 (diff)
downloadnginx-a962506498d3930bea4e34bc21d261613065f98f.tar.gz
nginx-a962506498d3930bea4e34bc21d261613065f98f.tar.bz2
FreeBSD and Linux AIO support
Diffstat (limited to 'auto')
-rw-r--r--auto/modules1
-rw-r--r--auto/options3
-rw-r--r--auto/os/features40
-rw-r--r--auto/sources2
4 files changed, 46 insertions, 0 deletions
diff --git a/auto/modules b/auto/modules
index 01951c738..146b7d7f2 100644
--- a/auto/modules
+++ b/auto/modules
@@ -41,6 +41,7 @@ fi
if [ $NGX_TEST_BUILD_EPOLL = YES ]; then
have=NGX_HAVE_EPOLL . auto/have
+ have=NGX_HAVE_EVENTFD . auto/have
have=NGX_TEST_BUILD_EPOLL . auto/have
EVENT_MODULES="$EVENT_MODULES $EPOLL_MODULE"
CORE_SRCS="$CORE_SRCS $EPOLL_SRCS"
diff --git a/auto/options b/auto/options
index bc9e80917..6bc01cd9f 100644
--- a/auto/options
+++ b/auto/options
@@ -43,6 +43,7 @@ EVENT_AIO=NO
USE_THREADS=NO
+NGX_FILE_AIO=NO
NGX_IPV6=NO
HTTP=YES
@@ -170,6 +171,7 @@ do
#--with-threads=*) USE_THREADS="$value" ;;
#--with-threads) USE_THREADS="pthreads" ;;
+ --with-file-aio) NGX_FILE_AIO=YES ;;
--with-ipv6) NGX_IPV6=YES ;;
--without-http) HTTP=NO ;;
@@ -305,6 +307,7 @@ cat << END
--with-poll_module enable poll module
--without-poll_module disable poll module
+ --with-file-aio enable file aio support
--with-ipv6 enable ipv6 support
--with-http_ssl_module enable ngx_http_ssl_module
diff --git a/auto/os/features b/auto/os/features
index 140e26b89..72ad534c3 100644
--- a/auto/os/features
+++ b/auto/os/features
@@ -274,3 +274,43 @@ if [ $ngx_found != yes ]; then
CORE_LIBS="$CORE_LIBS -lrt"
fi
fi
+
+
+if [ $NGX_FILE_AIO = YES ]; then
+ ngx_feature="kqueue AIO support"
+ ngx_feature_name="NGX_HAVE_FILE_AIO"
+ ngx_feature_run=no
+ ngx_feature_incs="#include <aio.h>"
+ ngx_feature_path=
+ ngx_feature_libs=
+ ngx_feature_test="int n; struct aiocb iocb;
+ iocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
+ n = aio_read(&iocb)"
+ . auto/feature
+
+ if [ $ngx_found = yes ]; then
+ CORE_SRCS="$CORE_SRCS $FILE_AIO_SRCS"
+ fi
+fi
+
+
+if [ $NGX_FILE_AIO = YES ]; then
+ ngx_feature="Linux AIO support"
+ ngx_feature_name="NGX_HAVE_FILE_AIO"
+ ngx_feature_run=no
+ ngx_feature_incs="#include <linux/aio_abi.h>
+ #include <sys/syscall.h>"
+ ngx_feature_path=
+ ngx_feature_libs=
+ ngx_feature_test="int n = SYS_eventfd;
+ struct iocb iocb;
+ iocb.aio_lio_opcode = IOCB_CMD_PREAD;
+ iocb.aio_flags = IOCB_FLAG_RESFD;
+ iocb.aio_resfd = -1;"
+ . auto/feature
+
+ if [ $ngx_found = yes ]; then
+ have=NGX_HAVE_EVENTFD . auto/have
+ CORE_SRCS="$CORE_SRCS $LINUX_AIO_SRCS"
+ fi
+fi
diff --git a/auto/sources b/auto/sources
index 616b9f11e..73afc9276 100644
--- a/auto/sources
+++ b/auto/sources
@@ -125,6 +125,8 @@ AIO_SRCS="src/event/modules/ngx_aio_module.c \
src/os/unix/ngx_aio_read_chain.c \
src/os/unix/ngx_aio_write_chain.c"
+FILE_AIO_SRCS="src/os/unix/ngx_file_aio_read.c"
+LINUX_AIO_SRCS="src/os/unix/ngx_linux_aio_read.c"
UNIX_INCS="$CORE_INCS $EVENT_INCS src/os/unix"