configure: Check for sigprocmask
MinGW defines SIG_BLOCK, but doesn't have signal masks, so rather than checking for SIG_BLOCK, add a configure check for sigprocmask. v2: Also add check to meson.build
This commit is contained in:
parent
6c5d048095
commit
7b4b030df8
|
@ -159,7 +159,8 @@ dnl Checks for library functions.
|
|||
AC_CHECK_FUNCS([backtrace geteuid getuid issetugid getresuid \
|
||||
getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \
|
||||
mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \
|
||||
walkcontext setitimer poll epoll_create1 mkostemp memfd_create])
|
||||
walkcontext setitimer poll epoll_create1 mkostemp memfd_create \
|
||||
sigprocmask])
|
||||
AC_CONFIG_LIBOBJ_DIR([os])
|
||||
AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup\
|
||||
timingsafe_memcmp])
|
||||
|
|
|
@ -512,4 +512,7 @@
|
|||
/* Have <sys/sysmacros.h> header */
|
||||
#undef HAVE_SYS_SYSMACROS_H
|
||||
|
||||
/* Have sigprocmask */
|
||||
#undef HAVE_SIGPROCMASK
|
||||
|
||||
#endif /* _DIX_CONFIG_H_ */
|
||||
|
|
|
@ -155,6 +155,7 @@ conf_data.set('HAVE_SETEUID', cc.has_function('seteuid'))
|
|||
conf_data.set('HAVE_SETITIMER', cc.has_function('setitimer'))
|
||||
conf_data.set('HAVE_SHMCTL64', cc.has_function('shmctl64'))
|
||||
conf_data.set('HAVE_SIGACTION', cc.has_function('sigaction'))
|
||||
conf_data.set('HAVE_SIGPROCMASK', cc.has_function('sigprocmask'))
|
||||
conf_data.set('HAVE_STRCASECMP', cc.has_function('strcasecmp'))
|
||||
conf_data.set('HAVE_STRCASESTR', cc.has_function('strcasestr'))
|
||||
conf_data.set('HAVE_STRLCAT', cc.has_function('strlcat', dependencies: libbsd_dep))
|
||||
|
|
|
@ -558,7 +558,11 @@ extern int InputThreadUnregisterDev(int fd)
|
|||
|
||||
int xthread_sigmask(int how, const sigset_t *set, sigset_t *oldset)
|
||||
{
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
return sigprocmask(how, set, oldset);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1281,7 +1281,7 @@ SmartScheduleInit(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef SIG_BLOCK
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
static sigset_t PreviousSignalMask;
|
||||
static int BlockedSignalCount;
|
||||
#endif
|
||||
|
@ -1289,7 +1289,7 @@ static int BlockedSignalCount;
|
|||
void
|
||||
OsBlockSignals(void)
|
||||
{
|
||||
#ifdef SIG_BLOCK
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
if (BlockedSignalCount++ == 0) {
|
||||
sigset_t set;
|
||||
|
||||
|
@ -1311,7 +1311,7 @@ OsBlockSignals(void)
|
|||
void
|
||||
OsReleaseSignals(void)
|
||||
{
|
||||
#ifdef SIG_BLOCK
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
if (--BlockedSignalCount == 0) {
|
||||
xthread_sigmask(SIG_SETMASK, &PreviousSignalMask, 0);
|
||||
}
|
||||
|
@ -1321,7 +1321,7 @@ OsReleaseSignals(void)
|
|||
void
|
||||
OsResetSignals(void)
|
||||
{
|
||||
#ifdef SIG_BLOCK
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
while (BlockedSignalCount > 0)
|
||||
OsReleaseSignals();
|
||||
input_force_unlock();
|
||||
|
|
Loading…
Reference in New Issue