umount.c 780 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. /* arch provides umount() syscall */
  11. #ifdef __NR_umount
  12. #include <sys/mount.h>
  13. _syscall1(int, umount, const char *, specialfile);
  14. /* arch provides umount2() syscall */
  15. #elif defined __NR_umount2
  16. #define __NR___syscall_umount2 __NR_umount2
  17. static inline _syscall2(int, __syscall_umount2, const char *, special_file, int, flags);
  18. int umount(const char *special_file)
  19. {
  20. return (__syscall_umount2(special_file, 0));
  21. }
  22. /* arch doesn't provide any umount syscall !? */
  23. #else
  24. int umount(const char *special_file)
  25. {
  26. __set_errno(ENOSYS);
  27. return -1;
  28. }
  29. #endif