Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

pt.c File Reference

#include "pt.h"
#include "tcp_init.h"
#include "sr_module.h"
#include "socket_info.h"
#include "rand/fastrand.h"
#include <stdio.h>
#include <time.h>

Go to the source code of this file.

Defines

#define FORK_DONT_WAIT

Functions

int calc_common_open_fds_no ()
int init_pt (int proc_no)
int register_procs (int no)
int get_max_procs ()
int register_fds (int no)
int get_max_open_fds ()
int my_pid ()
int close_extra_socks (int child_id, int proc_no)
int fork_process (int child_id, char *desc, int make_sock)
 Forks a new process.

Variables

int estimated_proc_no = 0
int estimated_fds_no = 0


Define Documentation

#define FORK_DONT_WAIT
 

Definition at line 60 of file pt.c.


Function Documentation

int calc_common_open_fds_no  )  [static]
 

Definition at line 78 of file pt.c.

References estimated_proc_no.

Referenced by init_pt().

int close_extra_socks int  child_id,
int  proc_no
 

Definition at line 199 of file pt.c.

References switchboard_item::next, pt, and si.

Referenced by fork_process(), and main_loop().

int fork_process int  child_id,
char *  desc,
int  make_sock
 

Forks a new process.

Parameters:
child_id - rank, if equal to PROC_NOCHLDINIT init_child will not be called for the new forked process (see sr_module.h)
desc - text description for the process table
make_sock - if to create a unix socket pair for it
Returns:
the pid of the new process

Definition at line 247 of file pt.c.

References close_extra_socks(), estimated_proc_no, fastrand_seed(), init_child(), is_main, L_CRIT, L_ERR, LOG, MAX_PT_DESC, process_table::pid, process_count, process_lock, process_no, pt, and rand.

Referenced by init_unixsock_children(), main_loop(), mod_child(), natpinger_child_init(), and start_fifo_server().

int get_max_open_fds  ) 
 

Definition at line 179 of file pt.c.

References L_CRIT, LOG, and pt.

Referenced by io_listen_loop(), and main_loop().

int get_max_procs  ) 
 

Definition at line 150 of file pt.c.

References L_CRIT, LOG, and pt.

Referenced by fix_domain(), init_sl_stats_child(), init_tls_h(), init_tm_stats_child(), io_listen_loop(), load_ca_list(), load_cert(), load_private_key(), main(), rpc_stats(), set_cipher_list(), set_session_cache(), set_ssl_options(), set_verification(), tls_free_domain(), and tm_rpc_stats().

int init_pt int  proc_no  ) 
 

Definition at line 96 of file pt.c.

References calc_common_open_fds_no(), estimated_fds_no, estimated_proc_no, L_ERR, LOG, process_table::pid, pkg_malloc, process_count, process_lock, process_no, and pt.

int my_pid  ) 
 

Definition at line 191 of file pt.c.

int register_fds int  no  ) 
 

Definition at line 169 of file pt.c.

References estimated_fds_no.

Referenced by mod_child(), and mod_init().

int register_procs int  no  ) 
 

Definition at line 137 of file pt.c.

References estimated_proc_no, L_CRIT, and LOG.

Referenced by mod_init(), and natpinger_init().


Variable Documentation

int estimated_fds_no = 0 [static]
 

Definition at line 74 of file pt.c.

Referenced by init_pt(), and register_fds().

int estimated_proc_no = 0 [static]
 

Definition at line 73 of file pt.c.

Referenced by calc_common_open_fds_no(), fork_process(), init_pt(), and register_procs().


Generated on Thu Jul 29 04:16:06 2010 for SIPExpressRouter by  doxygen 1.3.9.1