diff --git a/include/common/compat.h b/include/common/compat.h index e0f00dcf1e..9b97d82144 100644 --- a/include/common/compat.h +++ b/include/common/compat.h @@ -104,10 +104,17 @@ typedef struct { } empty_t; #define F_SETPIPE_SZ (1024 + 7) #endif -/* systems without such defines do not know clockid_t */ +/* systems without such defines do not know clockid_t or timer_t */ #if !(_POSIX_TIMERS > 0) || (_POSIX_C_SOURCE < 199309L) #undef clockid_t #define clockid_t empty_t +#undef timer_t +#define timer_t empty_t +#endif + +/* define a dummy value to designate "no timer". Use only 32 bits. */ +#ifndef TIMER_INVALID +#define TIMER_INVALID ((timer_t)(unsigned long)(0xfffffffful)) #endif #if defined(TPROXY) && defined(NETFILTER) diff --git a/include/common/hathreads.h b/include/common/hathreads.h index 32099094c0..268dd6349f 100644 --- a/include/common/hathreads.h +++ b/include/common/hathreads.h @@ -58,6 +58,7 @@ enum { tid = 0 }; extern struct thread_info { clockid_t clock_id; + timer_t wd_timer; /* valid timer or TIMER_INVALID if not set */ uint64_t prev_cpu_time; /* previous per thread CPU time */ uint64_t prev_mono_time; /* previous system wide monotonic time */ unsigned int idle_pct; /* idle to total ratio over last sample (percent) */ @@ -407,6 +408,7 @@ void ha_tkillall(int sig); extern struct thread_info { pthread_t pthread; clockid_t clock_id; + timer_t wd_timer; /* valid timer or TIMER_INVALID if not set */ uint64_t prev_cpu_time; /* previous per thread CPU time */ uint64_t prev_mono_time; /* previous system wide monotonic time */ unsigned int idle_pct; /* idle to total ratio over last sample (percent) */