Merge pull request #140784 from bjornfor/libredirect-handle-mkdir
libredirect: handle mkdir(2)
This commit is contained in:
commit
07ee93716c
1 changed files with 14 additions and 0 deletions
|
@ -279,3 +279,17 @@ int system(const char *command)
|
||||||
rewriteSystemCall(command, newCommand);
|
rewriteSystemCall(command, newCommand);
|
||||||
return _system(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);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue