forked from nanovms/nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-ngx_spawn_process-disable-non-blocking-operation-on-.patch
69 lines (63 loc) · 2.9 KB
/
0001-ngx_spawn_process-disable-non-blocking-operation-on-.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From 69b5ce72be69404cabad62ebf010cb68ec3225fa Mon Sep 17 00:00:00 2001
From: Francesco Lavra <[email protected]>
Date: Thu, 21 Sep 2023 11:41:23 +0200
Subject: [PATCH 1/2] ngx_spawn_process(): disable non-blocking operation on
channel[0]
Nanos does not support the FIOASYNC ioctl() flag, which is supposed
to enable sending a SIGIO signal to a thread when an asynchronous
I/O operation triggered by the thread has completed.
This change removes the FIOASYNC ioctl() calls; in order to remove
the need for the master process to be notified when an I/O
operation completes, asynchronous operation is being disabled on
the relevant file descriptors.
---
src/os/unix/ngx_process.c | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/src/os/unix/ngx_process.c b/src/os/unix/ngx_process.c
index 1568023..efc0058 100644
--- a/src/os/unix/ngx_process.c
+++ b/src/os/unix/ngx_process.c
@@ -87,7 +87,6 @@ ngx_pid_t
ngx_spawn_process(ngx_cycle_t *cycle, ngx_spawn_proc_pt proc, void *data,
char *name, ngx_int_t respawn)
{
- u_long on;
ngx_pid_t pid;
ngx_int_t s;
@@ -126,14 +125,6 @@ ngx_spawn_process(ngx_cycle_t *cycle, ngx_spawn_proc_pt proc, void *data,
ngx_processes[s].channel[0],
ngx_processes[s].channel[1]);
- if (ngx_nonblocking(ngx_processes[s].channel[0]) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- ngx_nonblocking_n " failed while spawning \"%s\"",
- name);
- ngx_close_channel(ngx_processes[s].channel, cycle->log);
- return NGX_INVALID_PID;
- }
-
if (ngx_nonblocking(ngx_processes[s].channel[1]) == -1) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
ngx_nonblocking_n " failed while spawning \"%s\"",
@@ -142,21 +133,6 @@ ngx_spawn_process(ngx_cycle_t *cycle, ngx_spawn_proc_pt proc, void *data,
return NGX_INVALID_PID;
}
- on = 1;
- if (ioctl(ngx_processes[s].channel[0], FIOASYNC, &on) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "ioctl(FIOASYNC) failed while spawning \"%s\"", name);
- ngx_close_channel(ngx_processes[s].channel, cycle->log);
- return NGX_INVALID_PID;
- }
-
- if (fcntl(ngx_processes[s].channel[0], F_SETOWN, ngx_pid) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "fcntl(F_SETOWN) failed while spawning \"%s\"", name);
- ngx_close_channel(ngx_processes[s].channel, cycle->log);
- return NGX_INVALID_PID;
- }
-
if (fcntl(ngx_processes[s].channel[0], F_SETFD, FD_CLOEXEC) == -1) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
"fcntl(FD_CLOEXEC) failed while spawning \"%s\"",
--
2.7.4