about summary refs log tree commit diff
path: root/library/std/src/sys/process/unix/fuchsia.rs
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-05-07 00:29:24 +0000
committerGitHub <noreply@github.com>2025-05-07 00:29:24 +0000
commitfe97fe45f89b1789f31273dbfd400bd42961e59e (patch)
tree9df88632ff677dbae52b427d42db0a4d05bea720 /library/std/src/sys/process/unix/fuchsia.rs
parentbda326f40c97ad68d16a23644ceb4ba2242bbd0f (diff)
parent7845c011dd3bdfb5eaa461476f5f7d0f3aa16dfc (diff)
downloadrust-fe97fe45f89b1789f31273dbfd400bd42961e59e.tar.gz
rust-fe97fe45f89b1789f31273dbfd400bd42961e59e.zip
Rollup merge of #140656 - joboet:fuchsia_pal, r=workingjubilee
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 `zx_thread_self` and `zx_clock_get_monotonic` as safe extern functions
* 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)

`@rustbot` ping fuchsia
Diffstat (limited to 'library/std/src/sys/process/unix/fuchsia.rs')
-rw-r--r--library/std/src/sys/process/unix/fuchsia.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/process/unix/fuchsia.rs b/library/std/src/sys/process/unix/fuchsia.rs
index fbe06c4799b..017ab91797c 100644
--- a/library/std/src/sys/process/unix/fuchsia.rs
+++ b/library/std/src/sys/process/unix/fuchsia.rs
@@ -76,7 +76,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());
@@ -192,7 +192,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);
                 }
                 _ => {