The mount namespace has supported id retrieval for a while already. Add support for the other types as well.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -16,8 +16,6 @@ · 15 unmodified lines | |||
| 16 | #define NS_GET_NSTYPE _IO(NSIO, 0x3) | 16 | #define NS_GET_NSTYPE _IO(NSIO, 0x3) |
| 17 | /* Get owner UID (in the caller's user namespace) for a user namespace */ | 17 | /* Get owner UID (in the caller's user namespace) for a user namespace */ |
| 18 | #define NS_GET_OWNER_UID _IO(NSIO, 0x4) | 18 | #define NS_GET_OWNER_UID _IO(NSIO, 0x4) |
| 19 | /* Get the id for a mount namespace */ | ||
| 20 | #define NS_GET_MNTNS_ID _IOR(NSIO, 0x5, __u64) | ||
| 21 | /* Translate pid from target pid namespace into the caller's pid namespace. */ | 19 | /* Translate pid from target pid namespace into the caller's pid namespace. */ |
| 22 | #define NS_GET_PID_FROM_PIDNS _IOR(NSIO, 0x6, int) | 20 | #define NS_GET_PID_FROM_PIDNS _IOR(NSIO, 0x6, int) |
| 23 | /* Return thread-group leader id of pid in the callers pid namespace. */ | 21 | /* Return thread-group leader id of pid in the callers pid namespace. */ |
| @@ -42,6 +40,10 @@ struct mnt_ns_info { · 18 unmodified lines | |||
| 42 | /* Get previous namespace. */ | 40 | /* Get previous namespace. */ |
| 43 | #define NS_MNT_GET_PREV _IOR(NSIO, 12, struct mnt_ns_info) | 41 | #define NS_MNT_GET_PREV _IOR(NSIO, 12, struct mnt_ns_info) |
| 44 | 42 | ||
| 43 | /* Retrieve namespace identifiers. */ | ||
| 44 | #define NS_GET_MNTNS_ID _IOR(NSIO, 5, __u64) | ||
| 45 | #define NS_GET_ID _IOR(NSIO, 13, __u64) | ||
| 46 | |||
| 45 | enum init_ns_ino { | 47 | enum init_ns_ino { |
| 46 | IPC_NS_INIT_INO = 0xEFFFFFFFU, | 48 | IPC_NS_INIT_INO = 0xEFFFFFFFU, |
| 47 | UTS_NS_INIT_INO = 0xEFFFFFFEU, | 49 | UTS_NS_INIT_INO = 0xEFFFFFFEU, |