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