Skip to main content

Crate running_process_platform_internal

Crate running_process_platform_internal 

Source
Expand description

Blessed asynchronous process operations.

This crate is intentionally published as an implementation detail. It is the only production owner of the Tokio process primitives used by the async process API. Higher layers receive typed operations and never name tokio::process::Command directly.

Re-exports§

pub use platform_imp::apply_process_priority;
pub use platform_imp::assign_child_to_windows_job;
pub use platform_imp::cancel_capture_reader;
pub use platform_imp::canonical_environment_pairs;
pub use platform_imp::capture_reader_done;
pub use platform_imp::compat_shell_command;
pub use platform_imp::configure_exact_trace;
pub use platform_imp::configure_process_command;
pub use platform_imp::configure_sync_contained_command;
pub use platform_imp::configure_sync_daemon_command;
pub use platform_imp::configure_sync_daemon_command_with_inheritance;
pub use platform_imp::configure_trampoline_command;
pub use platform_imp::current_executable_build_id;
pub use platform_imp::exact_trace_capability;
pub use platform_imp::exit_code;
pub use platform_imp::exit_signal;
pub use platform_imp::monitor_console_windows;
pub use platform_imp::parent_has_console;
pub use platform_imp::prepare_capture_reader;
pub use platform_imp::send_interrupt;
pub use platform_imp::set_process_name;
pub use platform_imp::shell_command;
pub use platform_imp::soft_terminate_process_group;
pub use platform_imp::spawn_sync;
pub use platform_imp::spawn_sync_daemon;
pub use platform_imp::spawn_sync_daemon_with_inheritance;
pub use platform_imp::start_attached_descendant_monitor;
pub use platform_imp::start_descendant_monitor;
pub use platform_imp::start_exact_trace;
pub use platform_imp::sync_child_native_handle;
pub use platform_imp::trampoline_exit_code;
pub use platform_imp::unix_mark_extra_fds_close_on_exec;
pub use platform_imp::unix_set_priority;
pub use platform_imp::unix_signal_process;
pub use platform_imp::unix_signal_process_group;
pub use platform_imp::unix_signal_raw;
pub use platform_imp::CaptureCancellation;
pub use platform_imp::TracedChild;
pub use platform_imp::WindowsJobHandle;
pub use platform_imp::terminal_input;

Modules§

env
Explicit caller-owned foreground command execution. The mechanism for reading declared environment variables (#1101).
env_vars
Every environment variable this crate reads in production, declared in one place (#1101).
foreground
Caller-owned foreground command execution.
platform
Neutral capability indexes for the eventual workspace-wide host boundary.

Macros§

declare_env_vars
Declare environment variables as EnvVar constants plus a table of all of them, so a crate’s inventory is one list rather than scattered literals.

Structs§

CaptureCancellation
PlatformCaptureReaders
The two prepared, cancellable capture readers of a child.
PlatformChild
Owned child handle returned by SpawnSpec::spawn.
PlatformEmergencySignal
Opaque, non-reap-capable emergency termination capability.
PlatformLifecycle
Opaque exit-wait capability owned by a process actor.
PlatformOutput
Opaque stdout or stderr reader owned by a process actor.
PlatformStdChild
A synchronously launched child whose exit is observed by polling.
PlatformStdin
Opaque piped stdin capability owned by a process actor.
ProcessLiveness
A live reference to another process, good for as long as it is held.
SpawnAdmission
Admission callback shared by cloned spawn descriptions.
SpawnSpec
Typed spawn description accepted by the blessed process boundary.
TracedChild
Root-process control handle whose wait state is owned by the tracer.
WindowsJobHandle

Enums§

HostPrivilegedIdentity
A privileged system identity this process may be running as.
ProcessPriority
Scheduling intent for a newly created child.
StreamMode
Stdio policy for one child stream.

Constants§

APE_EXECVP_SHELL_FALLBACK
Whether this libc’s execvp runs an ENOEXEC image with the shell, as POSIX requires. glibc does; musl does not.
APE_LOADER_HOST
Which embedded loader this host runs: the Linux static ELF.
APE_NEEDS_LOADER
An APE image is not a native Linux executable.
APE_SHELL
Shell the kernel’s ENOEXEC convention hands an unrecognized image to.
APE_SYSTEM_LOADERS
Where Cosmopolitan’s install instructions place a system-wide loader.
EXECUTABLE_EXTENSION
File-name extension the host requires on a runnable image, if any.

Functions§

after_compat_tokio_spawn
Complete host-owned setup after a legacy Tokio child has been spawned.
ape_anonymous_executable
Last-resort executable with no filesystem home: a sealed memfd exec’d via /proc/self/fd/N. Valid only for direct children of this process.
ape_default_loader_dirs
Default directories for extracted loaders, most durable first.
ape_is_exec_format_error
The kernel refused the image’s format.
ape_is_executable
Whether metadata carries any execute permission bit.
ape_mark_executable
Make an extracted loader executable by its owner and readable by others.
ape_private_exec_dir
Whether dir may hold an executable this crate installs: create it (mode 0700) if needed, then accept it only when it is a real directory owned by the effective user with no group/other write access – so no other account can plant or swap a file in it – on a mount that allows exec.
ape_route_through_execvp
Make the next spawn fork and execvp instead of posix_spawn.
ape_route_tokio_through_execvp
route_through_execvp for a Tokio command.
apply_process_priority
Apply a process priority expressed as a Unix nice value.
assign_child_to_windows_job
autostart_register
autostart_render_registration
Render the unit text without touching the filesystem.
autostart_unregister
cancel_capture_reader
canonical_environment_pairs
capture_reader_done
compat_shell_command
configure_compat_tokio_command
Apply host-owned setup for the legacy Tokio-command compatibility surface.
configure_exact_trace
Arrange for a successful exec to stop the child before user code runs. No pre-exec SIGSTOP is used: that would deadlock Command::spawn’s exec error pipe.
configure_process_command
configure_sync_contained_command
configure_sync_daemon_command
configure_sync_daemon_command_with_inheritance
configure_trampoline_command
current_executable_build_id
Return the GNU build ID of the running executable without reading the executable from disk.
exact_trace_capability
executable_file_name
Spell bare the way this host names an executable file.
executable_sibling_of_current_image
Path to a sibling program installed beside the running image.
exit_code
exit_signal
The signal that terminated status’s process, if it died from one.
fs_open_handles_block_removal
Whether a handle another process holds open keeps a file from being removed.
fs_write_all_to_descriptor
Write every byte of bytes, or report why not.
host_boot_id
An identifier that changes on every boot of this machine.
host_current_process_privilege
The privileged identity this process is running as, if any.
host_environment_keys_are_case_insensitive
Unix environment variable names compare byte for byte.
host_filesystem_device_id
The filesystem device this path lives on.
host_hostname
This machine’s name as the host reports it.
host_login_environment
The logged-in user’s environment, as a fresh login would see it.
host_login_environment_block
The login environment in the double-NUL-terminated UTF-16 block form.
host_machine_id
A durable per-machine identifier that survives reboots.
host_namespace_id
The mount and PID namespaces this process is in.
host_process_cgroup
This process’s control-group membership (/proc/self/cgroup). Linux has cgroups, so the answer is always Some; the inner error is a read failure.
host_user_machine_identity
A stable identity for this user on this machine.
kill_tree
monitor_console_windows
parent_has_console
prepare_capture_reader
process_can_replace_current_image
This host replaces a running image in place; see the facade for what that means for a caller that cannot accept a successor instead.
process_executable_path
Resolve the on-disk image a running process was started from.
process_fault_code_name
Operator-facing name of a fatal fault code recorded by a crash handler.
process_force_kill
Stop a process without asking.
process_install_owner_death_cleanup
Ask the kernel to signal this process when its owner exits.
process_install_shutdown_request_handler
Ask this host to report shutdown requests.
process_loaded_images
Enumerate the file-backed ELF images mapped in this process, ordered by (path, device, inode, load instance).
process_observer_backend
process_open_loaded_image_file
Reopen the file behind image, refusing one that no longer has the device and inode recorded in /proc/self/maps.
process_owner_death_cleanup_target
What this host will attempt, without attempting it.
process_read_argv
Return the process argv without flattening its argument boundaries.
process_read_cmdline
Return a stable human-readable rendering of read_process_argv.
process_read_file_handles
process_replace_current_image
Replace this process’s image with command.
process_same_executable_path
Whether two spellings name the same executable image on this host.
process_signal_terminate
Ask a process to stop.
process_snapshot
process_snapshot_for_pid
resources_fd_exhaustion_error
One error this host would report for descriptor exhaustion.
resources_inode_capacity
Probe inode capacity for the filesystem containing path.
resources_signals_fd_exhaustion
Whether this error means the process or the system is out of descriptors.
resources_signals_storage_exhaustion
Whether this error means the filesystem is out of space.
resources_storage_exhaustion_error
One error this host would report for storage exhaustion.
send_interrupt
Deliver the host’s interactive-interrupt request to pid.
set_process_name
set_window_icon_impl
Write source onto this process’s terminal window.
shell_command
shell_spec
Build a shell command using the host platform’s supported shell.
soft_terminate_process_group
Request a graceful shutdown for a child-owned POSIX process group.
spawn_sync
spawn_sync_daemon
spawn_sync_daemon_with_inheritance
start_attached_descendant_monitor
Attach to an already-running root (#1015). On this host the descendant monitor never depended on the spawn, so attaching is the same monitor.
start_descendant_monitor
start_exact_trace
sync_child_native_handle
trampoline_exit_code
unix_mark_extra_fds_close_on_exec⚠
Mark inherited descriptors close-on-exec without breaking std’s exec-error pipe.
unix_set_priority
unix_signal_process
unix_signal_process_group
unix_signal_raw
window_icon_support_impl
Whether this host can take a real icon.