3 * Copyright (C) Igor Sysoev
7 #ifndef _NGX_PROCESS_H_INCLUDED_
8 #define _NGX_PROCESS_H_INCLUDED_
11 typedef pid_t ngx_pid_t
;
13 typedef void (*ngx_spawn_proc_pt
) (ngx_cycle_t
*cycle
, void *data
);
18 ngx_socket_t channel
[2];
20 ngx_spawn_proc_pt proc
;
25 unsigned just_respawn
:1;
40 #define NGX_MAX_PROCESSES 1024
42 #define NGX_PROCESS_NORESPAWN -1
43 #define NGX_PROCESS_RESPAWN -2
44 #define NGX_PROCESS_JUST_RESPAWN -3
45 #define NGX_PROCESS_DETACHED -4
48 #define ngx_getpid getpid
49 #define ngx_log_pid ngx_pid
51 ngx_pid_t
ngx_spawn_process(ngx_cycle_t
*cycle
,
52 ngx_spawn_proc_pt proc
, void *data
,
53 char *name
, ngx_int_t respawn
);
54 ngx_pid_t
ngx_execute(ngx_cycle_t
*cycle
, ngx_exec_ctx_t
*ctx
);
55 void ngx_process_get_status(void);
57 #define ngx_sched_yield() sched_yield()
60 extern char **ngx_argv
;
61 extern char **ngx_os_argv
;
63 extern ngx_pid_t ngx_pid
;
64 extern ngx_socket_t ngx_channel
;
65 extern ngx_int_t ngx_process_slot
;
66 extern ngx_int_t ngx_last_process
;
67 extern ngx_process_t ngx_processes
[NGX_MAX_PROCESSES
];
70 #endif /* _NGX_PROCESS_H_INCLUDED_ */