]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46696: Add socket.SO_INCOMING_CPU constant (#31237)
authorDavid CARLIER <devnexen@gmail.com>
Tue, 3 May 2022 17:33:11 +0000 (18:33 +0100)
committerGitHub <noreply@github.com>
Tue, 3 May 2022 17:33:11 +0000 (11:33 -0600)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Doc/library/socket.rst
Misc/NEWS.d/next/Library/2022-02-09-21-40-02.bpo-46696.nPXRno.rst [new file with mode: 0644]
Modules/socketmodule.c

index 3b1912cff88a41ae583f91ae841049c2c296c317..ee1aee5278b3be39e952e797ead70fb606cd2a67 100755 (executable)
@@ -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 (file)
index 0000000..04c4188
--- /dev/null
@@ -0,0 +1 @@
+Add ``SO_INCOMING_CPU`` constant to :mod:`socket`.
index 9ecabaf973074477b5ba9d7eb788c9f736a09a7e..c650b25c095090622bce32bf550c6b9972c06fde 100644 (file)
@@ -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);