Skip to content

php-in-php: drop host getrusage/posix fallbacks from VmProcess identity - #7915

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-process-host-shrink
Jun 10, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-process-host-shrink

Conversation

@PurHur

@PurHur PurHur commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

  • ext/standard/basic_functions.c — getmyuid, getmygid, get_current_user, getrusage
  • ext/standard/microtime.c — PHP_FUNCTION(getrusage)

PHP implementation

Path Role
ext/standard/VmProcess.php getrusage() via VmGetrusageNative only
ext/standard/VmProcessIdentity.php identity via VmProcessIdentityNative only
test/unit/VmGetrusageNativeTest.php guard: no function_exists('getrusage')
test/unit/VmProcessIdentityNativeTest.php guard: no posix_* / getuid host calls

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit --filter "VmGetrusageNativeTest|VmProcessIdentityNativeTest"
vendor/bin/phpunit --filter process_identity
'

Output:

OK (9 tests, 47 assertions)   # VmGetrusageNativeTest + VmProcessIdentityNativeTest
OK (5 tests, 9 assertions)    # ProcessIdentity VM + JIT compliance

Related: #1492 #7287 #7891

Made with Cursor

…ty paths

Remove Zend PHP delegation from VmProcess::getrusage() and VmProcessIdentity
so M5 self-host uses libc FFI only (VmGetrusageNative / VmProcessIdentityNative).
Extends closed #7287/#7891 with runtime-shrink unit guards.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

php-in-php: VmMemory RSS path — remove host getrusage() fallback for bootstrap self-host (#4862, #3280)

1 participant