Skip to content

Commit f4a726d

Browse files
ltworfbrianschubertblurb-it[bot]StanFromIrelandvstinner
authored
GH-135357: Add socket.SO_PASSRIGHTS constant (#135355)
Constant added to Linux 6.16. See the LWN article: https://lwn.net/Articles/1023085/ Co-authored-by: Brian Schubert <brianm.schubert@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
1 parent 62792c8 commit f4a726d

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

Doc/library/socket.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ The AF_* and SOCK_* constants are now :class:`AddressFamily` and
486486

487487
.. versionchanged:: 3.15
488488
``IPV6_HDRINCL`` was added.
489+
Added support for ``SO_PASSRIGHTS`` on Linux platforms when available.
489490

490491

491492
.. data:: AF_CAN
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for :data:`!socket.SO_PASSRIGHTS` on Linux.

Modules/socketmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8276,6 +8276,9 @@ socket_exec(PyObject *m)
82768276
#ifdef SO_BINDTODEVICE
82778277
ADD_INT_MACRO(m, SO_BINDTODEVICE);
82788278
#endif
8279+
#ifdef SO_PASSRIGHTS
8280+
ADD_INT_MACRO(m, SO_PASSRIGHTS);
8281+
#endif
82798282
#ifdef SO_BINDTOIFINDEX
82808283
ADD_INT_MACRO(m, SO_BINDTOIFINDEX);
82818284
#endif

0 commit comments

Comments
 (0)