std: Don't assume dlopen() works on yourself
Statically linked executables do not succeed (aka MUSL-based executables).
This commit is contained in:
parent
5f518ad658
commit
7dd62155d8
@ -342,7 +342,10 @@ fn min_stack_size(attr: *const libc::pthread_attr_t) -> usize {
|
||||
static mut __pthread_get_minstack: Option<F> = None;
|
||||
|
||||
INIT.call_once(|| {
|
||||
let lib = DynamicLibrary::open(None).unwrap();
|
||||
let lib = match DynamicLibrary::open(None) {
|
||||
Ok(l) => l,
|
||||
Err(..) => return,
|
||||
};
|
||||
unsafe {
|
||||
if let Ok(f) = lib.symbol("__pthread_get_minstack") {
|
||||
__pthread_get_minstack = Some(mem::transmute::<*const (), F>(f));
|
||||
|
Loading…
x
Reference in New Issue
Block a user