1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

ext/sockets: adding SO_NOSIGPIPE constant.

it s the macOs way to disable the SIGPIPE signal emission, same
 as doing `signal(SIGPIPE, SIG_IGN)` but on the socket level.

Close GH-14065
This commit is contained in:
David Carlier
2024-04-28 10:33:28 +01:00
parent b0da6ed6ee
commit b147a22bb8
4 changed files with 14 additions and 1 deletions

2
NEWS
View File

@@ -209,6 +209,8 @@ PHP NEWS
(David Carlier) (David Carlier)
. Updated the socket_create_listen backlog argument default value to SOMAXCONN. . Updated the socket_create_listen backlog argument default value to SOMAXCONN.
(David Carlier) (David Carlier)
. Added the SO_NOSIGPIPE constant to control the generation of SIGPIPE for macOs.
(David Carlier)
- SNMP: - SNMP:
. Removed the deprecated inet_ntoa call support. (David Carlier) . Removed the deprecated inet_ntoa call support. (David Carlier)

View File

@@ -611,6 +611,7 @@ PHP 8.4 UPGRADE NOTES
. SOCK_DCCP (NetBSD only). . SOCK_DCCP (NetBSD only).
. TCP_SYNCNT (Linux only). . TCP_SYNCNT (Linux only).
. SO_EXCLBIND (Solaris/Illumos only). . SO_EXCLBIND (Solaris/Illumos only).
. SO_NOSIGPIPE (macOs only).
- Sodium: - Sodium:
. SODIUM_CRYPTO_AEAD_AEGIS128L_KEYBYTES . SODIUM_CRYPTO_AEAD_AEGIS128L_KEYBYTES

View File

@@ -1782,6 +1782,13 @@ const SO_DETACH_BPF = UNKNOWN;
*/ */
const SO_EXCLUSIVEADDRUSE = UNKNOWN; const SO_EXCLUSIVEADDRUSE = UNKNOWN;
#endif #endif
#if defined(SO_NOSIGPIPE)
/**
* @var int
* @cvalue SO_NOSIGPIPE
*/
const SO_NOSIGPIPE = UNKNOWN;
#endif
#if defined(TCP_QUICKACK) #if defined(TCP_QUICKACK)
/** /**
* @var int * @var int

View File

@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead. /* This is a generated file, edit the .stub.php file instead.
* Stub hash: 88a8e188f73c18c510eb984586b21109b347f251 */ * Stub hash: 70a996a13d739c1d2d165c73427cff59ebae1c5f */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_socket_select, 0, 4, MAY_BE_LONG|MAY_BE_FALSE) 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) ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1)
@@ -1020,6 +1020,9 @@ static void register_sockets_symbols(int module_number)
#if defined(SO_EXCLUSIVEADDRUSE) #if defined(SO_EXCLUSIVEADDRUSE)
REGISTER_LONG_CONSTANT("SO_EXCLUSIVEADDRUSE", SO_EXCLUSIVEADDRUSE, CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SO_EXCLUSIVEADDRUSE", SO_EXCLUSIVEADDRUSE, CONST_PERSISTENT);
#endif #endif
#if defined(SO_NOSIGPIPE)
REGISTER_LONG_CONSTANT("SO_NOSIGPIPE", SO_NOSIGPIPE, CONST_PERSISTENT);
#endif
#if defined(TCP_QUICKACK) #if defined(TCP_QUICKACK)
REGISTER_LONG_CONSTANT("TCP_QUICKACK", TCP_QUICKACK, CONST_PERSISTENT); REGISTER_LONG_CONSTANT("TCP_QUICKACK", TCP_QUICKACK, CONST_PERSISTENT);
#endif #endif