Repository navigation
Stdlib: socket_atmark() — TCP urgent-data OOB probe missing (ext/sockets/sockets.c) #6544
Copy link
Copy link
Closed
Labels
area:vmVirtual machineVirtual machineenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web apps
Description
Category
stdlib
Problem
socket_atmark() (PHP 8.0+) reports whether the next received byte is out-of-band / at the TCP urgent mark. It is registered in php-src ext/sockets but missing here — function_exists('socket_atmark') is false on bin/vm.php.
Distinct from ancillary-data helpers tracked in #6333 (socket_sendmsg / socket_recvmsg / socket_cmsg_space).
php-src reference
- php/php-src
ext/sockets/sockets.c—PHP_FUNCTION(socket_atmark) - php/php-src
ext/sockets/sockets.stub.php
Repro (failure today)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r "var_export(function_exists(\"socket_atmark\"));"'Observed: false.
Zend PHP 8.4: true when ext/sockets is loaded.
Scope (this repo)
| Builtin | Path | Notes |
|---|---|---|
socket_atmark |
new ext/sockets/socket_atmark.php + Module.php |
Thin wrapper over SIOCATMARK / platform equivalent via existing socket resource handle |
| JIT | lib/JIT/Builtin/ or VM-only initially |
Document in capability matrix |
Implement in ext/ + VM lowering; avoid new logic in runtime/*.c except unavoidable socket ABI.
Verification
test/compliance/cases/stdlib/socket_atmark.phpt(Unix stream socket pair +send(..., MSG_OOB)whenstream_socket_pairlands — Stdlib: stream_socket_pair() — connected socket pair (ext/standard/streams.c parity) #3437; until then skip with@requires function stream_socket_pair)./script/docker-exec.sh -- bash -lc 'vendor/bin/phpunit test/compliance/VMTest.php --filter socket_atmark'
Related
- Stdlib: socket_select() — ext/sockets multiplexing API missing (ext/sockets/sockets.c) #6395 / Stdlib: socket_listen()/socket_accept()/socket_set_option()/socket_get_option() — ext/sockets server API (ext/sockets/sockets.c) #6176 ext/sockets server API
- Stdlib: socket_sendmsg()/socket_recvmsg()/socket_cmsg_space() — ext/sockets ancillary data API missing (ext/sockets/sockets.c) #6333 ancillary data (separate API)
- Stdlib: stream_socket_pair() — connected socket pair (ext/standard/streams.c parity) #3437
stream_socket_pair()for IPC test harness
Done when
-
function_exists('socket_atmark')istrueonbin/vm.php -
socket_atmark($stream)returnsboolperSIOCATMARK/ platform equivalent (document unsupported platforms) -
test/compliance/cases/stdlib/socket_atmark.phptpasses whenstream_socket_pairavailable (Stdlib: stream_socket_pair() — connected socket pair (ext/standard/streams.c parity) #3437), skips otherwise -
./script/ci-fast.sh --filter socket_atmarkgreen - Capability matrix notes VM/JIT/AOT status
Strictness
php-src-strict — match PHP_FUNCTION(socket_atmark) in php-src ext/sockets/sockets.c.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:vmVirtual machineVirtual machineenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web apps
Activity
PurHur commentedon Jun 11, 2026
claim: cursor-agent lane-B — starting this run
Add socket_atmark() via ext/sockets FFI path (#6544) (#7995)
PurHur commentedon Jun 11, 2026
Merged via #7995
Verification
function_exists('socket_atmark')→trueonbin/vm.phpvendor/bin/phpunit test/compliance/VMTest.php --filter socket_atmark→ OK (1 test)socket_atmark/socket_import_streamVM-only)Implementation
ext/sockets/module —socket_atmark()via libcsockatmark(3)FFI (host PHP in harness images lacksHAVE_SOCKATMARK)Socketbuiltin wrapper +socket_import_stream()helper for OOB compliance whenstream_socket_pairlands (Stdlib: stream_socket_pair() — connected socket pair (ext/standard/streams.c parity) #3437)ext/sockets/sockets.cPHP_FUNCTION(socket_atmark)