[php-src] master: ext/sockets: adding SO_NOSIGPIPE constant.

From: Date: Sun, 28 Apr 2024 11:02:16 +0000
Subject: [php-src] master: ext/sockets: adding SO_NOSIGPIPE constant.
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-128242@lists.php.net to get a copy of this message
Author: David Carlier (devnexen) Date: 2024-04-28T12:01:03+01:00 Commit: https://github.com/php/php-src/commit/b147a22bb87508f0b6ef2f59731a4bcccbba7b35 Raw diff: https://github.com/php/php-src/commit/b147a22bb87508f0b6ef2f59731a4bcccbba7b35.diff 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 Changed paths: M NEWS M UPGRADING M ext/sockets/sockets.stub.php M ext/sockets/sockets_arginfo.h Diff: diff --git a/NEWS b/NEWS index c35b3634dbcff..159d91b460739 100644 --- a/NEWS +++ b/NEWS @@ -209,6 +209,8 @@ PHP NEWS (David Carlier) . Updated the socket_create_listen backlog argument default value to SOMAXCONN. (David Carlier) + . Added the SO_NOSIGPIPE constant to control the generation of SIGPIPE for macOs. + (David Carlier) - SNMP: . Removed the deprecated inet_ntoa call support. (David Carlier) diff --git a/UPGRADING b/UPGRADING index 7c93e6f57b659..a6835b501495f 100644 --- a/UPGRADING +++ b/UPGRADING @@ -611,6 +611,7 @@ PHP 8.4 UPGRADE NOTES . SOCK_DCCP (NetBSD only). . TCP_SYNCNT (Linux only). . SO_EXCLBIND (Solaris/Illumos only). + . SO_NOSIGPIPE (macOs only). - Sodium: . SODIUM_CRYPTO_AEAD_AEGIS128L_KEYBYTES diff --git a/ext/sockets/sockets.stub.php b/ext/sockets/sockets.stub.php index 00062610b7ea7..0b48d7109064b 100644 --- a/ext/sockets/sockets.stub.php +++ b/ext/sockets/sockets.stub.php @@ -1782,6 +1782,13 @@ */ const SO_EXCLUSIVEADDRUSE = UNKNOWN; #endif +#if defined(SO_NOSIGPIPE) +/** + * @var int + * @cvalue SO_NOSIGPIPE + */ +const SO_NOSIGPIPE = UNKNOWN; +#endif #if defined(TCP_QUICKACK) /** * @var int diff --git a/ext/sockets/sockets_arginfo.h b/ext/sockets/sockets_arginfo.h index 50c5e114c8ed4..30a5aade8a0c0 100644 --- a/ext/sockets/sockets_arginfo.h +++ b/ext/sockets/sockets_arginfo.h @@ -1,5 +1,5 @@ /* 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_ARG_TYPE_INFO(1, read, IS_ARRAY, 1) @@ -1020,6 +1020,9 @@ static void register_sockets_symbols(int module_number) #if defined(SO_EXCLUSIVEADDRUSE) REGISTER_LONG_CONSTANT("SO_EXCLUSIVEADDRUSE", SO_EXCLUSIVEADDRUSE, CONST_PERSISTENT); #endif +#if defined(SO_NOSIGPIPE) + REGISTER_LONG_CONSTANT("SO_NOSIGPIPE", SO_NOSIGPIPE, CONST_PERSISTENT); +#endif #if defined(TCP_QUICKACK) REGISTER_LONG_CONSTANT("TCP_QUICKACK", TCP_QUICKACK, CONST_PERSISTENT); #endif

« previous php.cvs (#128242) next »