From 98f53c576045dbc85525ca39a913f078f84ec35d Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Wed, 10 Oct 2012 15:05:37 +0100 Subject: rmdir: Use unlinkat if arch does not have the rmdir syscall Signed-off-by: Markos Chandras Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/rmdir.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libc/sysdeps/linux/common/rmdir.c b/libc/sysdeps/linux/common/rmdir.c index bad66544b..d534b40b1 100644 --- a/libc/sysdeps/linux/common/rmdir.c +++ b/libc/sysdeps/linux/common/rmdir.c @@ -11,5 +11,13 @@ #include +#if defined __NR_unlinkat && !defined __NR_rmdir +# include +int rmdir(const char *pathname) +{ + return unlinkat(AT_FDCWD, pathname, AT_REMOVEDIR); +} +#else _syscall1(int, rmdir, const char *, pathname) +#endif libc_hidden_def(rmdir) -- cgit v1.2.3