| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include_next <sys/socket.h> /* IWYU pragma: export */ |
| 5 |
|
| 6 |
/* Supported since kernel v6.5 (5e2ff6704a275be009be8979af17c52361b79b89) */ |
| 7 |
#ifndef SO_PASSPIDFD |
| 8 |
#define SO_PASSPIDFD 76 |
| 9 |
#endif |
| 10 |
|
| 11 |
/* Supported since kernel v6.5 (7b26952a91cf65ff1cc867a2382a8964d8c0ee7d) */ |
| 12 |
#ifndef SO_PEERPIDFD |
| 13 |
#define SO_PEERPIDFD 77 |
| 14 |
#endif |
| 15 |
|
| 16 |
/* Supported since kernel v6.16 (77cbe1a6d8730a07f99f9263c2d5f2304cf5e830) */ |
| 17 |
#ifndef SO_PASSRIGHTS |
| 18 |
#define SO_PASSRIGHTS 83 |
| 19 |
#endif |
| 20 |
|
| 21 |
/* Not exposed yet. Defined in include/linux/socket.h. */ |
| 22 |
#ifndef SOL_SCTP |
| 23 |
#define SOL_SCTP 132 |
| 24 |
#endif |
| 25 |
|
| 26 |
/* Supported since kernel v2.6.17 (2c7946a7bf45ae86736ab3b43d0085e43947945c). |
| 27 |
* Defined since glibc-2.39 */ |
| 28 |
#ifndef SCM_SECURITY |
| 29 |
#define SCM_SECURITY 0x03 |
| 30 |
#endif |
| 31 |
|
| 32 |
/* Supported since kernel v6.5 (5e2ff6704a275be009be8979af17c52361b79b89). |
| 33 |
* Defined since glibc-2.39 */ |
| 34 |
#ifndef SCM_PIDFD |
| 35 |
#define SCM_PIDFD 0x04 |
| 36 |
#endif |
| 37 |
|
| 38 |
/* The maximum number of fds that SCM_RIGHTS accepts. This is an internal kernel constant defined in |
| 39 |
* include/net/scm.h, but very much useful for userspace too. It's documented in unix(7) these days, hence |
| 40 |
* should be fairly reliable to define here. */ |
| 41 |
#ifndef SCM_MAX_FD |
| 42 |
#define SCM_MAX_FD 253U |
| 43 |
#endif |