The current codes use _IOC_TYPE(cmd) == 0x89 to check if the cmd is one socket ioctl command like SIOCGIFHWADDR. But the literal number 0x89 may confuse readers. So create one macro SOCK_IOC_TYPE to enhance the readability.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -24,6 +24,8 @@ · 23 unmodified lines | |||
| 24 | #define SIOCINQ FIONREAD | 24 | #define SIOCINQ FIONREAD |
| 25 | #define SIOCOUTQ TIOCOUTQ /* output queue size (not sent + not acked) */ | 25 | #define SIOCOUTQ TIOCOUTQ /* output queue size (not sent + not acked) */ |
| 26 | 26 | ||
| 27 | #define SOCK_IOC_TYPE 0x89 | ||
| 28 | |||
| 27 | /* Routing table calls. */ | 29 | /* Routing table calls. */ |
| 28 | #define SIOCADDRT 0x890B /* add routing table entry */ | 30 | #define SIOCADDRT 0x890B /* add routing table entry */ |
| 29 | #define SIOCDELRT 0x890C /* delete routing table entry */ | 31 | #define SIOCDELRT 0x890C /* delete routing table entry */ |