#ifndef _COMPAT_SYS_STATVFS_H_
#define _COMPAT_SYS_STATVFS_H_
#include <sys/statvfs.h>
struct statvfs90 {
unsigned long f_flag;
unsigned long f_bsize;
unsigned long f_frsize;
unsigned long f_iosize;
fsblkcnt_t f_blocks;
fsblkcnt_t f_bfree;
fsblkcnt_t f_bavail;
fsblkcnt_t f_bresvd;
fsfilcnt_t f_files;
fsfilcnt_t f_ffree;
fsfilcnt_t f_favail;
fsfilcnt_t f_fresvd;
uint64_t f_syncreads;
uint64_t f_syncwrites;
uint64_t f_asyncreads;
uint64_t f_asyncwrites;
fsid_t f_fsidx;
unsigned long f_fsid;
unsigned long f_namemax;
uid_t f_owner;
uint32_t f_spare[4];
char f_fstypename[_VFS_NAMELEN];
char f_mntonname[_VFS_MNAMELEN];
char f_mntfromname[_VFS_MNAMELEN];
};
__BEGIN_DECLS
#ifndef _KERNEL
#include <string.h>
#endif
static __inline void
statvfs_to_statvfs90(const struct statvfs *s, struct statvfs90 *s90)
{
memset(s90, 0, sizeof(*s90));
s90->f_flag = s->f_flag;
s90->f_bsize = s->f_bsize;
s90->f_frsize = s->f_frsize;
s90->f_iosize = s->f_iosize;
s90->f_blocks = s->f_blocks;
s90->f_bfree = s->f_bfree;
s90->f_bavail = s->f_bavail;
s90->f_bresvd = s->f_bresvd;
s90->f_files = s->f_files;
s90->f_ffree = s->f_ffree;
s90->f_favail = s->f_favail;
s90->f_fresvd = s->f_fresvd;
s90->f_syncreads = s->f_syncreads;
s90->f_syncwrites = s->f_syncwrites;
s90->f_asyncreads = s->f_asyncreads;
s90->f_asyncwrites = s->f_asyncwrites;
s90->f_fsidx = s->f_fsidx;
s90->f_fsid = s->f_fsid;
s90->f_namemax = s->f_namemax;
s90->f_owner = s->f_owner;
memcpy(s90->f_fstypename, s->f_fstypename, sizeof(s90->f_fstypename));
memcpy(s90->f_mntonname, s->f_mntonname, sizeof(s90->f_mntonname));
memcpy(s90->f_mntfromname, s->f_mntfromname, sizeof(s90->f_mntfromname));
}
#ifdef _KERNEL
static __inline int
statvfs_to_statvfs90_copy(const void *vs, void *vs90, size_t l)
{
struct statvfs90 *s90 = kmem_zalloc(sizeof(*s90), KM_SLEEP);
int error;
statvfs_to_statvfs90(vs, s90);
error = copyout(s90, vs90, sizeof(*s90));
kmem_free(s90, sizeof(*s90));
return error;
}
#else
#ifdef __LIBC12_SOURCE__
int __compat_statvfs(const char *__restrict, struct statvfs90 *__restrict);
int __compat_statvfs1(const char *__restrict, struct statvfs90 *__restrict,
int);
int __compat_fstatvfs(int, struct statvfs90 *);
int __compat_fstatvfs1(int, struct statvfs90 *, int);
int __compat___getmntinfo13(struct statvfs90 **, int);
int __compat___fhstatvfs40(const void *, size_t, struct statvfs90 *);
int __compat___fhstatvfs140(const void *, size_t, struct statvfs90 *, int);
int __compat_getvfsstat(struct statvfs90 *, size_t, int);
int __statvfs90(const char *__restrict, struct statvfs *__restrict);
int __statvfs190(const char *__restrict, struct statvfs *__restrict, int);
int __fstatvfs90(int, struct statvfs *);
int __fstatvfs190(int, struct statvfs *, int);
int __fhstatvfs90(const void *, size_t, struct statvfs *);
int __fhstatvfs190(const void *, size_t, struct statvfs *, int);
int __getvfsstat90(struct statvfs *, size_t, int);
int __getmntinfo90(struct statvfs **, int);
struct compat_30_fhandle;
int fhstatvfs(const struct compat_30_fhandle *, struct statvfs90 *);
int fhstatvfs1(const struct compat_30_fhandle *, struct statvfs90 *, int);
#endif
#endif
__END_DECLS
#endif