Skip to content

Commit 3606566

Browse files
authored
Rollup merge of rust-lang#94179 - devnexen:getexecname_directcall, r=kennytm
solarish current_exe using libc call directly
2 parents bb0cca2 + e481765 commit 3606566

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

std/src/sys/unix/os.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,8 @@ pub fn current_exe() -> io::Result<PathBuf> {
384384
if let Ok(path) = crate::fs::read_link("/proc/self/path/a.out") {
385385
Ok(path)
386386
} else {
387-
extern "C" {
388-
fn getexecname() -> *const c_char;
389-
}
390387
unsafe {
391-
let path = getexecname();
388+
let path = libc::getexecname();
392389
if path.is_null() {
393390
Err(io::Error::last_os_error())
394391
} else {

0 commit comments

Comments
 (0)