Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getmntinfo and getmntinfo functions, MNT_WAIT and MNT_NOWAIT constants #2058

Merged
merged 1 commit into from Feb 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/unix/bsd/apple/mod.rs
Expand Up @@ -3207,6 +3207,10 @@ pub const TIME_OOP: ::c_int = 3;
pub const TIME_WAIT: ::c_int = 4;
pub const TIME_ERROR: ::c_int = 5;

// <sys/mount.h>
pub const MNT_WAIT: ::c_int = 1;
pub const MNT_NOWAIT: ::c_int = 2;

cfg_if! {
if #[cfg(libc_const_size_of)] {
fn __DARWIN_ALIGN32(p: usize) -> usize {
Expand Down Expand Up @@ -3744,6 +3748,21 @@ extern "C" {

pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;

#[cfg_attr(
all(target_os = "macos", not(target_arch = "aarch64")),
link_name = "getmntinfo$INODE64"
)]
pub fn getmntinfo(mntbufp: *mut *mut statfs, flags: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", not(target_arch = "aarch64")),
link_name = "getfsstat$INODE64"
)]
pub fn getfsstat(
mntbufp: *mut statfs,
bufsize: ::c_int,
flags: ::c_int,
) -> ::c_int;
}

cfg_if! {
Expand Down