pt.h File Reference

Server process related functions and datastructures. More...

#include <sys/types.h>
#include <unistd.h>
#include "globals.h"
#include "timer.h"
#include "socket_info.h"

Include dependency graph for pt.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  process_table

Defines

#define MAX_PT_DESC   128

Typedefs

typedef void(* forked_proc_func )(int i)

Functions

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

Variables

unsigned int counted_processes
int process_no
struct process_tablept


Detailed Description

Server process related functions and datastructures.

Definition in file pt.h.


Define Documentation

#define MAX_PT_DESC   128

Definition at line 45 of file pt.h.

Referenced by set_proc_attrs().


Typedef Documentation

typedef void(* forked_proc_func)(int i)

Definition at line 56 of file pt.h.


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().

static int my_pid ( void   )  [inline, static]

return processes pid

Definition at line 67 of file pt.h.

References process_table::pid, and process_no.

Referenced by child_init(), child_init_callid(), dp_my_pid(), io_watch_add(), and warning_builder().

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

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().

process number - 0 is the main process

Definition at line 298 of file main.c.

struct process_table* pt

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