Skip to content

Commit 9edc3a4

Browse files
committed
netbsd update.
ucontext_t/mcontext_t exposure on x86_64 architecture.
1 parent 23c29a0 commit 9edc3a4

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,7 @@ fn test_netbsd(target: &str) {
939939
"sys/time.h",
940940
"sys/times.h",
941941
"sys/timex.h",
942+
"sys/ucontext.h",
942943
"sys/uio.h",
943944
"sys/un.h",
944945
"sys/utsname.h",

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,26 @@ use PT_FIRSTMACH;
33
pub type c_long = i64;
44
pub type c_ulong = u64;
55
pub type c_char = i8;
6+
pub type c___greg_t = u64;
67
pub type __cpu_simple_lock_nv_t = ::c_uchar;
78

9+
s! {
10+
#[repr(align(16))]
11+
pub struct mcontext_t {
12+
pub __gregs: [c___greg_t; 26],
13+
pub _mc_tlsbase: c___greg_t,
14+
pub __fpregs: [[::c_char;32]; 16],
15+
}
16+
17+
pub struct ucontext_t {
18+
pub uc_flags: ::c_uint,
19+
pub uc_link: *mut ::ucontext_t,
20+
pub uc_sigmask: ::sigset_t,
21+
pub uc_stack: ::stack_t,
22+
pub uc_mcontext: ::mcontext_t,
23+
}
24+
}
25+
826
// should be pub(crate), but that requires Rust 1.18.0
927
cfg_if! {
1028
if #[cfg(libc_const_size_of)] {

0 commit comments

Comments
 (0)