| 1 |
//! Header: `dlfcn.h` |
| 2 |
//! |
| 3 |
//! Dynamic linking functions and constants from Hexagon toolchain. |
| 4 |
|
| 5 |
use crate::prelude::*; |
| 6 |
|
| 7 |
// Values for dlopen `mode` |
| 8 |
pub const RTLD_LAZY: c_int = 1; |
| 9 |
pub const RTLD_NOW: c_int = 2; |
| 10 |
pub const RTLD_GLOBAL: c_int = 0x100; |
| 11 |
pub const RTLD_LOCAL: c_int = 0x200; |
| 12 |
|
| 13 |
// Compatibility constant |
| 14 |
pub const DL_LAZY: c_int = RTLD_LAZY; |
| 15 |
|
| 16 |
// Special handles |
| 17 |
pub const RTLD_NEXT: *mut c_void = -1isize as *mut c_void; |
| 18 |
pub const RTLD_DEFAULT: *mut c_void = -2isize as *mut c_void; |
| 19 |
pub const RTLD_SELF: *mut c_void = -3isize as *mut c_void; |
| 20 |
|
| 21 |
extern "C" { |
| 22 |
pub fn dlopen(filename: *const c_char, flag: c_int) -> *mut c_void; |
| 23 |
pub fn dlclose(handle: *mut c_void) -> c_int; |
| 24 |
pub fn dlsym(handle: *mut c_void, symbol: *const c_char) -> *mut c_void; |
| 25 |
pub fn dlerror() -> *mut c_char; |
| 26 |
} |