Skip to content

Commit 6091330

Browse files
committed
Follow rename of mx_handle_wait Magenta syscalls
The mx_handle_wait_* syscalls in Magenta were renamed to mx_object_wait. The syscall is used in the Magenta/Fuchsia implementation of std::process, to wait on child processes. In addition, this patch enables the use of the system provided libbacktrace library on Fuchsia targets. Symbolization is not yet working, but at least it allows printing hex addresses in a backtrace and makes building succeed when the backtrace feature is not disabled.
1 parent 668864d commit 6091330

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/libstd/build.rs

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ fn main() {
5959
println!("cargo:rustc-link-lib=userenv");
6060
println!("cargo:rustc-link-lib=shell32");
6161
} else if target.contains("fuchsia") {
62+
// use system-provided libbacktrace
63+
if cfg!(feature = "backtrace") {
64+
println!("cargo:rustc-link-lib=backtrace");
65+
}
6266
println!("cargo:rustc-link-lib=magenta");
6367
println!("cargo:rustc-link-lib=mxio");
6468
println!("cargo:rustc-link-lib=launchpad"); // for std::process

src/libstd/sys/unix/process/magenta.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ extern {
111111
pub fn mx_handle_duplicate(handle: mx_handle_t, rights: mx_rights_t,
112112
out: *const mx_handle_t) -> mx_handle_t;
113113

114-
pub fn mx_handle_wait_one(handle: mx_handle_t, signals: mx_signals_t, timeout: mx_time_t,
114+
pub fn mx_object_wait_one(handle: mx_handle_t, signals: mx_signals_t, timeout: mx_time_t,
115115
pending: *mut mx_signals_t) -> mx_status_t;
116116

117117
pub fn mx_object_get_info(handle: mx_handle_t, topic: u32, buffer: *mut c_void,

src/libstd/sys/unix/process/process_fuchsia.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl Process {
151151
let mut avail: mx_size_t = 0;
152152

153153
unsafe {
154-
mx_cvt(mx_handle_wait_one(self.handle.raw(), MX_TASK_TERMINATED,
154+
mx_cvt(mx_object_wait_one(self.handle.raw(), MX_TASK_TERMINATED,
155155
MX_TIME_INFINITE, ptr::null_mut()))?;
156156
mx_cvt(mx_object_get_info(self.handle.raw(), MX_INFO_PROCESS,
157157
&mut proc_info as *mut _ as *mut libc::c_void,
@@ -174,7 +174,7 @@ impl Process {
174174
let mut avail: mx_size_t = 0;
175175

176176
unsafe {
177-
let status = mx_handle_wait_one(self.handle.raw(), MX_TASK_TERMINATED,
177+
let status = mx_object_wait_one(self.handle.raw(), MX_TASK_TERMINATED,
178178
0, ptr::null_mut());
179179
match status {
180180
0 => { }, // Success

0 commit comments

Comments
 (0)