diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 3b1912cff88a..ee1aee5278b3 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 000000000000..04c41887afd6 --- /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 9ecabaf97307..c650b25c0950 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);