From c241931303448f9449051ea2080c1b65561066f2 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 2 Aug 2026 09:39:04 +0900 Subject: feat(php-shim): implement syscall-backed functions via the nix crate Several shim functions were left as todo!() because the standard library exposes no equivalent and no syscall crate was available. Adding nix unblocks them: - proc_open now wires descriptors beyond stderr, creating the pipe itself and installing the child end with dup2(2) from pre_exec - proc_terminate and posix_kill deliver arbitrary signals via kill(2) - get_current_user reports the owner of the running executable - php_uname answers every mode from uname(2) instead of only "s" and "r" It also closes gaps that were previously approximated: - fstat stats the stdio streams and pipes rather than reporting failure - touch stamps mtime/atime on an existing path, including directories - is_writable/is_executable use access(2) instead of permission bits - umask falls back to the read-modify-write umask(2) off Linux The hand-written repr(C) structs and extern "C" declarations for getpwuid, utime, statvfs, fcntl and select are replaced by their nix wrappers, which in turn lets disk_free_space drop its Linux-only cfg. cli_set_process_title, setproctitle and the pcntl_signal pair stay as todo!(): the first two need access to the process's own argv block, and the latter two depend on the signal-handling subsystem rather than on sigaction(2) itself. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe-php-shim/Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'crates/shirabe-php-shim/Cargo.toml') diff --git a/crates/shirabe-php-shim/Cargo.toml b/crates/shirabe-php-shim/Cargo.toml index 2b9b392a..82f3daa9 100644 --- a/crates/shirabe-php-shim/Cargo.toml +++ b/crates/shirabe-php-shim/Cargo.toml @@ -12,6 +12,7 @@ fastrand.workspace = true flate2.workspace = true indexmap.workspace = true md5.workspace = true +nix.workspace = true regex.workspace = true regex-macro.workspace = true reqwest.workspace = true -- cgit v1.3.1