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

iOS: open file on aarch64 breaks permissions #22862

Merged
merged 1 commit into from Mar 7, 2015
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
31 changes: 29 additions & 2 deletions src/liblibc/lib.rs
Expand Up @@ -5003,9 +5003,36 @@ pub mod funcs {
use types::os::arch::c95::{c_char, c_int};
use types::os::arch::posix88::mode_t;

mod open_shim {
extern {
#[cfg(any(target_os = "macos",
target_os = "ios"))]
pub fn open(path: *const ::c_char, oflag: ::c_int, ...)
-> ::c_int;

#[cfg(not(any(target_os = "macos",
target_os = "ios")))]
pub fn open(path: *const ::c_char, oflag: ::c_int, mode: ::mode_t)
-> ::c_int;
}
}

#[cfg(any(target_os = "macos",
target_os = "ios"))]
#[inline]
pub unsafe extern fn open(path: *const c_char, oflag: c_int, mode: mode_t) -> c_int {
use types::os::arch::c95::c_uint;
open_shim::open(path, oflag, mode as c_uint)
}

#[cfg(not(any(target_os = "macos",
target_os = "ios")))]
#[inline]
pub unsafe extern fn open(path: *const c_char, oflag: c_int, mode: mode_t) -> c_int {
open_shim::open(path, oflag, mode)
}

extern {
pub fn open(path: *const c_char, oflag: c_int, mode: mode_t)
-> c_int;
pub fn creat(path: *const c_char, mode: mode_t) -> c_int;
pub fn fcntl(fd: c_int, cmd: c_int, ...) -> c_int;
}
Expand Down