aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2022-05-28 12:52:10 +0200
committerLaurent Vivier <laurent@vivier.eu>2022-06-24 10:00:01 +0200
commit9a7f682c26acae5bc8bfd1f7c774070da54f1625 (patch)
tree8f1c0ebc183867c574a74b07be9b9d60329d151d /linux-user
parent892a4f6a750abceeda4c1ee8324f58f82fd6bd89 (diff)
linux-user: Adjust child_tidptr on set_tid_address() syscall
Keep track of the new child tidptr given by a set_tid_address() syscall. Do not call the host set_tid_address() syscall because we are emulating the behaviour of writing to child_tidptr in the exit() path. Signed-off-by: Helge Deller<deller@gmx.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <YpH+2sw1PCRqx/te@p100> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8f68f255c0..669add74c1 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -320,9 +320,6 @@ _syscall3(int,sys_syslog,int,type,char*,bufp,int,len)
#ifdef __NR_exit_group
_syscall1(int,exit_group,int,error_code)
#endif
-#if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address)
-_syscall1(int,set_tid_address,int *,tidptr)
-#endif
#if defined(__NR_futex)
_syscall6(int,sys_futex,int *,uaddr,int,op,int,val,
const struct timespec *,timeout,int *,uaddr2,int,val3)
@@ -12196,9 +12193,14 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
}
#endif
-#if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address)
+#if defined(TARGET_NR_set_tid_address)
case TARGET_NR_set_tid_address:
- return get_errno(set_tid_address((int *)g2h(cpu, arg1)));
+ {
+ TaskState *ts = cpu->opaque;
+ ts->child_tidptr = arg1;
+ /* do not call host set_tid_address() syscall, instead return tid() */
+ return get_errno(sys_gettid());
+ }
#endif
case TARGET_NR_tkill: