From 7845c011dd3bdfb5eaa461476f5f7d0f3aa16dfc Mon Sep 17 00:00:00 2001 From: joboet Date: Mon, 5 May 2025 12:16:40 +0200 Subject: collect all Fuchsia bindings into the `fuchsia` module The Fuchsia bindings are currently spread out across multiple modules in `sys/pal/unix` leading to unnecessary duplication. This PR moves all of these definitions into `sys::pal::unix::fuchsia` and additionally: * deduplicates the definitions * makes the error names consistent * marks some extern functions as safe * removes unused items (there's no need to maintain these bindings if we're not going to use them) * removes the documentation for the definitions (contributors should always consult the platform documentation, duplicating that here is just an extra maintenance burden) --- library/std/src/sys/process/unix/fuchsia.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'library/std/src/sys/process') diff --git a/library/std/src/sys/process/unix/fuchsia.rs b/library/std/src/sys/process/unix/fuchsia.rs index 0de32ecffd4..eb62bbd808e 100644 --- a/library/std/src/sys/process/unix/fuchsia.rs +++ b/library/std/src/sys/process/unix/fuchsia.rs @@ -81,7 +81,7 @@ impl Command { let mut handle = ZX_HANDLE_INVALID; let status = fdio_fd_clone(target_fd, &mut handle); - if status == ERR_INVALID_ARGS || status == ERR_NOT_SUPPORTED { + if status == ZX_ERR_INVALID_ARGS || status == ZX_ERR_NOT_SUPPORTED { // This descriptor is closed; skip it rather than generating an // error. return Ok(Default::default()); @@ -197,7 +197,7 @@ impl Process { zx_object_wait_one(self.handle.raw(), ZX_TASK_TERMINATED, 0, ptr::null_mut()); match status { 0 => {} // Success - x if x == ERR_TIMED_OUT => { + x if x == ZX_ERR_TIMED_OUT => { return Ok(None); } _ => { -- cgit 1.4.1-3-g733a5