fix build error in xUbuntu_19.10 87/228987/2
authoryan11.meng <yan11.meng@samsung.com>
Fri, 27 Mar 2020 02:52:35 +0000 (10:52 +0800)
committeryan11.meng <yan11.meng@samsung.com>
Fri, 27 Mar 2020 03:03:41 +0000 (11:03 +0800)
Change-Id: I5eaeaf7bd2f31ec52d4596561a81c506f5791de0
Signed-off-by: yan11.meng <yan11.meng@samsung.com>
linux-user/strace.c
linux-user/syscall.c

index ea6c1d24e6489559965b9f2ce59798bd635c3f61..2517942b5325fc8bb1fabcd9886e4f2dcae5c2b1 100644 (file)
@@ -9,6 +9,7 @@
 #include <sys/mman.h>
 #include <unistd.h>
 #include <sched.h>
+#include <sys/sysmacros.h>
 #include "qemu.h"
 
 int do_strace=0;
index 2b419451fe1a3069a121437bbb92a40d5ddf0e07..998ae6a6722d294c1d3e2cd86941cbdc989f91f0 100644 (file)
@@ -175,7 +175,7 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,   \
        return syscall(__NR_##name, arg1, arg2, arg3, arg4, arg5, arg6);        \
 }
 
-
+#define __NR_sys_gettid __NR_gettid
 #define __NR_sys_uname __NR_uname
 #define __NR_sys_getcwd1 __NR_getcwd
 #define __NR_sys_getdents __NR_getdents
@@ -196,11 +196,11 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \
 #endif
 
 #ifdef __NR_gettid
-_syscall0(int, gettid)
+_syscall0(int, sys_gettid)
 #else
 /* This is a replacement for the host gettid() and must return a host
    errno. */
-static int gettid(void) {
+static int sys_gettid(void) {
     return -ENOSYS;
 }
 #endif
@@ -4247,7 +4247,7 @@ static void *clone_func(void *arg)
     cpu = ENV_GET_CPU(env);
     thread_cpu = cpu;
     ts = (TaskState *)env->opaque;
-    info->tid = gettid();
+    info->tid = sys_gettid();
     cpu->host_tid = info->tid;
     task_settid(ts);
     if (info->child_tidptr)
@@ -4364,9 +4364,9 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp,
                mapping.  We can't repeat the spinlock hack used above because
                the child process gets its own copy of the lock.  */
             if (flags & CLONE_CHILD_SETTID)
-                put_user_u32(gettid(), child_tidptr);
+                put_user_u32(sys_gettid(), child_tidptr);
             if (flags & CLONE_PARENT_SETTID)
-                put_user_u32(gettid(), parent_tidptr);
+                put_user_u32(sys_gettid(), parent_tidptr);
             ts = (TaskState *)env->opaque;
             if (flags & CLONE_SETTLS)
                 cpu_set_tls (env, newtls);
@@ -8318,7 +8318,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         break;
 #endif
     case TARGET_NR_gettid:
-        ret = get_errno(gettid());
+        ret = get_errno(sys_gettid());
         break;
 #ifdef TARGET_NR_readahead
     case TARGET_NR_readahead: