diff options
author | Demin Dmitriy <demindf@gmail.com> | 2015-10-24 18:04:33 +0300 |
---|---|---|
committer | Demin Dmitriy <demindf@gmail.com> | 2015-10-24 18:04:33 +0300 |
commit | 0cea20a6522ed0d84d39c550e46f1d755176adcc (patch) | |
tree | 8ac0adf0433bb0dcbe500f0b53052139ba7cea3c /pkgs/build-support | |
parent | b7f3d5597998c84083ff10cc4f133c38c537b494 (diff) | |
download | nixlib-0cea20a6522ed0d84d39c550e46f1d755176adcc.tar nixlib-0cea20a6522ed0d84d39c550e46f1d755176adcc.tar.gz nixlib-0cea20a6522ed0d84d39c550e46f1d755176adcc.tar.bz2 nixlib-0cea20a6522ed0d84d39c550e46f1d755176adcc.tar.lz nixlib-0cea20a6522ed0d84d39c550e46f1d755176adcc.tar.xz nixlib-0cea20a6522ed0d84d39c550e46f1d755176adcc.tar.zst nixlib-0cea20a6522ed0d84d39c550e46f1d755176adcc.zip |
libredirect: add __xlib64 and posix_spawn
Diffstat (limited to 'pkgs/build-support')
-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); +} |