summaryrefslogtreecommitdiffstats
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorPeter Maydell2016-05-27 16:51:47 +0200
committerRiku Voipio2016-06-07 15:39:06 +0200
commitb28a1f333a5875e6f48725efd19c76fc3d27d8d1 (patch)
tree4579f2f46e86e7da81bb87192574fffa4688c652 /linux-user/syscall.c
parentlinux-user: Factor out uses of do_sigprocmask() from sigreturn code (diff)
downloadqemu-b28a1f333a5875e6f48725efd19c76fc3d27d8d1.tar.gz
qemu-b28a1f333a5875e6f48725efd19c76fc3d27d8d1.tar.xz
qemu-b28a1f333a5875e6f48725efd19c76fc3d27d8d1.zip
linux-user: Define macro for size of host kernel sigset_t
Some host syscalls take an argument specifying the size of a host kernel's sigset_t (which isn't necessarily the same as that of the host libc's type of that name). Instead of hardcoding _NSIG / 8 where we do this, define and use a SIGSET_T_SIZE macro. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9cc9a35cf5..d2749a6648 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -124,6 +124,10 @@ int __clone2(int (*fn)(void *), void *child_stack_base,
#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct linux_dirent [2])
#define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct linux_dirent [2])
+/* This is the size of the host kernel's sigset_t, needed where we make
+ * direct system calls that take a sigset_t pointer and a size.
+ */
+#define SIGSET_T_SIZE (_NSIG / 8)
#undef _syscall0
#undef _syscall1
@@ -7862,7 +7866,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
/* Extract the two packed args for the sigset */
if (arg6) {
sig_ptr = &sig;
- sig.size = _NSIG / 8;
+ sig.size = SIGSET_T_SIZE;
arg7 = lock_user(VERIFY_READ, arg6, sizeof(*arg7) * 2, 1);
if (!arg7) {
@@ -8916,7 +8920,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
set = NULL;
}
- ret = get_errno(sys_ppoll(pfd, nfds, timeout_ts, set, _NSIG/8));
+ ret = get_errno(sys_ppoll(pfd, nfds, timeout_ts,
+ set, SIGSET_T_SIZE));
if (!is_error(ret) && arg3) {
host_to_target_timespec(arg3, timeout_ts);