[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 05/19] linux-user: Define macro for size of host
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH v2 05/19] linux-user: Define macro for size of host kernel sigset_t |
Date: |
Fri, 27 May 2016 15:51:47 +0100 |
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 <address@hidden>
---
linux-user/syscall.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index df70255..e4b7404 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -119,6 +119,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
@@ -7221,7 +7225,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) {
@@ -8275,7 +8279,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);
--
1.9.1
- [Qemu-devel] [PATCH v2 18/19] linux-user: Avoid possible misalignment in host_to_target_siginfo(), (continued)
- [Qemu-devel] [PATCH v2 18/19] linux-user: Avoid possible misalignment in host_to_target_siginfo(), Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 14/19] linux-user: Restart exit() if signal pending, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 11/19] linux-user: Queue synchronous signals separately, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 12/19] linux-user: Block signals during sigaction() handling, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 13/19] linux-user: pause() should not pause if signal pending, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 03/19] linux-user: Fix stray tab-indent, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 09/19] linux-user: Remove redundant gdb_queuesig(), Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 08/19] linux-user: Remove redundant default action check in queue_signal(), Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 10/19] linux-user: Remove real-time signal queuing, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 06/19] linux-user: Use safe_syscall for sigsuspend syscalls, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 05/19] linux-user: Define macro for size of host kernel sigset_t,
Peter Maydell <=
- [Qemu-devel] [PATCH v2 07/19] linux-user: Fix race between multiple signals, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 02/19] linux-user: Move handle_pending_signal() to avoid need for declaration, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 01/19] linux-user: Factor out handle_signal code from process_pending_signals(), Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 04/19] linux-user: Factor out uses of do_sigprocmask() from sigreturn code, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 15/19] linux-user: Use safe_syscall for kill, tkill and tgkill syscalls, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 17/19] linux-user: Use both si_code and si_signo when converting siginfo_t, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 19/19] linux-user: Avoid possible misalignment in target_to_host_siginfo(), Peter Maydell, 2016/05/27