SYSCALL_TRACK( pre_mem_read_asciiz, tid, "execve(filename)", arg1 );
pre_argv_envp( arg2, tid, "execve(argv)", "execve(argv[i])" );
- pre_argv_envp( arg3, tid, "execve(envp)", "execve(envp[i])" );
+ if (arg3 != (UInt)NULL)
+ pre_argv_envp( arg3, tid, "execve(envp)", "execve(envp[i])" );
/* Erk. If the exec fails, then the following will have made a
mess of things which makes it hard for us to continue. The
discard.stderr.exp discard.stdout.exp \
discard.vgtest \
exec-sigmask.vgtest exec-sigmask.stdout.exp exec-sigmask.stderr.exp \
+ execve.vgtext execve.stdout.exp execve.stderr.exp \
floored.stderr.exp floored.stdout.exp \
floored.vgtest \
fork.stderr.exp fork.stdout.exp fork.vgtest \
check_PROGRAMS = \
args badseg bitfield1 bt_everything bt_literal closeall coolo_strlen \
- cpuid dastest discard exec-sigmask floored fork fpu_lazy_eflags \
- fucomip $(INSN_TESTS) \
+ cpuid dastest discard exec-sigmask execve floored fork \
+ fpu_lazy_eflags fucomip $(INSN_TESTS) \
int munmap_exe map_unmap mremap rcl_assert \
rcrl readline1 resolv seg_override sem semlimit sha1_test \
shortpush shorts smc1 susphello pth_blockedsig pushpopseg \
dastest_SOURCES = dastest_c.c dastest_s.s
discard_SOURCES = discard.c
exec_sigmask_SOURCES = exec-sigmask.c
+execve = execve.c
fork_SOURCES = fork.c
floored_SOURCES = floored.c
floored_LDADD = -lm
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+int main(int argc, char **argv)
+{
+ if (argc == 1)
+ {
+ char *newargv[3] = { argv[0], "done", NULL };
+
+ if (execve(argv[0], newargv, NULL) < 0)
+ {
+ perror("execve");
+ exit(1);
+ }
+ }
+
+ exit(0);
+}