|
From: Adam G. <ar...@cy...> - 2003-04-03 14:20:08
|
patch which adds support for the new gettid() system call, and makes
the new set_thread_area() system call return ENOSYS (currently anything
using this system call should cope with it not existing and fall back to
modify_ldt()).
Index: coregrind/vg_syscalls.c
===================================================================
RCS file: /cvsroot/valgrind/valgrind/coregrind/vg_syscalls.c,v
retrieving revision 1.25
diff -u -r1.25 vg_syscalls.c
--- coregrind/vg_syscalls.c 24 Feb 2003 21:55:34 -0000 1.25
+++ coregrind/vg_syscalls.c 3 Apr 2003 14:11:23 -0000
@@ -30,11 +30,19 @@
*/
#include "vg_include.h"
+#include <errno.h>
/* vg_unsafe.h should NOT be included into any file except this
one. */
#include "vg_unsafe.h"
+#ifndef __NR_set_thread_area
+#define __NR_set_thread_area 243
+#endif
+
+#ifndef __NR_gettid
+#define __NR_gettid 224
+#endif
/* All system calls are channelled through here, doing two things:
@@ -598,6 +610,14 @@
break;
# endif
+# if defined(__NR_set_thread_area)
+ case __NR_set_thread_area:
+ /* set_thread_area() */
+ MAYBE_PRINTF("set_thread_area ( )\n");
+ SET_EAX(tid, -ENOSYS);
+ break;
+# endif
+
# if defined(__NR_modify_ldt)
case __NR_modify_ldt: /* syscall 123 */
/* int modify_ldt(int func, void *ptr,
@@ -647,6 +667,14 @@
break;
# endif
+# if defined(__NR_gettid)
+ case __NR_gettid: /* syscall 224 */
+ /* pid_t gettid(void); */
+ MAYBE_PRINTF("gettid ()\n");
+ KERNEL_DO_SYSCALL(tid,res);
+ break;
+# endif
+
# if defined(__NR_setxattr)
case __NR_setxattr: /* syscall 226 */
/* int setxattr (const char *path, const char *name,
Seeya,
Adam
--
Real Programmers don't comment their code. If it was hard to write,
it should be hard to read, and even harder to modify.
These are all my own opinions.
|