diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2021-10-10 09:09:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-10 09:09:34 +0100 |
commit | 07ee93716cb0d81addd68ea9344970c3cf6f7c11 (patch) | |
tree | 3e934d6e4e8e448970b8cbe79538df91353b4399 | |
parent | b7e7d35cccea936bc41d9f2602bda3effee97b0a (diff) | |
parent | 864f96cd7fd732b9339494b2890ebe0685b43a7f (diff) |
Merge pull request #140784 from bjornfor/libredirect-handle-mkdir
libredirect: handle mkdir(2)
-rw-r--r-- | pkgs/build-support/libredirect/libredirect.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkgs/build-support/libredirect/libredirect.c b/pkgs/build-support/libredirect/libredirect.c index 5b0ef4856708..c7058ce123c5 100644 --- a/pkgs/build-support/libredirect/libredirect.c +++ b/pkgs/build-support/libredirect/libredirect.c @@ -279,3 +279,17 @@ int system(const char *command) rewriteSystemCall(command, newCommand); return _system(newCommand); } + +int mkdir(const char *path, mode_t mode) +{ + int (*mkdir_real) (const char *path, mode_t mode) = dlsym(RTLD_NEXT, "mkdir"); + char buf[PATH_MAX]; + return mkdir_real(rewrite(path, buf), mode); +} + +int mkdirat(int dirfd, const char *path, mode_t mode) +{ + int (*mkdirat_real) (int dirfd, const char *path, mode_t mode) = dlsym(RTLD_NEXT, "mkdirat"); + char buf[PATH_MAX]; + return mkdirat_real(dirfd, rewrite(path, buf), mode); +} |