瀏覽代碼

rmdir: Use unlinkat if arch does not have the rmdir syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Markos Chandras 12 年之前
父節點
當前提交
98f53c5760
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      libc/sysdeps/linux/common/rmdir.c

+ 8 - 0
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)