mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-22 04:34:51 +00:00
solarish current_exe using libc call directly
This commit is contained in:
parent
a6fe969541
commit
f810314bc6
@ -384,11 +384,8 @@ pub fn current_exe() -> io::Result<PathBuf> {
|
||||
if let Ok(path) = crate::fs::read_link("/proc/self/path/a.out") {
|
||||
Ok(path)
|
||||
} else {
|
||||
extern "C" {
|
||||
fn getexecname() -> *const c_char;
|
||||
}
|
||||
unsafe {
|
||||
let path = getexecname();
|
||||
let path = libc::getexecname();
|
||||
if path.is_null() {
|
||||
Err(io::Error::last_os_error())
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user