statfs.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * statfs() 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 <string.h>
  10. #include <sys/param.h>
  11. #include <sys/vfs.h>
  12. extern __typeof(statfs) __libc_statfs attribute_hidden;
  13. #if defined __NR_statfs64 && !defined __NR_statfs
  14. int __libc_statfs(const char *path, struct statfs *buf)
  15. {
  16. int err = INLINE_SYSCALL(statfs64, 3, path, sizeof(*buf), buf);
  17. return err;
  18. }
  19. # if defined __UCLIBC_LINUX_SPECIFIC__ || defined __UCLIBC_HAS_THREADS_NATIVE__
  20. /* statfs is used by NPTL, so it must exported in case */
  21. weak_alias(__libc_statfs, statfs)
  22. libc_hidden_def(statfs)
  23. # endif
  24. /* For systems which have both, prefer the old one */
  25. #else
  26. # define __NR___libc_statfs __NR_statfs
  27. _syscall2(int, __libc_statfs, const char *, path, struct statfs *, buf)
  28. # if defined __UCLIBC_LINUX_SPECIFIC__ || defined __UCLIBC_HAS_THREADS_NATIVE__
  29. /* statfs is used by NPTL, so it must exported in case */
  30. weak_alias(__libc_statfs, statfs)
  31. libc_hidden_def(statfs)
  32. # endif
  33. #endif