summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-13 23:17:25 +0000
committerbors <bors@rust-lang.org>2022-09-13 23:17:25 +0000
commit666ad5799325f291f91352965edddb067eba1742 (patch)
tree5c9aa5662cb869d860c79988d6e227addf238a4b
parenta74954ee71bb15ffd2d4f3b69f69addb96f7a32f (diff)
parent236fe11e9cb17cffa557c976cae7a983f8933c06 (diff)
downloadrust-libc-666ad5799325f291f91352965edddb067eba1742.tar.gz
Auto merge of #2907 - semarie:openbsd-getmntinfo, r=JohnTitor
openbsd: add getmntinfo(3) and getfsstat(2) support it passes testsuite on OpenBSD
-rw-r--r--libc-test/semver/openbsd.txt5
-rw-r--r--src/unix/bsd/netbsdlike/openbsd/mod.rs6
2 files changed, 11 insertions, 0 deletions
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
index c9585a87ec..cf9d73c586 100644
--- a/libc-test/semver/openbsd.txt
+++ b/libc-test/semver/openbsd.txt
@@ -497,6 +497,9 @@ MSG_CMSG_CLOEXEC
MSG_DONTWAIT
MSG_MCAST
MSG_NOSIGNAL
+MNT_LAZY
+MNT_NOWAIT
+MNT_WAIT
NET_RT_DUMP
NET_RT_FLAGS
NET_RT_IFLIST
@@ -999,6 +1002,7 @@ futimes
getdomainname
getdtablesize
getentropy
+getfsstat
getgrent
getgrgid
getgrgid_r
@@ -1010,6 +1014,7 @@ getifaddrs
getitimer
getline
getloadavg
+getmntinfo
getnameinfo
getpeereid
getpriority
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index ba26f92431..506306e9f7 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -1639,6 +1639,10 @@ pub const SF_ARCHIVED: ::c_uint = 0x00010000;
pub const SF_IMMUTABLE: ::c_uint = 0x00020000;
pub const SF_APPEND: ::c_uint = 0x00040000;
+pub const MNT_WAIT: ::c_int = 1;
+pub const MNT_NOWAIT: ::c_int = 2;
+pub const MNT_LAZY: ::c_int = 3;
+
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
@@ -1880,6 +1884,8 @@ cfg_if! {
// these functions use statfs which uses the union mount_info:
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
+ pub fn getmntinfo(mntbufp: *mut *mut ::statfs, flags: ::c_int) -> ::c_int;
+ pub fn getfsstat(buf: *mut statfs, bufsize: ::size_t, flags: ::c_int) -> ::c_int;
}
}
}