[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/16] linux-user: add support for rt_tgsigqueueinfo
From: |
Miloš Stojanović |
Subject: |
[Qemu-devel] [PATCH 06/16] linux-user: add support for rt_tgsigqueueinfo() system call |
Date: |
Fri, 12 May 2017 13:02:14 +0200 |
Add a new system call: rt_tgsigqueueinfo().
This system call is similar to rt_sigqueueinfo(), but instead of
sending the signal and data to the whole thread group with the ID
equal to the argument tgid, it sends it to a single thread within
that thread group. The ID of the thread is specified by the tid
argument.
The implementation is based on the rt_sigqueueinfo() in linux-user
mode, where the tid is added as the second argument and the
previous second and third argument become arguments three and four,
respectively.
Signed-off-by: Miloš Stojanović <address@hidden>
Conflicts:
linux-user/syscall.c
---
linux-user/syscall.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9ec7ccd..d3b769e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -238,6 +238,7 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4
arg4,type5 arg5, \
#define __NR_sys_getdents64 __NR_getdents64
#define __NR_sys_getpriority __NR_getpriority
#define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
+#define __NR_sys_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo
#define __NR_sys_syslog __NR_syslog
#define __NR_sys_futex __NR_futex
#define __NR_sys_inotify_init __NR_inotify_init
@@ -275,6 +276,8 @@ _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
loff_t *, res, uint, wh);
#endif
_syscall3(int, sys_rt_sigqueueinfo, pid_t, pid, int, sig, siginfo_t *, uinfo)
+_syscall4(int, sys_rt_tgsigqueueinfo, pid_t, pid, pid_t, tid, int, sig,
+ siginfo_t *, uinfo)
_syscall3(int,sys_syslog,int,type,char*,bufp,int,len)
#ifdef __NR_exit_group
_syscall1(int,exit_group,int,error_code)
@@ -8843,6 +8846,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
arg1,
ret = get_errno(sys_rt_sigqueueinfo(arg1, arg2, &uinfo));
}
break;
+ case TARGET_NR_rt_tgsigqueueinfo:
+ {
+ siginfo_t uinfo;
+
+ p = lock_user(VERIFY_READ, arg4, sizeof(target_siginfo_t), 1);
+ if (!p) {
+ goto efault;
+ }
+ target_to_host_siginfo(&uinfo, p);
+ unlock_user(p, arg4, 0);
+ ret = get_errno(sys_rt_tgsigqueueinfo(arg1, arg2, arg3, &uinfo));
+ }
+ break;
#ifdef TARGET_NR_sigreturn
case TARGET_NR_sigreturn:
if (block_signals()) {
--
1.9.1
- [Qemu-devel] [PATCH 07/16] linux-user: add rt_tgsigqueueinfo() strace, (continued)
- [Qemu-devel] [PATCH 07/16] linux-user: add rt_tgsigqueueinfo() strace, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 13/16] [RFC] linux-user: add functions for working with the target signal mask, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 03/16] linux-user: fix ssetmask() system call, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 08/16] linux-user: fix inconsistent spaces in print_siginfo() output, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 12/16] [RFC] linux-user: fix sigismember() check, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 01/16] linux-user: add strace for getuid(), gettid(), getppid(), geteuid(), Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 10/16] [RFC] linux-user: add support for tracking the target signal mask, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 05/16] linux-user: fix argument type declaration of rt_sigqueinfo() syscall, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 02/16] linux-user: add tkill(), tgkill() and rt_sigqueueinfo() strace, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 11/16] [RFC] linux-user: add target_sigdelset() and target_sigorset(), Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 06/16] linux-user: add support for rt_tgsigqueueinfo() system call,
Miloš Stojanović <=
- [Qemu-devel] [PATCH 04/16] linux-user: fix mismatch of lock/unlock_user() invocations in rt_sigqueinfo() syscall, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 15/16] [RFC] linux-user: add support for multiplexing larger target signals, Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 09/16] linux-user: add strace support for uinfo structure of rt_sigqueueinfo() and rt_tgsigqueueinfo(), Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 16/16] [RFC] linux-user: add support for multiplexing signals in rt_sigqueueinfo(), rt_tgsigqueueinfo(), kill() and tgkill() syscalls., Miloš Stojanović, 2017/05/12
- [Qemu-devel] [PATCH 14/16] [RFC] linux-user: add functionality for tracking target signal mask, Miloš Stojanović, 2017/05/12
- Re: [Qemu-devel] [PATCH 00/16] Augment support for signal handling, no-reply, 2017/05/12