mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
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>
This commit is contained in:
parent
ecc00666a0
commit
6bd17dccb6
2 changed files with 5 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue