Main Page | Class List | Directories | File List | Class Members | File Members

signal_handler.c File Reference

#include "global.h"
#include "fdlib.h"
#include "fd_control.h"
#include "svalue.h"
#include "interpret.h"
#include "stralloc.h"
#include "constants.h"
#include "pike_macros.h"
#include "backend.h"
#include "pike_error.h"
#include "callback.h"
#include "mapping.h"
#include "threads.h"
#include "signal_handler.h"
#include "module_support.h"
#include "operators.h"
#include "builtin_functions.h"
#include "pike_security.h"
#include "main.h"
#include <signal.h>

Classes

struct  sigdesc
struct  pid_status
struct  perishables

Defines

#define fp   Pike_fp
#define MAX_SIGNALS   256
#define NSIG   256
#define SIGNAL_BUFFER   16384
#define WAIT_BUFFER   4096
#define WAITSTATUSTYPE   int
#define WEXITSTATUS(x)   (((x)>>8)&0xff)
#define WUNTRACED   0
#define PIKE_BADF_LIMIT   1024
#define PROC_FPRINTF(X)
#define USE_PID_MAPPING
#define DECLARE_FIFO(pre, TYPE)
#define BEGIN_FIFO_PUSH(pre, TYPE)
#define FIFO_DATA(pre, TYPE)   ( PIKE_CONCAT(pre,buf)[PIKE_CONCAT(pre,_tmp_)] )
#define END_FIFO_PUSH(pre, TYPE)   PIKE_CONCAT(pre,_first)=PIKE_CONCAT(pre,_tmp_); } while(0)
#define QUICK_CHECK_FIFO(pre, TYPE)   ( PIKE_CONCAT(pre,_first) != PIKE_CONCAT(pre,_last) )
#define BEGIN_FIFO_LOOP(pre, TYPE)
#define END_FIFO_LOOP(pre, TYPE)   } }while(0)
#define INIT_FIFO(pre, TYPE)
#define SAFE_FIFO_DEBUG_BEGIN()   do {
#define SAFE_FIFO_DEBUG_END()   }while(0)
#define process_started(PID)
#define process_done(PID, FROM)
#define dump_process_history(PID)
#define WAITPID(PID, STATUS, OPT)   -1
#define MY_WAIT_ANY(STATUS, OPT)   ((errno=ENOTSUP), -1)
#define PROCESS_UNKNOWN   -1
#define PROCESS_RUNNING   0
#define PROCESS_STOPPED   1
#define PROCESS_EXITED   2
#define PROCESS_FLAG_TRACED   0x01
#define THIS   ((struct pid_status *)CURRENT_STORAGE)
#define PROCE_CHDIR   1
#define PROCE_DUP2   2
#define PROCE_SETGID   3
#define PROCE_SETGROUPS   4
#define PROCE_GETPWUID   5
#define PROCE_INITGROUPS   6
#define PROCE_SETUID   7
#define PROCE_EXEC   8
#define PROCE_CLOEXEC   9
#define PROCE_DUP   10
#define PROCE_SETSID   11
#define PROCE_SETCTTY   12
#define PROCE_CHROOT   13
#define PROCE_CLRCLOEXEC   14
#define PROCERROR(err, id)

Functions

int fd_from_object (struct object *o)
 DECLARE_FIFO (sig, unsigned char)
void my_signal (int sig, sigfunctype fun)
PMOD_EXPORT void check_signals (struct callback *foo, void *bar, void *gazonk)
void set_default_signal_handler (int signum, void(*func)(INT32))
int pike_make_pipe (int *)
void f_set_priority (INT32 args)
void f_create_process (INT32 args)
void f_atexit (INT32 args)
PMOD_EXPORT void low_init_signals (void)
void init_signals (void)
void exit_signals (void)

Define Documentation

#define BEGIN_FIFO_LOOP pre,
TYPE   ) 
 

Value:

do {                            \
   int PIKE_CONCAT(pre,_tmp2_)=PIKE_CONCAT(pre,_first);         \
   while(PIKE_CONCAT(pre,_last) != PIKE_CONCAT(pre,_tmp2_))     \
   {                                                            \
     int PIKE_CONCAT(pre,_tmp_);                                \
     if( ++ PIKE_CONCAT(pre,_last) == SIGNAL_BUFFER)            \
       PIKE_CONCAT(pre,_last)=0;                                \
     PIKE_CONCAT(pre,_tmp_)=PIKE_CONCAT(pre,_last)

#define BEGIN_FIFO_PUSH pre,
TYPE   ) 
 

Value:

do { \
  int PIKE_CONCAT(pre,_tmp_)=PIKE_CONCAT(pre,_first) + 1; \
  if(PIKE_CONCAT(pre,_tmp_) >= SIGNAL_BUFFER) PIKE_CONCAT(pre,_tmp_)=0

#define DECLARE_FIFO pre,
TYPE   ) 
 

Value:

static volatile TYPE PIKE_CONCAT(pre,buf) [SIGNAL_BUFFER]; \
  static volatile int PIKE_CONCAT(pre,_first)=0,PIKE_CONCAT(pre,_last)=0

#define dump_process_history PID   ) 
 

#define END_FIFO_LOOP pre,
TYPE   )     } }while(0)
 

#define END_FIFO_PUSH pre,
TYPE   )     PIKE_CONCAT(pre,_first)=PIKE_CONCAT(pre,_tmp_); } while(0)
 

#define FIFO_DATA pre,
TYPE   )     ( PIKE_CONCAT(pre,buf)[PIKE_CONCAT(pre,_tmp_)] )
 

#define fp   Pike_fp
 

#define INIT_FIFO pre,
TYPE   ) 
 

#define MAX_SIGNALS   256
 

#define MY_WAIT_ANY STATUS,
OPT   )     ((errno=ENOTSUP), -1)
 

#define NSIG   256
 

#define PIKE_BADF_LIMIT   1024
 

#define PROC_FPRINTF  ) 
 

#define PROCE_CHDIR   1
 

#define PROCE_CHROOT   13
 

#define PROCE_CLOEXEC   9
 

#define PROCE_CLRCLOEXEC   14
 

#define PROCE_DUP   10
 

#define PROCE_DUP2   2
 

#define PROCE_EXEC   8
 

#define PROCE_GETPWUID   5
 

#define PROCE_INITGROUPS   6
 

#define PROCE_SETCTTY   12
 

#define PROCE_SETGID   3
 

#define PROCE_SETGROUPS   4
 

#define PROCE_SETSID   11
 

#define PROCE_SETUID   7
 

#define PROCERROR err,
id   ) 
 

Value:

do { int _l, _i; \
    buf[0] = err; buf[1] = errno; buf[2] = id; \
    for(_i = 0; _i < 3; _i += _l) { \
      while (((_l = write(control_pipe[1], buf + _i, 3 - _i)) < 0) && \
             (errno == EINTR)) \
        ; \
      if (_l < 0) exit (99 - errno); \
    } \
    while((_l = close(control_pipe[1])) < 0 && errno==EINTR); \
    if (_l < 0) exit (99 + errno); \
    exit(99); \
  } while(0)

#define process_done PID,
FROM   ) 
 

#define PROCESS_EXITED   2
 

#define PROCESS_FLAG_TRACED   0x01
 

#define PROCESS_RUNNING   0
 

#define process_started PID   ) 
 

#define PROCESS_STOPPED   1
 

#define PROCESS_UNKNOWN   -1
 

#define QUICK_CHECK_FIFO pre,
TYPE   )     ( PIKE_CONCAT(pre,_first) != PIKE_CONCAT(pre,_last) )
 

 
#define SAFE_FIFO_DEBUG_BEGIN  )     do {
 

 
#define SAFE_FIFO_DEBUG_END  )     }while(0)
 

#define SIGNAL_BUFFER   16384
 

#define THIS   ((struct pid_status *)CURRENT_STORAGE)
 

#define USE_PID_MAPPING
 

#define WAIT_BUFFER   4096
 

#define WAITPID PID,
STATUS,
OPT   )     -1
 

#define WAITSTATUSTYPE   int
 

#define WEXITSTATUS  )     (((x)>>8)&0xff)
 

#define WUNTRACED   0
 


Function Documentation

PMOD_EXPORT void check_signals struct callback foo,
void *  bar,
void *  gazonk
 

DECLARE_FIFO sig  ,
unsigned  char
 

void exit_signals void   ) 
 

void f_atexit INT32  args  ) 
 

void f_create_process INT32  args  ) 
 

void f_set_priority INT32  args  ) 
 

int fd_from_object struct object o  ) 
 

void init_signals void   ) 
 

PMOD_EXPORT void low_init_signals void   ) 
 

void my_signal int  sig,
sigfunctype  fun
 

int pike_make_pipe int  ) 
 

void set_default_signal_handler int  signum,
void(*)(INT32)  func
 


Generated on Fri Jul 22 23:44:30 2005 for Pike by  doxygen 1.3.9.1