aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/Linux/trace.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/Linux/trace.c')
-rw-r--r--sysdeps/Linux/trace.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sysdeps/Linux/trace.c b/sysdeps/Linux/trace.c
index 1068a84..10fff3e 100644
--- a/sysdeps/Linux/trace.c
+++ b/sysdeps/Linux/trace.c
@@ -8,14 +8,22 @@
#include "ltrace.h"
#include "options.h"
-/* Returns 1 if a new child is about to be created
- (ie, with fork() or clone())
- Returns 0 otherwise. */
-int child_p(int sysnum)
+/* Returns 1 if the sysnum may make a new child to be created
+ * (ie, with fork() or clone())
+ * Returns 0 otherwise.
+ */
+int fork_p(int sysnum)
{
return (sysnum == __NR_fork || sysnum == __NR_clone);
}
+/* Returns 1 if the sysnum may make the process exec other program
+ */
+int exec_p(int sysnum)
+{
+ return (sysnum == __NR_execve);
+}
+
void trace_me(void)
{
if (ptrace(PTRACE_TRACEME, 0, 1, 0)<0) {