pt.c File Reference

Server process related functions and datastructures. More...

#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include "mem/shm_mem.h"
#include "socket_info.h"
#include "sr_module.h"
#include "dprint.h"
#include "timer.h"
#include "pt.h"

Include dependency graph for pt.c:

Go to the source code of this file.

Defines

#define CHILD_COUNTER_STOP   656565656

Functions

int init_multi_proc_support (void)
 Initialize multi process support.
pid_t internal_fork (char *proc_desc)
 Wrapper around fork, do some initializations.
void set_proc_attrs (char *fmt,...)
 Set the process attributes.

Variables

unsigned int counted_processes = 0
struct process_tablept = 0


Detailed Description

Server process related functions and datastructures.

Definition in file pt.c.


Define Documentation

#define CHILD_COUNTER_STOP   656565656

Referenced by internal_fork().


Function Documentation

int init_multi_proc_support ( void   ) 

Initialize multi process support.

Definition at line 55 of file pt.c.

References children_no, count_module_procs(), count_timer_procs(), counted_processes, dont_fork, LM_ERR, socket_info::next, set_proc_attrs(), shm_malloc(), and udp_listen.

Referenced by main().

pid_t internal_fork ( char *  proc_desc  ) 

Wrapper around fork, do some initializations.

Note:
This function is to be called only by the main process!

Definition at line 137 of file pt.c.

References CHILD_COUNTER_STOP, is_main, LM_CRIT, LM_DBG, LM_ERR, process_table::pid, pid, process_no, seed_child(), set_proc_attrs(), and sockfd.

Referenced by main_loop(), start_module_procs(), and start_timer_processes().

void set_proc_attrs ( char *  fmt,
  ... 
)

Set the process attributes.

Definition at line 117 of file pt.c.

References MAX_PT_DESC, process_table::pid, process_no, and vsnprintf.

Referenced by init_multi_proc_support(), internal_fork(), and main_loop().


Variable Documentation

unsigned int counted_processes = 0

variable keeping the number of created processes READONLY!!

Definition at line 49 of file pt.c.

Referenced by handle_sigs(), init_multi_proc_support(), kill_all_children(), and mi_ps().

struct process_table* pt = 0

array with children pids, 0= main proc, alloc'ed in shared mem if possible

Definition at line 46 of file pt.c.

Referenced by cleanup(), dispatch_actions(), handle_sigs(), kill_all_children(), main_loop(), mi_ps(), pdt_init_tree(), and pdt_mi_list().


Generated on Thu May 24 08:01:15 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6