diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-25 16:27:53 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-26 00:20:05 +0900 |
| commit | 3a0d9340810a8808d963135a884f50d08442ac67 (patch) | |
| tree | 9fbed3350a23c791f52e37209095e0db41962c87 /crates/shirabe-php-shim/src/process.rs | |
| parent | 46ac7242d526e13707dc140b7244e0fadf2219b9 (diff) | |
| download | php-shirabe-3a0d9340810a8808d963135a884f50d08442ac67.tar.gz php-shirabe-3a0d9340810a8808d963135a884f50d08442ac67.tar.zst php-shirabe-3a0d9340810a8808d963135a884f50d08442ac67.zip | |
test: port 59 autoload/vcs/installer/util/command tests; fix output capture
Port autoload_generator (24), bitbucket (14), suggested_packages (11),
git_driver (6), archive_manager (3), and a bump command test. Fix the
ApplicationTester output-capture root cause (php://memory streams must be
readable regardless of fopen mode). Implement posix_getuid/geteuid, the PCRE
'A' anchored modifier, php_strip_whitespace, stream_get_wrappers, is_callable
scalars; fix preg_quote angle-bracket escaping and class-map parser regexes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim/src/process.rs')
| -rw-r--r-- | crates/shirabe-php-shim/src/process.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/shirabe-php-shim/src/process.rs b/crates/shirabe-php-shim/src/process.rs index 402ad8b..b652bed 100644 --- a/crates/shirabe-php-shim/src/process.rs +++ b/crates/shirabe-php-shim/src/process.rs @@ -371,14 +371,19 @@ pub fn pcntl_signal_get_handler(_signal: i64) -> PhpMixed { todo!() } +unsafe extern "C" { + fn getuid() -> u32; + fn geteuid() -> u32; +} + pub fn posix_getuid() -> i64 { - // TODO(phase-d): getuid(2) is not reachable without a libc/syscall crate. - todo!() + // getuid(2) cannot fail; libc is already linked into every binary, so no extra crate is needed. + (unsafe { getuid() }) as i64 } pub fn posix_geteuid() -> i64 { - // TODO(phase-d): geteuid(2) is not reachable without a libc/syscall crate. - todo!() + // geteuid(2) cannot fail; libc is already linked into every binary, so no extra crate is needed. + (unsafe { geteuid() }) as i64 } pub fn posix_getpwuid(_uid: i64) -> PhpMixed { |
