-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Update Fuchsia support for std::process. #39277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…Misc. updates to reflect changes in Magenta
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors: r+ |
📌 Commit bbe419f has been approved by |
Looks good to me too, but I didn't do a careful review. |
Update Fuchsia support for std::process. - Adds support for try_wait. - Miscellaneous updates to keep up with Magenta changes. I'll begin `sys/fuchsia` soon, just been bogged down with my actual job lately (I'm not on the Fuchsia team).
☀️ Test successful - status-appveyor, status-travis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is already merged, but I thought I'd leave a couple style notes for future reference.
extern { | ||
pub fn mxio_get_startup_handle(id: u32) -> mx_handle_t; | ||
pub fn mx_job_default() -> mx_handle_t { | ||
unsafe { return __magenta_job_default; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Just use unsafe { __magenta_job_default }
. Idiomatic Rust only uses return
for early returns.
|
||
#[allow(unused)] pub const ERR_INTERNAL: mx_status_t = -1; | ||
|
||
// ERR_NOT_SUPPORTED: The operation is not implemented, supported, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and all the following comments that document these constants should use the triple slash ///
which rustdoc recognizes as a doc comment and uses in the generated HTML.
0, ptr::null_mut()); | ||
match status { | ||
0 => { }, // Success | ||
x if x == ERR_TIMED_OUT => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you can use constants directly as patterns, so this arm could be written as just ERR_TIMED_OUT => {
with no x if x ==
.
I'll begin
sys/fuchsia
soon, just been bogged down with my actual job lately (I'm not on the Fuchsia team).