]> git.openpandora.org Git - pandora-kernel.git/commitdiff
task_current_syscall
authorRoland McGrath <roland@redhat.com>
Sat, 26 Jul 2008 02:45:59 +0000 (19:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 Jul 2008 19:00:10 +0000 (12:00 -0700)
This adds the new function task_current_syscall() on machines where the
asm/syscall.h interface is supported (CONFIG_HAVE_ARCH_TRACEHOOK).  It's
exported for modules to use in the future.  This function safely samples
the state of a blocked thread to collect what system call it is blocked
in, and the six system call argument registers.

Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/ptrace.h
lib/Makefile
lib/syscall.c [new file with mode: 0644]

index ed69c03692d9fb49ca8b201a262a6c3996003e11..fd31756e1a00f632189022dec352a49fe525ac62 100644 (file)
@@ -314,6 +314,10 @@ static inline void user_enable_block_step(struct task_struct *task)
 #define arch_ptrace_stop(code, info)           do { } while (0)
 #endif
 
+extern int task_current_syscall(struct task_struct *target, long *callno,
+                               unsigned long args[6], unsigned int maxargs,
+                               unsigned long *sp, unsigned long *pc);
+
 #endif
 
 #endif
index 9085ad6fa53dbf223b8941c663fa2ec8af2c99e7..942c7250f6036c1fd68f1321268503920fc23ef0 100644 (file)
@@ -78,6 +78,8 @@ lib-$(CONFIG_GENERIC_BUG) += bug.o
 
 obj-$(CONFIG_HAVE_LMB) += lmb.o
 
+obj-$(CONFIG_HAVE_ARCH_TRACEHOOK) += syscall.o
+
 hostprogs-y    := gen_crc32table
 clean-files    := crc32table.h
 
diff --cc lib/syscall.c
Simple merge