linux-user: Implement PR_GET_TID_ADDRESS
authorRichard Henderson <richard.henderson@linaro.org>
Sat, 2 Mar 2024 01:04:39 +0000 (15:04 -1000)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 12 Mar 2024 13:35:01 +0000 (03:35 -1000)
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
linux-user/syscall.c

index 4871c4b648cf81904e333d3942df0e3d1a89f201..e12d969c2ef9a7ae6bdb246e5d20663e820cc663 100644 (file)
@@ -6468,8 +6468,10 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2,
         }
 
     case PR_GET_TID_ADDRESS:
-        /* TODO */
-        return -TARGET_EINVAL;
+        {
+            TaskState *ts = env_cpu(env)->opaque;
+            return put_user_ual(ts->child_tidptr, arg2);
+        }
 
     case PR_GET_FPEXC:
     case PR_SET_FPEXC: