umount.c 816 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * umount() for uClibc
  4. *
  5. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  6. *
  7. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  8. */
  9. #include <sys/syscall.h>
  10. #if defined __USE_GNU
  11. #include <sys/mount.h>
  12. /* arch provides umount() syscall */
  13. #ifdef __NR_umount
  14. _syscall1(int, umount, const char *, specialfile);
  15. /* arch provides umount2() syscall */
  16. #elif defined __NR_umount2
  17. # define __NR___syscall_umount2 __NR_umount2
  18. static inline _syscall2(int, __syscall_umount2, const char *, special_file, int, flags);
  19. int umount(const char *special_file)
  20. {
  21. return (__syscall_umount2(special_file, 0));
  22. }
  23. /* arch doesn't provide any umount syscall !? */
  24. #else
  25. int umount(const char *special_file)
  26. {
  27. __set_errno(ENOSYS);
  28. return -1;
  29. }
  30. #endif
  31. #endif