1 /* vi: set sw=4 ts=4: */
5 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
7 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
10 #include <sys/syscall.h>
12 #include <sys/param.h>
15 extern __typeof(statfs) __libc_statfs attribute_hidden;
17 #if defined __NR_statfs64 && !defined __NR_statfs
19 int __libc_statfs(const char *path, struct statfs *buf)
21 int err = INLINE_SYSCALL(statfs64, 3, path, sizeof(*buf), buf);
24 /* Did we overflow? */
25 if (buf->__pad1 || buf->__pad2 || buf->__pad3 ||
26 buf->__pad4 || buf->__pad5) {
27 __set_errno(EOVERFLOW);
34 # if defined __UCLIBC_LINUX_SPECIFIC__ || defined __UCLIBC_HAS_THREADS_NATIVE__
35 /* statfs is used by NPTL, so it must exported in case */
36 weak_alias(__libc_statfs, statfs)
39 /* For systems which have both, prefer the old one */
42 # define __NR___libc_statfs __NR_statfs
43 _syscall2(int, __libc_statfs, const char *, path, struct statfs *, buf)
45 # if defined __UCLIBC_LINUX_SPECIFIC__ || defined __UCLIBC_HAS_THREADS_NATIVE__
46 /* statfs is used by NPTL, so it must exported in case */
47 weak_alias(__libc_statfs, statfs)
51 libc_hidden_def(statfs)