Changeset 143 for trunk/include


Ignore:
Timestamp:
Oct 31, 2007, 1:09:26 AM (17 years ago)
Author:
rainer
Message:

Bugfixes and threaded process check.

Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/samhain.h

    r140 r143  
    128128};
    129129
    130 enum {
    131   SH_MOD_ACTIVE    = 0,
    132   SH_MOD_THREAD    = 1,
    133   SH_MOD_FAILED    = 2
    134 };
    135 
     130#define SH_MOD_THREAD  1
     131#define SH_MOD_ACTIVE  0
     132#define SH_MOD_FAILED -1
     133 
    136134/* Flags for file status
    137135 */
     
    287285extern volatile  int      sig_debug_switch;       /* SIGUSR1 */
    288286extern volatile  int      sig_suspend_switch;     /* SIGUSR2 */
    289 extern volatile  int      sh_global_suspend_flag; /* SIGUSR2 */
     287extern volatile  int      sh_global_suspend_flag;
    290288extern volatile  int      sig_fresh_trail;        /* SIGIOT  */
     289extern volatile  int      sh_thread_pause_flag;
    291290extern volatile  int      sig_config_read_again;  /* SIGHUP  */
    292291extern volatile  int      sig_terminate;          /* SIGQUIT */
  • trunk/include/sh_pthread.h

    r140 r143  
    3838#if defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
    3939
    40 /* On GNU C, it's an enum, thus the alternative implementation
    41  * below is used.
    42  */
    4340#define SH_MUTEX_RECURSIVE(M)                                          \
    4441static pthread_mutex_t M;                                              \
     
    4643{                                                                      \
    4744  pthread_mutexattr_t   mta;                                           \
     45  pthread_mutexattr_init(&mta);                                        \
    4846  pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE);            \
    4947  pthread_mutex_init(&(M), &mta);                                      \
     
    115113SH_MUTEX_EXTERN(mutex_pwent);
    116114SH_MUTEX_EXTERN(mutex_readdir);
     115/* Prevent threads from logging while we are in suspend */
     116SH_MUTEX_EXTERN(mutex_thread_nolog);
    117117
    118118/*
     
    120120 */
    121121extern int sh_g_thread();
     122
     123
     124/*
     125 * ----   Functions for threaded modules   ----
     126 */
     127int sh_pthread_create(void *(*start_routine)(void*), void *arg);
     128int sh_pthread_cancel_all(void);
     129void sh_threaded_module_reconf(void *arg);
     130void * sh_threaded_module_run(void *arg);
    122131
    123132#else
Note: See TracChangeset for help on using the changeset viewer.