You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bootstrap: gethostname() VM path — libc gethostname(2) without host PHP (phpc_gethostname.c) #5022
gethostname() VM path calls VmHost::gethostname() which delegates to host Zend PHP \gethostname(). For self-host / AOT (#1492), the VM must not depend on Zend for this syscall.
JIT/AOT already use __compiler_gethostname from lib/AOT/runtime/phpc_gethostname.c (#3465); VM execute path is the gap.
Today VM always routes through VmHost → \gethostname(). Bootstrap inventory includes ext/standard/gethostname.php — native VM should call the same C helper as JIT.
Change:VmHost::gethostname() routes through libc gethostname(2) via FFI (256-byte buffer, same failure semantics as JitGethostname). Removed host Zend @\gethostname() delegation on the VM execute path.
C runtime: no new C; phpc_gethostname.c already absent — VM now aligns with existing JIT/AOT libc path.
Activity
PurHur commentedon Jun 8, 2026
claim: PHP Runtime → PHP — starting this run (#5022: VmHost gethostname via libc FFI, no host \gethostname() delegation).
gethostname() VM path: libc FFI instead of host PHP (#5022) (#7716)
PurHur commentedon Jun 8, 2026
Merged via #7716.
Change:
VmHost::gethostname()routes through libcgethostname(2)via FFI (256-byte buffer, same failure semantics asJitGethostname). Removed host Zend@\gethostname()delegation on the VM execute path.C runtime: no new C;
phpc_gethostname.calready absent — VM now aligns with existing JIT/AOT libc path.Verification (green):
php bin/vm.php -r "var_dump(gethostname());"→ non-empty hostname stringvendor/bin/phpunit --filter "GethostnameBuiltinTest|VmHostTest|GethostnameVMTest|GethostnameJITTest"→ OK (6 tests)