umount.c 779 B

12345678910111213141516171819202122232425262728293031323334
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * umount() for uClibc
  4. *
  5. * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
  6. *
  7. * GNU Library General Public License (LGPL) version 2 or later.
  8. */
  9. #include "syscalls.h"
  10. #ifdef __NR_umount /* Some newer archs only have umount2 */
  11. #include <sys/mount.h>
  12. _syscall1(int, umount, const char *, specialfile);
  13. #elif defined __NR_umount2
  14. /* No umount syscall, but umount2 is available.... Try to
  15. * emulate umount() using umount2() */
  16. #define __NR___syscall_umount2 __NR_umount2
  17. static inline _syscall2(int, umount2, const char *, special_file, int, flags);
  18. int umount(const char *special_file)
  19. {
  20. return (__syscall_umount2(special_file, 0));
  21. }
  22. #else
  23. int umount(const char *special_file)
  24. {
  25. __set_errno(ENOSYS);
  26. return -1;
  27. }
  28. #endif