History

driver: tun: Use new macro SOCK_IOC_TYPE instead of literal number 0x89

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.

Gao Feng committed 10 years ago

Commit 20861f21 parent c62cce22 files · +3 −1Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/sockios.h+2−0
@@ -24,6 +24,8 @@ · 23 unmodified lines
24#define SIOCINQ FIONREAD24#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 */