fix the definition of struct statvfs to match lsb abi
at the same time, make struct statfs match the traditional definition and make it more useful, especially the fsid_t stuff.
This commit is contained in:
parent
8c07f6eac8
commit
114c80f141
7 changed files with 88 additions and 70 deletions
|
|
@ -3,8 +3,13 @@
|
|||
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
#define statfs statvfs
|
||||
#define fstatfs fstatvfs
|
||||
#define f_namelen f_namemax
|
||||
typedef struct {
|
||||
int val[2];
|
||||
} fsid_t;
|
||||
|
||||
#include <bits/statfs.h>
|
||||
|
||||
int statfs (const char *, struct statfs *);
|
||||
int fstatfs (int, struct statfs *);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6,15 +6,28 @@
|
|||
#define __NEED_fsfilcnt_t
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
#include <bits/statfs.h>
|
||||
#include <endian.h>
|
||||
|
||||
struct statvfs {
|
||||
unsigned long f_bsize, f_frsize;
|
||||
fsblkcnt_t f_blocks, f_bfree, f_bavail;
|
||||
fsfilcnt_t f_files, f_ffree, f_favail;
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
unsigned long f_fsid;
|
||||
unsigned :8*(2*sizeof(int)-sizeof(long));
|
||||
#else
|
||||
unsigned :8*(2*sizeof(int)-sizeof(long));
|
||||
unsigned long f_fsid;
|
||||
#endif
|
||||
unsigned long f_flag, f_namemax;
|
||||
int __reserved[6];
|
||||
};
|
||||
|
||||
int statvfs (const char *, struct statvfs *);
|
||||
int fstatvfs (int, struct statvfs *);
|
||||
|
||||
#define ST_RDONLY 1
|
||||
#define ST_NOSUID 2
|
||||
|
||||
#if 0
|
||||
#define ST_NODEV 4
|
||||
#define ST_NOEXEC 8
|
||||
#define ST_SYNCHRONOUS 16
|
||||
|
|
@ -24,7 +37,6 @@ int fstatvfs (int, struct statvfs *);
|
|||
#define ST_IMMUTABLE 512
|
||||
#define ST_NOATIME 1024
|
||||
#define ST_NODIRATIME 2048
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue