Skip to content

Commit c02c8f8

Browse files
committed
Auto merge of #2219 - devnexen:mremap_netbsd, r=JohnTitor
netbsd add mremap and its particular flag. little note on kevent.
2 parents f9ee729 + 108192d commit c02c8f8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

libc-test/semver/netbsd.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ MADV_WILLNEED
546546
MAP_FILE
547547
MAP_HASSEMAPHORE
548548
MAP_NORESERVE
549+
MAP_REMAPDUP
549550
MAP_RENAME
550551
MAP_WIRED
551552
MAXFREQ

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ s! {
213213
pub flags: u32,
214214
pub fflags: u32,
215215
pub data: i64,
216-
pub udata: ::intptr_t,
216+
pub udata: ::intptr_t, /* FIXME: NetBSD 10.0 will finally have same layout as other BSD */
217217
}
218218

219219
pub struct dqblk {
@@ -1204,6 +1204,8 @@ pub const MAP_RENAME: ::c_int = 0x20;
12041204
pub const MAP_NORESERVE: ::c_int = 0x40;
12051205
pub const MAP_HASSEMAPHORE: ::c_int = 0x200;
12061206
pub const MAP_WIRED: ::c_int = 0x800;
1207+
// mremap flag
1208+
pub const MAP_REMAPDUP: ::c_int = 0x004;
12071209

12081210
pub const DCCP_TYPE_REQUEST: ::c_int = 0;
12091211
pub const DCCP_TYPE_RESPONSE: ::c_int = 1;
@@ -2116,6 +2118,13 @@ extern "C" {
21162118
pub fn consttime_memequal(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
21172119

21182120
pub fn setproctitle(fmt: *const ::c_char, ...);
2121+
pub fn mremap(
2122+
oldp: *mut ::c_void,
2123+
oldsize: ::size_t,
2124+
newp: *mut ::c_void,
2125+
newsize: ::size_t,
2126+
flags: ::c_int,
2127+
) -> *mut ::c_void;
21192128
}
21202129

21212130
#[link(name = "util")]

0 commit comments

Comments
 (0)