Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
SO_BPF_EXTENSIONS
flag to socket.
Returns the supported bpf extensions from the kernel. Linux only. Closes GH-8713.
- Loading branch information
Showing
5 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--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 |