Skip to content

Commit d5dfcd4

Browse files
bpo-46696: Add socket.SO_INCOMING_CPU constant (#31237)
Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent b295a92 commit d5dfcd4

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

Doc/library/socket.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,15 @@ Constants
575575

576576
.. availability:: FreeBSD.
577577

578+
.. data:: SO_INCOMING_CPU
579+
580+
Constant to optimize CPU locality, to be used in conjunction with
581+
:data:`SO_REUSEPORT`.
582+
583+
.. versionadded:: 3.11
584+
585+
.. availability:: Linux >= 3.9
586+
578587
Functions
579588
^^^^^^^^^
580589

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add ``SO_INCOMING_CPU`` constant to :mod:`socket`.

Modules/socketmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7505,6 +7505,9 @@ PyInit__socket(void)
75057505
#ifdef SO_EXCLUSIVEADDRUSE
75067506
PyModule_AddIntMacro(m, SO_EXCLUSIVEADDRUSE);
75077507
#endif
7508+
#ifdef SO_INCOMING_CPU
7509+
PyModule_AddIntMacro(m, SO_INCOMING_CPU);
7510+
#endif
75087511

75097512
#ifdef SO_KEEPALIVE
75107513
PyModule_AddIntMacro(m, SO_KEEPALIVE);

0 commit comments

Comments
 (0)