Skip to content

Commit 1bb5275

Browse files
committed
Auto merge of #2593 - skrap:uclibc-does-not-have-mlock2, r=Amanieu
uclibc does not have mlock2 This fixes the build for the uclibc targets, for example `armv7-unknown-linux-uclibceabihf`.
2 parents 55c44a2 + 6fd16d6 commit 1bb5275

File tree

3 files changed

+2
-1
lines changed

3 files changed

+2
-1
lines changed

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,6 +1336,7 @@ extern "C" {
13361336
pub fn sethostid(hostid: ::c_long) -> ::c_int;
13371337

13381338
pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
1339+
pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int;
13391340
}
13401341

13411342
extern "C" {

src/unix/linux_like/linux/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3534,7 +3534,6 @@ extern "C" {
35343534
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
35353535

35363536
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
3537-
pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int;
35383537
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
35393538

35403539
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;

src/unix/linux_like/linux/musl/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ extern "C" {
772772
pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
773773

774774
pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
775+
pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int;
775776
}
776777

777778
cfg_if! {

0 commit comments

Comments
 (0)