@@ -259,15 +259,9 @@ static inline type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,
259
259
#define TARGET_NR__llseek TARGET_NR_llseek
260
260
#endif
261
261
262
- #ifdef __NR_gettid
263
- _syscall0 (int , gettid )
264
- #else
265
- /* This is a replacement for the host gettid() and must return a host
266
- errno. */
267
- static int gettid (void ) {
268
- return - ENOSYS ;
269
- }
270
- #endif
262
+ #define __NR_sys_gettid __NR_gettid
263
+ _syscall0 (int , sys_gettid )
264
+
271
265
#if defined(TARGET_NR_getdents ) && defined(__NR_getdents )
272
266
_syscall3 (int , sys_getdents , uint , fd , struct linux_dirent * , dirp , uint , count );
273
267
#endif
@@ -6448,7 +6442,7 @@ static void *clone_func(void *arg)
6448
6442
cpu = ENV_GET_CPU (env );
6449
6443
thread_cpu = cpu ;
6450
6444
ts = (TaskState * )cpu -> opaque ;
6451
- info -> tid = gettid ();
6445
+ info -> tid = sys_gettid ();
6452
6446
task_settid (ts );
6453
6447
#ifdef TARGET_ABI_IRIX
6454
6448
/* TODO: which fields in the PRDA are filled in by the IRIX kernel? */
@@ -6610,9 +6604,9 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp,
6610
6604
mapping. We can't repeat the spinlock hack used above because
6611
6605
the child process gets its own copy of the lock. */
6612
6606
if (flags & CLONE_CHILD_SETTID )
6613
- put_user_u32 (gettid (), child_tidptr );
6607
+ put_user_u32 (sys_gettid (), child_tidptr );
6614
6608
if (flags & CLONE_PARENT_SETTID )
6615
- put_user_u32 (gettid (), parent_tidptr );
6609
+ put_user_u32 (sys_gettid (), parent_tidptr );
6616
6610
if (flags & CLONE_SETTLS )
6617
6611
cpu_set_tls (env , newtls );
6618
6612
if (flags & CLONE_CHILD_CLEARTID )
@@ -12589,7 +12583,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
12589
12583
#endif
12590
12584
#ifdef TARGET_NR_gettid
12591
12585
case TARGET_NR_gettid :
12592
- ret = get_errno (gettid ());
12586
+ ret = get_errno (sys_gettid ());
12593
12587
break ;
12594
12588
#endif
12595
12589
#ifdef TARGET_NR_readahead
0 commit comments