1typedef __SIZE_TYPE__ size_t;
2typedef unsigned int __u_int;
3typedef unsigned long __u_long;
4
5__extension__ typedef unsigned long long int __u_quad_t;
6__extension__ typedef long long int __quad_t;
7
8typedef struct
9  {
10    int __val[2];
11  } __fsid_t;
12
13typedef long int __blksize_t;
14typedef long int __blkcnt_t;
15typedef __quad_t __blkcnt64_t;
16typedef __u_long __fsblkcnt_t;
17typedef __u_quad_t __fsblkcnt64_t;
18typedef __u_long __fsfilcnt_t;
19typedef __u_quad_t __fsfilcnt64_t;
20typedef __u_quad_t __ino64_t;
21
22extern void *memcpy (void *__restrict __dest,
23                     __const void *__restrict __src, size_t __n) ;
24
25struct statfs
26  {
27    int f_type;
28    int f_bsize;
29
30    __fsblkcnt_t f_blocks;
31    __fsblkcnt_t f_bfree;
32    __fsblkcnt_t f_bavail;
33    __fsfilcnt_t f_files;
34    __fsfilcnt_t f_ffree;
35
36    __fsid_t f_fsid;
37    int f_namelen;
38    int f_spare[6];
39  };
40
41
42struct statfs64
43  {
44    int f_type;
45    int f_bsize;
46    __fsblkcnt64_t f_blocks;
47    __fsblkcnt64_t f_bfree;
48    __fsblkcnt64_t f_bavail;
49    __fsfilcnt64_t f_files;
50    __fsfilcnt64_t f_ffree;
51    __fsid_t f_fsid;
52    int f_namelen;
53    int f_spare[6];
54  };
55
56extern int __statfs (__const char *__file, struct statfs *__buf);
57extern int __statfs64 (__const char *__file, struct statfs64 *__buf);
58
59
60int
61__statfs64 (const char *file, struct statfs64 *buf)
62{
63  struct statfs buf32;
64
65  if (__statfs (file, &buf32) < 0)
66    return -1;
67
68  buf->f_type = buf32.f_type;
69  buf->f_bsize = buf32.f_bsize;
70  buf->f_blocks = buf32.f_blocks;
71  buf->f_bfree = buf32.f_bfree;
72  buf->f_bavail = buf32.f_bavail;
73  buf->f_files = buf32.f_files;
74  buf->f_ffree = buf32.f_ffree;
75  buf->f_fsid = buf32.f_fsid;
76  buf->f_namelen = buf32.f_namelen;
77  memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare));
78
79  return 0;
80}
81