Skip to content

Commit e3e92d7

Browse files
committed
Exclude UContext::get(),set() on musl, not available from libc.
1 parent a5936e4 commit e3e92d7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ucontext.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use libc;
2+
#[cfg(not(target_env = "musl"))]
23
use {Errno, Result};
4+
#[cfg(not(target_env = "musl"))]
35
use std::mem;
46

57
#[derive(Clone, Copy)]
@@ -8,6 +10,7 @@ pub struct UContext {
810
}
911

1012
impl UContext {
13+
#[cfg(not(target_env = "musl"))]
1114
pub fn get() -> Result<UContext> {
1215
let mut context: libc::ucontext_t = unsafe { mem::uninitialized() };
1316
let res = unsafe {
@@ -16,6 +19,7 @@ impl UContext {
1619
Errno::result(res).map(|_| UContext { context: context })
1720
}
1821

22+
#[cfg(not(target_env = "musl"))]
1923
pub fn set(&self) -> Result<()> {
2024
let res = unsafe {
2125
libc::setcontext(&self.context as *const libc::ucontext_t)

0 commit comments

Comments
 (0)