OSDN Git Service

rmdir: Use unlinkat if arch does not have the rmdir syscall
authorMarkos Chandras <markos.chandras@imgtec.com>
Wed, 10 Oct 2012 14:05:37 +0000 (15:05 +0100)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 20 Feb 2013 12:45:11 +0000 (13:45 +0100)
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc/sysdeps/linux/common/rmdir.c

index bad6654..d534b40 100644 (file)
 #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)