mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-02 07:31:26 +00:00
libredirect: add __xlib64 and posix_spawn
This commit is contained in:
parent
b7f3d55979
commit
0cea20a652
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user