Skip to content

Commit 236fe11

Browse files
committed
openbsd: add getmntinfo(3) and getfsstat(2) support
1 parent a74954e commit 236fe11

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

libc-test/semver/openbsd.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ MSG_CMSG_CLOEXEC
497497
MSG_DONTWAIT
498498
MSG_MCAST
499499
MSG_NOSIGNAL
500+
MNT_LAZY
501+
MNT_NOWAIT
502+
MNT_WAIT
500503
NET_RT_DUMP
501504
NET_RT_FLAGS
502505
NET_RT_IFLIST
@@ -999,6 +1002,7 @@ futimes
9991002
getdomainname
10001003
getdtablesize
10011004
getentropy
1005+
getfsstat
10021006
getgrent
10031007
getgrgid
10041008
getgrgid_r
@@ -1010,6 +1014,7 @@ getifaddrs
10101014
getitimer
10111015
getline
10121016
getloadavg
1017+
getmntinfo
10131018
getnameinfo
10141019
getpeereid
10151020
getpriority

src/unix/bsd/netbsdlike/openbsd/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,10 @@ pub const SF_ARCHIVED: ::c_uint = 0x00010000;
16391639
pub const SF_IMMUTABLE: ::c_uint = 0x00020000;
16401640
pub const SF_APPEND: ::c_uint = 0x00040000;
16411641

1642+
pub const MNT_WAIT: ::c_int = 1;
1643+
pub const MNT_NOWAIT: ::c_int = 2;
1644+
pub const MNT_LAZY: ::c_int = 3;
1645+
16421646
const_fn! {
16431647
{const} fn _ALIGN(p: usize) -> usize {
16441648
(p + _ALIGNBYTES) & !_ALIGNBYTES
@@ -1880,6 +1884,8 @@ cfg_if! {
18801884
// these functions use statfs which uses the union mount_info:
18811885
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
18821886
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
1887+
pub fn getmntinfo(mntbufp: *mut *mut ::statfs, flags: ::c_int) -> ::c_int;
1888+
pub fn getfsstat(buf: *mut statfs, bufsize: ::size_t, flags: ::c_int) -> ::c_int;
18831889
}
18841890
}
18851891
}

0 commit comments

Comments
 (0)