rmdir.c 460 B

12345678910111213141516171819202122
  1. /*
  2. * rmdir() for uClibc
  3. *
  4. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  5. *
  6. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. */
  8. #include <sys/syscall.h>
  9. #include <unistd.h>
  10. #if defined __NR_unlinkat && !defined __NR_rmdir
  11. # include <fcntl.h>
  12. int rmdir(const char *pathname)
  13. {
  14. return unlinkat(AT_FDCWD, pathname, AT_REMOVEDIR);
  15. }
  16. #else
  17. _syscall1(int, rmdir, const char *, pathname)
  18. #endif
  19. libc_hidden_def(rmdir)