about summary refs log tree commit diff
path: root/pkgs/build-support/libredirect/libredirect.c
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/libredirect/libredirect.c')
-rw-r--r--pkgs/build-support/libredirect/libredirect.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkgs/build-support/libredirect/libredirect.c b/pkgs/build-support/libredirect/libredirect.c
index e60319d09717..ed0d5b0043d5 100644
--- a/pkgs/build-support/libredirect/libredirect.c
+++ b/pkgs/build-support/libredirect/libredirect.c
@@ -137,3 +137,10 @@ int posix_spawn(pid_t * pid, const char * path,
     char buf[PATH_MAX];
     return posix_spawn_real(pid, rewrite(path, buf), file_actions, attrp, argv, envp);
 }
+
+int execv(const char *path, char *const argv[])
+{
+    int (*execv_real) (const char *path, char *const argv[]) = dlsym(RTLD_NEXT, "execv");
+    char buf[PATH_MAX];
+    return execv_real(rewrite(path, buf), argv);
+}