関数 | |
static void | sig_cld (int signum) |
static void | sig_cld_leave_status (int signum) |
void | BlockSignals (BOOL block, int signum) |
void(*)(int) | CatchSignal (int signum, void(*handler)(int)) |
void | CatchChild (void) |
void | CatchChildLeaveStatus (void) |
static void sig_cld | ( | int | signum | ) | [static] |
参照先 CatchSignal()・sys_waitpid().
参照元 CatchChild()・open_sockets_smbd().
00029 { 00030 while (sys_waitpid((pid_t)-1,(int *)NULL, WNOHANG) > 0) 00031 ; 00032 00033 /* 00034 * Turns out it's *really* important not to 00035 * restore the signal handler here if we have real POSIX 00036 * signal handling. If we do, then we get the signal re-delivered 00037 * immediately - hey presto - instant loop ! JRA. 00038 */ 00039 00040 #if !defined(HAVE_SIGACTION) 00041 CatchSignal(SIGCLD, sig_cld); 00042 #endif 00043 }
static void sig_cld_leave_status | ( | int | signum | ) | [static] |
参照先 CatchSignal().
00050 { 00051 /* 00052 * Turns out it's *really* important not to 00053 * restore the signal handler here if we have real POSIX 00054 * signal handling. If we do, then we get the signal re-delivered 00055 * immediately - hey presto - instant loop ! JRA. 00056 */ 00057 00058 #if !defined(HAVE_SIGACTION) 00059 CatchSignal(SIGCLD, sig_cld_leave_status); 00060 #endif 00061 }
void BlockSignals | ( | BOOL | block, | |
int | signum | |||
) |
参照元 initialize_async_io_handler()・linux_init_kernel_oplocks()・linux_oplock_receive_message()・listen_for_packets()・main()・message_block()・message_unblock()・open_sockets()・process_aio_queue()・run_dns_queue()・smbc_init_context()・sync_browse_lists().
00068 { 00069 #ifdef HAVE_SIGPROCMASK 00070 sigset_t set; 00071 sigemptyset(&set); 00072 sigaddset(&set,signum); 00073 sigprocmask(block?SIG_BLOCK:SIG_UNBLOCK,&set,NULL); 00074 #elif defined(HAVE_SIGBLOCK) 00075 if (block) { 00076 sigblock(sigmask(signum)); 00077 } else { 00078 sigsetmask(siggetmask() & ~sigmask(signum)); 00079 } 00080 #else 00081 /* yikes! This platform can't block signals? */ 00082 static int done; 00083 if (!done) { 00084 DEBUG(0,("WARNING: No signal blocking available\n")); 00085 done=1; 00086 } 00087 #endif 00088 }
void(*)(int) CatchSignal | ( | ) |
参照元 another_ldap_try()・CatchChild()・CatchChildLeaveStatus()・create_subnets()・do_file_lock()・dump_core()・fault_report()・fault_setup()・ldap_open_with_timeout()・ldap_search_with_timeout()・main()・message_init()・open_sockets_smbd()・pam_sm_acct_mgmt()・pam_sm_authenticate()・pam_sm_chauthtok()・recv_cldap_netlogon()・send_fs_socket()・sig_cld()・sig_cld_leave_status()・smbldap_search_ext()・start_async_dns()・tdb_chainlock_with_timeout_internal().
00098 { 00099 #ifdef HAVE_SIGACTION 00100 struct sigaction act; 00101 struct sigaction oldact; 00102 00103 ZERO_STRUCT(act); 00104 00105 act.sa_handler = handler; 00106 #ifdef SA_RESTART 00107 /* 00108 * We *want* SIGALRM to interrupt a system call. 00109 */ 00110 if(signum != SIGALRM) 00111 act.sa_flags = SA_RESTART; 00112 #endif 00113 sigemptyset(&act.sa_mask); 00114 sigaddset(&act.sa_mask,signum); 00115 sigaction(signum,&act,&oldact); 00116 return oldact.sa_handler; 00117 #else /* !HAVE_SIGACTION */ 00118 /* FIXME: need to handle sigvec and systems with broken signal() */ 00119 return signal(signum, handler); 00120 #endif 00121 }
void CatchChild | ( | void | ) |
void CatchChildLeaveStatus | ( | void | ) |
参照先 CatchSignal()・sig_cld_leave_status().
参照元 chat_with_program()・smbrun_internal()・smbrunsecret().
00137 { 00138 CatchSignal(SIGCLD, sig_cld_leave_status); 00139 }