[git commit] rmdir: Use unlinkat if arch does not have the rmdir syscall
Bernhard Reutner-Fischer
rep.dot.nop at gmail.com
Wed Feb 20 12:45:11 UTC 2013
commit: http://git.uclibc.org/uClibc/commit/?id=98f53c576045dbc85525ca39a913f078f84ec35d
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master
Signed-off-by: Markos Chandras <markos.chandras at imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
libc/sysdeps/linux/common/rmdir.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/libc/sysdeps/linux/common/rmdir.c b/libc/sysdeps/linux/common/rmdir.c
index bad6654..d534b40 100644
--- a/libc/sysdeps/linux/common/rmdir.c
+++ b/libc/sysdeps/linux/common/rmdir.c
@@ -11,5 +11,13 @@
#include <unistd.h>
+#if defined __NR_unlinkat && !defined __NR_rmdir
+# include <fcntl.h>
+int rmdir(const char *pathname)
+{
+ return unlinkat(AT_FDCWD, pathname, AT_REMOVEDIR);
+}
+#else
_syscall1(int, rmdir, const char *, pathname)
+#endif
libc_hidden_def(rmdir)
More information about the uClibc-cvs
mailing list