Auto merge of #2525 - qwandor:mlock2, r=Amanieu
Add mlock2 on Android and Linux. Unfortunately the type of the flags parameter is different between Bionic and glibc for some reason.
This commit is contained in:
commit
fb3dec2881
|
@ -1702,6 +1702,9 @@ fn test_android(target: &str) {
|
||||||
"reallocarray" => true,
|
"reallocarray" => true,
|
||||||
"__system_property_wait" => true,
|
"__system_property_wait" => true,
|
||||||
|
|
||||||
|
// Added in API level 30, but tests use level 28.
|
||||||
|
"mlock2" => true,
|
||||||
|
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -2328,6 +2328,9 @@ pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
|
||||||
pub const ALG_OP_DECRYPT: ::c_int = 0;
|
pub const ALG_OP_DECRYPT: ::c_int = 0;
|
||||||
pub const ALG_OP_ENCRYPT: ::c_int = 1;
|
pub const ALG_OP_ENCRYPT: ::c_int = 1;
|
||||||
|
|
||||||
|
// sys/mman.h
|
||||||
|
pub const MLOCK_ONFAULT: ::c_int = 0x01;
|
||||||
|
|
||||||
// uapi/linux/vm_sockets.h
|
// uapi/linux/vm_sockets.h
|
||||||
pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF;
|
pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF;
|
||||||
pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0;
|
pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0;
|
||||||
|
@ -2582,6 +2585,7 @@ extern "C" {
|
||||||
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
|
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
|
||||||
|
|
||||||
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
|
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
|
||||||
|
pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
|
||||||
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
|
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
|
||||||
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
|
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
|
||||||
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
|
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
|
||||||
|
|
|
@ -2583,6 +2583,7 @@ pub const MAP_SHARED_VALIDATE: ::c_int = 0x3;
|
||||||
|
|
||||||
// include/uapi/asm-generic/mman-common.h
|
// include/uapi/asm-generic/mman-common.h
|
||||||
pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000;
|
pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000;
|
||||||
|
pub const MLOCK_ONFAULT: ::c_uint = 0x01;
|
||||||
|
|
||||||
// uapi/linux/vm_sockets.h
|
// uapi/linux/vm_sockets.h
|
||||||
pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF;
|
pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF;
|
||||||
|
@ -3533,6 +3534,7 @@ extern "C" {
|
||||||
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
|
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
|
||||||
|
|
||||||
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
|
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
|
||||||
|
pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int;
|
||||||
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
|
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
|
||||||
|
|
||||||
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
|
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
|
||||||
|
|
Loading…
Reference in a new issue