summaryrefslogtreecommitdiff
path: root/util/compatfd.c
diff options
context:
space:
mode:
authorKacper Słomiński <kacper.slominski72@gmail.com>2021-09-05 03:16:22 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2021-10-13 10:47:49 +0200
commit6bd17dccb63e152266cf7a7399931c9fe11bc8cf (patch)
tree38badc0e2c5bdddccbe3a3ff68a9b182a81015f5 /util/compatfd.c
parentecc00666a020368ec2c3712c40386dc7ea75a8a9 (diff)
downloadqemu-6bd17dccb63e152266cf7a7399931c9fe11bc8cf.zip
util/compatfd.c: use libc signalfd wrapper instead of raw syscall
This allows the use of native signalfd instead of the sigtimedwait based emulation on systems other than Linux. Signed-off-by: Kacper Słomiński <kacper.slominski72@gmail.com> Message-Id: <20210905011621.200785-1-kacper.slominski72@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'util/compatfd.c')
-rw-r--r--util/compatfd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/util/compatfd.c b/util/compatfd.c
index a8ec525c6c..ab810c42a9 100644
--- a/util/compatfd.c
+++ b/util/compatfd.c
@@ -17,7 +17,7 @@
#include "qemu/thread.h"
#if defined(CONFIG_SIGNALFD)
-#include <sys/syscall.h>
+#include <sys/signalfd.h>
#endif
struct sigfd_compat_info {
@@ -96,9 +96,8 @@ int qemu_signalfd(const sigset_t *mask)
#if defined(CONFIG_SIGNALFD)
int ret;
- ret = syscall(SYS_signalfd, -1, mask, _NSIG / 8);
+ ret = signalfd(-1, mask, SFD_CLOEXEC);
if (ret != -1) {
- qemu_set_cloexec(ret);
return ret;
}
#endif