blob: 1b6cd0c652e0560f23d630c4deba967afbd846d3 [file] [log] [blame]
Dmitry V. Levin30ac0622015-08-03 09:47:25 +00001#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <fcntl.h>
6#include <signal.h>
7#include <unistd.h>
8#ifdef HAVE_SYS_SIGNALFD_H
9# include <sys/signalfd.h>
10#endif
11
12int
13main(void)
14{
Dmitry V. Levin857adac2015-08-26 21:02:04 +000015#if defined HAVE_SYS_SIGNALFD_H && defined HAVE_SIGNALFD && defined O_CLOEXEC
Dmitry V. Levin30ac0622015-08-03 09:47:25 +000016 sigset_t mask;
17 sigemptyset(&mask);
18 sigaddset(&mask, SIGUSR2);
19 sigaddset(&mask, SIGCHLD);
20 (void) close(0);
21 return signalfd(-1, &mask, O_CLOEXEC | O_NONBLOCK) == 0 ?
22 0 : 77;
23#else
24 return 77;
25#endif
26}