libredirect: add 'remove'

This commit is contained in:
Bjørn Forsman
2026-01-21 19:20:36 +01:00
parent 21bd98adb3
commit f9be01f4c0
@@ -460,6 +460,14 @@ WRAPPER(int, unlinkat)(int dirfd, const char *path, int flags)
}
WRAPPER_DEF(unlinkat)
WRAPPER(int, remove)(const char *path)
{
int (*remove_real) (const char *path) = LOOKUP_REAL(remove);
char buf[PATH_MAX];
return remove_real(rewrite(path, buf));
}
WRAPPER_DEF(remove)
WRAPPER(int, rmdir)(const char *path)
{
int (*rmdir_real) (const char *path) = LOOKUP_REAL(rmdir);