nxt_process.h (1488:6976d36be926) nxt_process.h (1489:4a3ec07f4b19)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#ifndef _NXT_PROCESS_H_INCLUDED_
8#define _NXT_PROCESS_H_INCLUDED_

--- 55 unchanged lines hidden (view full) ---

64
65typedef struct {
66 nxt_thread_mutex_t mutex;
67 uint32_t size;
68 uint32_t cap;
69 nxt_port_mmap_t *elts;
70} nxt_port_mmaps_t;
71
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#ifndef _NXT_PROCESS_H_INCLUDED_
8#define _NXT_PROCESS_H_INCLUDED_

--- 55 unchanged lines hidden (view full) ---

64
65typedef struct {
66 nxt_thread_mutex_t mutex;
67 uint32_t size;
68 uint32_t cap;
69 nxt_port_mmap_t *elts;
70} nxt_port_mmaps_t;
71
72typedef struct {
73 u_char *rootfs;
74 nxt_array_t *mounts; /* of nxt_mount_t */
72
75
76#if (NXT_HAVE_CLONE)
77 nxt_clone_t clone;
78#endif
79
80#if (NXT_HAVE_PR_SET_NO_NEW_PRIVS)
81 uint8_t new_privs; /* 1 bit */
82#endif
83} nxt_process_isolation_t;
84
85
73typedef struct {
86typedef struct {
74 nxt_pid_t pid;
75 const char *name;
76 nxt_queue_t ports; /* of nxt_port_t */
77 nxt_process_state_t state;
78 nxt_bool_t registered;
79 nxt_int_t use_count;
87 nxt_pid_t pid;
88 const char *name;
89 nxt_queue_t ports; /* of nxt_port_t */
90 nxt_process_state_t state;
91 nxt_bool_t registered;
92 nxt_int_t use_count;
80
93
81 nxt_port_mmaps_t incoming;
82 nxt_port_mmaps_t outgoing;
94 nxt_port_mmaps_t incoming;
95 nxt_port_mmaps_t outgoing;
83
96
84 nxt_thread_mutex_t cp_mutex;
85 nxt_lvlhsh_t connected_ports; /* of nxt_port_t */
97 nxt_thread_mutex_t cp_mutex;
98 nxt_lvlhsh_t connected_ports; /* of nxt_port_t */
86
99
87 uint32_t stream;
100 uint32_t stream;
88
101
89 nxt_mp_t *mem_pool;
90 nxt_credential_t *user_cred;
102 nxt_mp_t *mem_pool;
103 nxt_credential_t *user_cred;
91
104
92 nxt_process_data_t data;
105 nxt_process_data_t data;
93
106
94 union {
95#if (NXT_HAVE_CLONE)
96 nxt_clone_t clone;
97#endif
98 } isolation;
107 nxt_process_isolation_t isolation;
99} nxt_process_t;
100
101
102typedef nxt_int_t (*nxt_process_prefork_t)(nxt_task_t *task,
103 nxt_process_t *process, nxt_mp_t *mp);
104typedef nxt_int_t (*nxt_process_postfork_t)(nxt_task_t *task,
105 nxt_process_t *process, nxt_mp_t *mp);
106typedef nxt_int_t (*nxt_process_setup_t)(nxt_task_t *task,

--- 72 unchanged lines hidden (view full) ---

179 nxt_str_t *user, nxt_str_t *group);
180nxt_int_t nxt_process_apply_creds(nxt_task_t *task, nxt_process_t *process);
181
182#if (NXT_HAVE_CLONE_NEWUSER)
183nxt_int_t nxt_process_vldt_isolation_creds(nxt_task_t *task,
184 nxt_process_t *process);
185#endif
186
108} nxt_process_t;
109
110
111typedef nxt_int_t (*nxt_process_prefork_t)(nxt_task_t *task,
112 nxt_process_t *process, nxt_mp_t *mp);
113typedef nxt_int_t (*nxt_process_postfork_t)(nxt_task_t *task,
114 nxt_process_t *process, nxt_mp_t *mp);
115typedef nxt_int_t (*nxt_process_setup_t)(nxt_task_t *task,

--- 72 unchanged lines hidden (view full) ---

188 nxt_str_t *user, nxt_str_t *group);
189nxt_int_t nxt_process_apply_creds(nxt_task_t *task, nxt_process_t *process);
190
191#if (NXT_HAVE_CLONE_NEWUSER)
192nxt_int_t nxt_process_vldt_isolation_creds(nxt_task_t *task,
193 nxt_process_t *process);
194#endif
195
196nxt_int_t nxt_process_change_root(nxt_task_t *task, nxt_process_t *process);
197
198#if (NXT_HAVE_ISOLATION_ROOTFS)
199void nxt_process_unmount_all(nxt_task_t *task, nxt_process_t *process);
200#endif
201
187#if (NXT_HAVE_SETPROCTITLE)
188
189#define nxt_process_title(task, fmt, ...) \
190 setproctitle(fmt, __VA_ARGS__)
191
192#elif (NXT_LINUX || NXT_SOLARIS || NXT_MACOSX)
193
194#define NXT_SETPROCTITLE_ARGV 1

--- 26 unchanged lines hidden ---
202#if (NXT_HAVE_SETPROCTITLE)
203
204#define nxt_process_title(task, fmt, ...) \
205 setproctitle(fmt, __VA_ARGS__)
206
207#elif (NXT_LINUX || NXT_SOLARIS || NXT_MACOSX)
208
209#define NXT_SETPROCTITLE_ARGV 1

--- 26 unchanged lines hidden ---