nginx needs porting

Bug #1160013 reported by Dirk Mueller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro AArch64 cross-distro work
Triaged
Low
Riku Voipio

Bug Description

nginx hardcodes SYS_eventfd, which does not exist on aarch64. The code is a bit weird, and I have little experience with eventfd, so I'm not sure if the patch below is even remotely accurate, but it passes the build test at least:

--- auto/unix
+++ auto/unix
@@ -393,10 +393,10 @@
         ngx_feature_name="NGX_HAVE_FILE_AIO"
         ngx_feature_run=no
         ngx_feature_incs="#include <linux/aio_abi.h>
- #include <sys/syscall.h>"
+ #include <sys/eventfd.h>"
         ngx_feature_path=
         ngx_feature_libs=
- ngx_feature_test="int n = SYS_eventfd;
+ ngx_feature_test="int n = eventfd(0, 0);
                           struct iocb iocb;
                           iocb.aio_lio_opcode = IOCB_CMD_PREAD;
                           iocb.aio_flags = IOCB_FLAG_RESFD;
--- src/event/modules/ngx_epoll_module.c
+++ src/event/modules/ngx_epoll_module.c
@@ -73,7 +73,7 @@
 #define SYS_io_setup 245
 #define SYS_io_destroy 246
 #define SYS_io_getevents 247
-#define SYS_eventfd 323
+#include <sys/eventfd.h>

 typedef u_int aio_context_t;

@@ -225,7 +225,7 @@
     int n;
     struct epoll_event ee;

- ngx_eventfd = syscall(SYS_eventfd, 0);
+ ngx_eventfd = eventfd(0, 0);

     if (ngx_eventfd == -1) {
         ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,

the other SYS_io_* syscall numbers probably also need some porting.

Changed in linaro-aarch64:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Riku Voipio (riku-voipio)
Revision history for this message
Riku Voipio (riku-voipio) wrote :

Seems to build fine without this patch - how important is eventfd support in nginx?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.