1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/sockets/tests/socket_bpf_extensions.phpt
David Carlier d677cc13ce Add SO_BPF_EXTENSIONS flag to socket.
Returns the supported bpf extensions from the kernel. Linux only.
Closes GH-8713.
2022-06-08 05:14:57 +01:00

24 lines
521 B
PHP

--TEST--
SO_BPF_EXTENSIONS socket_getopt test
--EXTENSIONS--
sockets
--SKIPIF--
<?php
if (!defined("SO_BPF_EXTENSIONS")) {
die("skip SO_BOF_EXTENSIONS");
}
?>
--FILE--
<?php
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if (!$socket) {
die('Unable to create AF_INET socket [socket]');
}
$flags = socket_getopt( $socket, SOL_SOCKET, SO_BPF_EXTENSIONS);
if ($flags == false) die("socket_getopt");
echo "extensions supported flag $flags";
socket_close($socket);
?>
--EXPECTF--
extensions supported flag %d