diff options
Diffstat (limited to 'include/my_pthread.h')
-rw-r--r-- | include/my_pthread.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h index acac64790ce..eeee0c387cb 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -191,7 +191,19 @@ extern int my_pthread_create_detached; int sigwait(sigset_t *set, int *sig); #endif -#define my_sigwait(A,B) sigwait((A),(B)) +static inline int my_sigwait(sigset_t *set, int *sig, int *code) +{ +#ifdef HAVE_SIGWAITINFO + siginfo_t siginfo; + *sig= sigwaitinfo(set, &siginfo); + *code= siginfo.si_code; + return *sig < 0 ? errno : 0; +#else +#define SI_KERNEL 128 + *code= 0; + return sigwait(set, sig); +#endif +} #if defined(HAVE_SIGTHREADMASK) && !defined(HAVE_PTHREAD_SIGMASK) #define pthread_sigmask(A,B,C) sigthreadmask((A),(B),(C)) |