aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_process.h
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-01-05 20:55:48 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-01-05 20:55:48 +0000
commit3c3ca1735815a4e495922b50b01a258016c93d4b (patch)
tree55ab881e478c8ead90652850135d3f083a7e9772 /src/os/unix/ngx_process.h
parentfa5fea18f7b0f6d024d5a814d34c778b6792abdb (diff)
downloadnginx-3c3ca1735815a4e495922b50b01a258016c93d4b.tar.gz
nginx-3c3ca1735815a4e495922b50b01a258016c93d4b.zip
nginx-0.0.1-2004-01-05-23:55:48 import
Diffstat (limited to 'src/os/unix/ngx_process.h')
-rw-r--r--src/os/unix/ngx_process.h44
1 files changed, 42 insertions, 2 deletions
diff --git a/src/os/unix/ngx_process.h b/src/os/unix/ngx_process.h
index 15d9c0d1d..5b7e37c34 100644
--- a/src/os/unix/ngx_process.h
+++ b/src/os/unix/ngx_process.h
@@ -4,11 +4,51 @@
typedef pid_t ngx_pid_t;
+typedef void (*ngx_spawn_proc_pt) (ngx_cycle_t *cycle, void *data);
+
+typedef struct {
+ ngx_pid_t pid;
+ int status;
+
+ ngx_spawn_proc_pt proc;
+ void *data;
+ char *name;
+
+ unsigned respawn:1;
+ unsigned detached:1;
+ unsigned exited:1;
+ unsigned exiting:1;
+} ngx_process_t;
+
+
+typedef struct {
+ char *path;
+ char *name;
+ char *const *argv;
+ char *const *envp;
+} ngx_exec_ctx_t;
+
+
#define ngx_getpid getpid
+#define NGX_MAX_PROCESSES 1024
+
+#define NGX_PROCESS_RESPAWN -1
+#define NGX_PROCESS_NORESPAWN -2
+#define NGX_PROCESS_DETACHED -3
+
+
+ngx_int_t ngx_spawn_process(ngx_cycle_t *cycle,
+ ngx_spawn_proc_pt proc, void *data,
+ char *name, ngx_int_t respawn);
+ngx_int_t ngx_exec(ngx_cycle_t *cycle, ngx_exec_ctx_t *ctx);
+void ngx_signal_processes(ngx_cycle_t *cycle, ngx_int_t signal);
+void ngx_respawn_processes(ngx_cycle_t *cycle);
+void ngx_process_get_status(void);
-int ngx_spawn_process(ngx_log_t *log);
-void ngx_sigchld_handler(int signo);
+extern ngx_int_t ngx_respawn;
+extern ngx_uint_t ngx_last_process;
+extern ngx_process_t ngx_processes[NGX_MAX_PROCESSES];
#endif /* _NGX_PROCESS_H_INCLUDED_ */