2004 by Marc J. Rochkind. All rights reserved. Portions marked "Open Source" may be copied under license.

 

Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

c9/sigminthr.c File Reference


Detailed Description

Minimal defensive signal handling using sigwait (bad example) [Sec. 9.2.2].

Definition in file sigminthr.c.

Go to the source code of this file.

Defines

#define MAX_SIG   50

Functions

void clean_up (void)
void * sig_thread (void *arg)
void handler (int signum)
bool handle_signals (void)
void process (void)
int main (void)


Define Documentation

#define MAX_SIG   50
 

Definition at line 134 of file sigminthr.c.


Function Documentation

void clean_up void   )  [static]
 

Definition at line 25 of file sigminthr.c.

bool handle_signals void   )  [static]
 

Definition at line 85 of file sigminthr.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_neg1, ec_null, ec_rv, pthread_create(), pthread_sigmask(), sigaction::sa_handler, set(), sig_thread(), sigaction(), sigaddset(), sigemptyset(), and sigfillset().

void handler int  signum  )  [static]
 

Definition at line 80 of file sigminthr.c.

int main void   ) 
 

Definition at line 136 of file sigminthr.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_neg1, exit(), fork(), kill(), MAX_SIG, process(), sleep(), and waitpid().

void process void   ) 
 

Definition at line 118 of file sigminthr.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_false, exit(), handle_signals(), and sleep().

void* sig_thread void *  arg  )  [static]
 

Definition at line 36 of file sigminthr.c.

References _exit(), clean_up(), EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FLUSH, ec_rv, and sigwait().

Referenced by handle_signals().


Generated on Fri Apr 23 10:57:11 2004 for AUP2 Example Source by doxygen 1.3.1