diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/build-support/libredirect/libredirect.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pkgs/build-support/libredirect/libredirect.c b/pkgs/build-support/libredirect/libredirect.c index 4e0a8245ac1d..c24560a1a493 100644 --- a/pkgs/build-support/libredirect/libredirect.c +++ b/pkgs/build-support/libredirect/libredirect.c @@ -8,6 +8,7 @@ #include <fcntl.h> #include <limits.h> #include <string.h> +#include <spawn.h> #define MAX_REDIRECTS 128 @@ -103,9 +104,29 @@ int __xstat(int ver, const char * path, struct stat * st) return __xstat_real(ver, rewrite(path, buf), st); } +int __xstat64(int ver, const char * path, struct stat64 * st) +{ + int (*__xstat64_real) (int ver, const char *, struct stat64 *) = dlsym(RTLD_NEXT, "__xstat64"); + char buf[PATH_MAX]; + return __xstat64_real(ver, rewrite(path, buf), st); +} + int * access(const char * path, int mode) { int * (*access_real) (const char *, int mode) = dlsym(RTLD_NEXT, "access"); char buf[PATH_MAX]; return access_real(rewrite(path, buf), mode); } + +int posix_spawn(pid_t * pid, const char * path, + const posix_spawn_file_actions_t * file_actions, + const posix_spawnattr_t * attrp, + char * const argv[], char * const envp[]) +{ + int (*posix_spawn_real) (pid_t *, const char *, + const posix_spawn_file_actions_t *, + const posix_spawnattr_t *, + char * const argv[], char * const envp[]) = dlsym(RTLD_NEXT, "posix_spawn"); + char buf[PATH_MAX]; + return posix_spawn_real(pid, rewrite(path, buf), file_actions, attrp, argv, envp); +} |