ext/sockets: Adding macOS SO_LINGER_SEC constant.

macOS SO_LINGER, unlike other platforms, functions in term of ticks,
SO_LINGER_SEC is provided to be in line with other platforms.

close GH-14599
This commit is contained in:
David Carlier 2024-06-18 21:33:03 +01:00
parent c588db1ee7
commit 9672cd9469
No known key found for this signature in database
GPG Key ID: CEF290BB40D2086B
4 changed files with 14 additions and 1 deletions

2
NEWS
View File

@ -257,6 +257,8 @@ PHP NEWS
(David Carlier)
. Added the SO_NOSIGPIPE constant to control the generation of SIGPIPE for
macOs and FreeBSD. (David Carlier)
. Added SO_LINGER_SEC for macOs, true equivalent of SO_LINGER in other platforms.
(David Carlier)
- SNMP:
. Removed the deprecated inet_ntoa call support. (David Carlier)

View File

@ -742,6 +742,7 @@ PHP 8.4 UPGRADE NOTES
. TCP_SYNCNT (Linux only).
. SO_EXCLBIND (Solaris/Illumos only).
. SO_NOSIGPIPE (macOs and FreeBSD).
. SO_LINGER_SEC (macOs only).
- Sodium:
. SODIUM_CRYPTO_AEAD_AEGIS128L_KEYBYTES

View File

@ -208,6 +208,13 @@ const SO_DONTROUTE = UNKNOWN;
* @cvalue SO_LINGER
*/
const SO_LINGER = UNKNOWN;
#ifdef SO_LINGER_SEC
/**
* @var int
* @cvalue SO_LINGER_SEC
*/
const SO_LINGER_SEC = UNKNOWN;
#endif
/**
* @var int
* @cvalue SO_BROADCAST

View File

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 49b34a1e2f25000d71fb5bf6722db31607ded646 */
* Stub hash: 3a3ee52b0773e96ead463517e6d9a68c2b385b92 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_socket_select, 0, 4, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1)
@ -400,6 +400,9 @@ static void register_sockets_symbols(int module_number)
REGISTER_LONG_CONSTANT("SO_KEEPALIVE", SO_KEEPALIVE, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SO_DONTROUTE", SO_DONTROUTE, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SO_LINGER", SO_LINGER, CONST_PERSISTENT);
#if defined(SO_LINGER_SEC)
REGISTER_LONG_CONSTANT("SO_LINGER_SEC", SO_LINGER_SEC, CONST_PERSISTENT);
#endif
REGISTER_LONG_CONSTANT("SO_BROADCAST", SO_BROADCAST, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SO_OOBINLINE", SO_OOBINLINE, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SO_SNDBUF", SO_SNDBUF, CONST_PERSISTENT);