Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 4eecbc4

Browse files
authored
Merge pull request #1826 from nrTQgc/netbsd_port
NetBSD: port struct statvfs from netbsd source merged-on-behalf-of: David Nadlinger <code@klickverbot.at>
2 parents 2144f2f + 3cf23d2 commit 4eecbc4

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

src/core/sys/posix/sys/statvfs.d

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,53 @@ version(CRuntime_Glibc) {
8484
}
8585

8686
}
87+
else version(NetBSD)
88+
{
89+
enum _VFS_MNAMELEN = 1024;
90+
enum _VFS_NAMELEN = 32;
91+
92+
struct fsid_t
93+
{
94+
int[2] __fsid_val;
95+
}
96+
97+
struct statvfs_t
98+
{
99+
c_ulong f_flag;
100+
c_ulong f_bsize;
101+
c_ulong f_frsize;
102+
c_ulong f_iosize;
103+
fsblkcnt_t f_blocks;
104+
fsblkcnt_t f_bfree;
105+
fsblkcnt_t f_bavail;
106+
fsblkcnt_t f_bresvd;
107+
fsfilcnt_t f_files;
108+
fsfilcnt_t f_ffree;
109+
fsfilcnt_t f_favail;
110+
fsfilcnt_t f_fresvd;
111+
ulong f_syncreads;
112+
ulong f_syncwrites;
113+
ulong f_asyncreads;
114+
ulong f_asyncwrites;
115+
fsid_t f_fsidx;
116+
c_ulong f_fsid;
117+
c_ulong f_namemax;
118+
int f_owner;
119+
int[4] f_spare;
120+
char[_VFS_NAMELEN] f_fstypename;
121+
char[_VFS_MNAMELEN] f_mntonname;
122+
char[_VFS_MNAMELEN] f_mntfromname;
123+
}
124+
125+
enum FFlag
126+
{
127+
ST_RDONLY = 1, /* Mount read-only. */
128+
ST_NOSUID = 2
129+
}
130+
131+
int statvfs (const char * file, statvfs_t* buf);
132+
int fstatvfs (int fildes, statvfs_t *buf) @trusted;
133+
}
87134
else
88135
{
89136
struct statvfs_t

0 commit comments

Comments
 (0)