Skip to content

Commit

Permalink
Auto merge of #2907 - semarie:openbsd-getmntinfo, r=JohnTitor
Browse files Browse the repository at this point in the history
openbsd: add getmntinfo(3) and getfsstat(2) support

it passes testsuite on OpenBSD
  • Loading branch information
bors committed Sep 13, 2022
2 parents a74954e + 236fe11 commit 666ad57
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libc-test/semver/openbsd.txt
Expand Up @@ -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
Expand Down Expand Up @@ -999,6 +1002,7 @@ futimes
getdomainname
getdtablesize
getentropy
getfsstat
getgrent
getgrgid
getgrgid_r
Expand All @@ -1010,6 +1014,7 @@ getifaddrs
getitimer
getline
getloadavg
getmntinfo
getnameinfo
getpeereid
getpriority
Expand Down
6 changes: 6 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit 666ad57

Please sign in to comment.