Skip to content

Commit e145b68

Browse files
authored
Merge pull request #252 from Wind-River/master
vxWorks: use rtpInfoGet() to get rtp executable path
2 parents f758565 + 9f18e16 commit e145b68

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/symbolize/libbacktrace.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,22 @@ unsafe fn init_state() -> *mut bt::backtrace_state {
400400
Ok(&buf[..(len + 1) as usize])
401401
}
402402
}
403-
404-
403+
} else if #[cfg(target_os = "vxworks")] {
404+
unsafe fn load_filename() -> *const libc::c_char {
405+
use libc;
406+
use core::mem;
407+
408+
const N: usize = libc::VX_RTP_NAME_LENGTH + 1;
409+
static mut BUF: [libc::c_char; N] = [0; N];
410+
411+
let mut rtp_desc : libc::RTP_DESC = mem::zeroed();
412+
if (libc::rtpInfoGet(0, &mut rtp_desc as *mut libc::RTP_DESC) == 0) {
413+
BUF.copy_from_slice(&rtp_desc.pathName);
414+
BUF.as_ptr()
415+
} else {
416+
ptr::null()
417+
}
418+
}
405419
} else {
406420
unsafe fn load_filename() -> *const libc::c_char {
407421
ptr::null()

0 commit comments

Comments
 (0)