Sergey Kandaurov
January 09, 2019 06:54AM
> On 8 Jan 2019, at 06:37, Sepherosa Ziehau <sepherosa@gmail.com> wrote:
>
> sigval.sigval is for FreeBSD 6 compability, while FreeBSD 6 was EOL
> for quite a while.
>
> Patch:
> https://leaf.dragonflybsd.org/~sephe/nginx_sival.diff

Citing here for archives:

commit 14d1cab150226367c8a0f0ae219b0e0571587aea
Author: Yanmin Qiao <yaqia@microsoft.com>
Date: Tue Jan 8 11:33:00 2019 +0800

unix/aio: Use sigval.sival which is standard.

sigval.sigval is for FreeBSD 6 compability, while FreeBSD 6 was EOL for quite a while.

diff --git a/src/os/unix/ngx_file_aio_read.c b/src/os/unix/ngx_file_aio_read.c
index aedc3c90..bb60ee82 100644
--- a/src/os/unix/ngx_file_aio_read.c
+++ b/src/os/unix/ngx_file_aio_read.c
@@ -110,7 +110,7 @@ ngx_file_aio_read(ngx_file_t *file, u_char *buf, size_t size, off_t offset,
#if (NGX_HAVE_KQUEUE)
aio->aiocb.aio_sigevent.sigev_notify_kqueue = ngx_kqueue;
aio->aiocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
- aio->aiocb.aio_sigevent.sigev_value.sigval_ptr = ev;
+ aio->aiocb.aio_sigevent.sigev_value.sival_ptr = ev;
#endif
ev->handler = ngx_file_aio_event_handler;


FreeBSD 4/5/6 lack sival_ptr (FreeBSD 3 has it, but not yet SIGEV_KEVENT),
which seemingly was broken in svn r48621 and later restored in r152029.

And that means that the following will no longer be true:

: Currently file AIO is supported on FreeBSD 4.3+ and Linux 2.6.22+ only

While nginx still maintains compatibility down to FreeBSD 2.2.

If applied, it'd need this part as well (used to build on old FreeBSD):

diff --git a/src/event/modules/ngx_eventport_module.c b/src/event/modules/ngx_eventport_module.c
--- a/src/event/modules/ngx_eventport_module.c
+++ b/src/event/modules/ngx_eventport_module.c
@@ -250,9 +250,7 @@ ngx_eventport_init(ngx_cycle_t *cycle, n

ngx_memzero(&sev, sizeof(struct sigevent));
sev.sigev_notify = SIGEV_PORT;
-#if !(NGX_TEST_BUILD_EVENTPORT)
sev.sigev_value.sival_ptr = &pn;
-#endif

if (timer_create(CLOCK_REALTIME, &sev, &event_timer) == -1) {
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,

--
Sergey Kandaurov

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

aio/unix: Use signal.sival which is standard

Sepherosa Ziehau 428 January 07, 2019 10:38PM

Re: aio/unix: Use signal.sival which is standard

Sergey Kandaurov 255 January 09, 2019 06:54AM

Re: aio/unix: Use signal.sival which is standard

Sepherosa Ziehau 143 January 17, 2019 12:46AM

Re: aio/unix: Use signal.sival which is standard

Sergey Kandaurov 237 January 17, 2019 05:30AM

Re: aio/unix: Use signal.sival which is standard

Maxim Dounin 175 January 17, 2019 08:24AM

Re: aio/unix: Use signal.sival which is standard

Sergey Kandaurov 181 January 17, 2019 10:20AM

Re: aio/unix: Use signal.sival which is standard

Sepherosa Ziehau 170 January 18, 2019 02:40AM

Re: aio/unix: Use signal.sival which is standard

Sergey Kandaurov 177 January 18, 2019 05:24AM

Re: aio/unix: Use signal.sival which is standard

Sepherosa Ziehau 176 January 23, 2019 09:06PM

Re: aio/unix: Use signal.sival which is standard

Maxim Dounin 173 January 22, 2019 09:56AM

Re: aio/unix: Use signal.sival which is standard

Sepherosa Ziehau 182 January 23, 2019 09:10PM

Re: aio/unix: Use signal.sival which is standard

Maxim Dounin 183 January 24, 2019 10:00AM

Re: aio/unix: Use signal.sival which is standard

Sepherosa Ziehau 174 January 28, 2019 04:08AM

Re: aio/unix: Use signal.sival which is standard

Sergey Kandaurov 180 January 28, 2019 12:34PM

Re: aio/unix: Use signal.sival which is standard

Sepherosa Ziehau 193 January 29, 2019 10:18PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 268
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready