nginx/src/os/unix/ngx_process.h


/*
 * Copyright (C) Igor Sysoev
 * Copyright (C) Nginx, Inc.
 */


#ifndef _NGX_PROCESS_H_INCLUDED_
#define _NGX_PROCESS_H_INCLUDED_


#include <ngx_setaffinity.h>
#include <ngx_setproctitle.h>


ngx_pid_t;

#define NGX_INVALID_PID

ngx_spawn_proc_pt;

ngx_process_t;


ngx_exec_ctx_t;


#define NGX_MAX_PROCESSES

#define NGX_PROCESS_NORESPAWN
#define NGX_PROCESS_JUST_SPAWN
#define NGX_PROCESS_RESPAWN
#define NGX_PROCESS_JUST_RESPAWN
#define NGX_PROCESS_DETACHED


#define ngx_getpid
#define ngx_getppid

#ifndef ngx_log_pid
#define ngx_log_pid
#endif


ngx_pid_t ngx_spawn_process(ngx_cycle_t *cycle,
    ngx_spawn_proc_pt proc, void *data, char *name, ngx_int_t respawn);
ngx_pid_t ngx_execute(ngx_cycle_t *cycle, ngx_exec_ctx_t *ctx);
ngx_int_t ngx_init_signals(ngx_log_t *log);
void ngx_debug_point(void);


#if (NGX_HAVE_SCHED_YIELD)
#define ngx_sched_yield()
#else
#define ngx_sched_yield
#endif


extern int            ngx_argc;
extern char         **ngx_argv;
extern char         **ngx_os_argv;

extern ngx_pid_t      ngx_pid;
extern ngx_pid_t      ngx_parent;
extern ngx_socket_t   ngx_channel;
extern ngx_int_t      ngx_process_slot;
extern ngx_int_t      ngx_last_process;
extern ngx_process_t  ngx_processes[NGX_MAX_PROCESSES];


#endif /* _NGX_PROCESS_H_INCLUDED_ */