qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 049/108] linux-user: Fix stub gettid


From: Richard Henderson
Subject: [Qemu-devel] [PATCH v2 049/108] linux-user: Fix stub gettid
Date: Sat, 9 Jun 2018 17:01:21 -1000

A "proper" implementation of the stub would assign ENOSYS to
errno and return -1.  As it is, the subsequent get_error will
return whatever garbage value was in errno.

Use the bogus syscall method for defining the stub function.

Signed-off-by: Richard Henderson <address@hidden>
---
 linux-user/syscall.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 4dc2312ae6..46c7c485fd 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -256,17 +256,12 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 
arg4,type5 arg5, \
 #ifndef __NR_getrandom
 #define __NR_getrandom  -1
 #endif
-
-#ifdef __NR_gettid
-_syscall0(int, gettid)
-#else
-/* This is a replacement for the host gettid() and must return a host
-   errno. */
-static int gettid(void) {
-    return -ENOSYS;
-}
+#ifndef __NR_gettid
+#define __NR_gettid  -1
 #endif
 
+_syscall0(int, gettid)
+
 /* For the 64-bit guest on 32-bit host case we must emulate
  * getdents using getdents64, because otherwise the host
  * might hand us back more dirent records than we can fit
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]