summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xDoc/library/socket.rst9
-rw-r--r--Misc/NEWS.d/next/Library/2022-02-09-21-40-02.bpo-46696.nPXRno.rst1
-rw-r--r--Modules/socketmodule.c3
3 files changed, 13 insertions, 0 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index 3b1912cff8..ee1aee5278 100755
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -575,6 +575,15 @@ Constants
.. availability:: FreeBSD.
+.. data:: SO_INCOMING_CPU
+
+ Constant to optimize CPU locality, to be used in conjunction with
+ :data:`SO_REUSEPORT`.
+
+ .. versionadded:: 3.11
+
+ .. availability:: Linux >= 3.9
+
Functions
^^^^^^^^^
diff --git a/Misc/NEWS.d/next/Library/2022-02-09-21-40-02.bpo-46696.nPXRno.rst b/Misc/NEWS.d/next/Library/2022-02-09-21-40-02.bpo-46696.nPXRno.rst
new file mode 100644
index 0000000000..04c41887af
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-02-09-21-40-02.bpo-46696.nPXRno.rst
@@ -0,0 +1 @@
+Add ``SO_INCOMING_CPU`` constant to :mod:`socket`.
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 9ecabaf973..c650b25c09 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -7505,6 +7505,9 @@ PyInit__socket(void)
#ifdef SO_EXCLUSIVEADDRUSE
PyModule_AddIntMacro(m, SO_EXCLUSIVEADDRUSE);
#endif
+#ifdef SO_INCOMING_CPU
+ PyModule_AddIntMacro(m, SO_INCOMING_CPU);
+#endif
#ifdef SO_KEEPALIVE
PyModule_AddIntMacro(m, SO_KEEPALIVE);