Last active
August 29, 2015 14:20
-
-
Save posborne/83ea6880770a1aef332e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <linux/ioctl.h> | |
#include <stdio.h> | |
int main(int argc, char **argv) { | |
printf("_IO('q', 10) => 0x%08lX\n", (unsigned long int)_IO('q', 10)); | |
printf("_IO('a', 255) => 0x%08lX\n", (unsigned long int)_IO('a', 255)); | |
printf("_IOW('z', 10, char[1]) => 0x%04lX\n", _IOW('z', 10, char[1])); | |
printf("_IOW('z', 10, char[512] => 0x%04lX\n", _IOW('z', 10, char[512])); | |
printf("_IOW('z', 10, char[1 << 32] => 0x%04lX\n", _IOW('z', 10, char[1 << 32])); // _IOC_SZ_BITS = 14 | |
printf("_IOR('z', 10, char[1]) => 0x%04lX\n", _IOR('z', 10, char[1])); | |
printf("_IOR('z', 10, char[512]) => 0x%04lX\n", _IOR('z', 10, char[512])); | |
printf("_IOR('z', 10, char[1 << 32] => 0x%04lX\n", _IOR('z', 10, char[1 << 32])); // _IOC_SZ_BITS = 14 | |
printf("_IOWR('z', 10, char[1]) => 0x%04lX\n", _IOWR('z', 10, char[1])); | |
printf("_IOWR('z', 10, char[512]) => 0x%04lX\n", _IOWR('z', 10, char[512])); | |
printf("_IOWR('z', 10, char[1 << 32] => 0x%04lX\n", _IOWR('z', 10, char[1 << 32])); // _IOC_SZ_BITS = 14 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_IO('q', 10) => 0x0000710A | |
_IO('a', 255) => 0x000061FF | |
_IOW('z', 10, char[1]) => 0x40017A0A | |
_IOW('z', 10, char[512] => 0x42007A0A | |
_IOW('z', 10, char[1 << 32] => 0x40007A0A | |
_IOR('z', 10, char[1]) => 0x80017A0A | |
_IOR('z', 10, char[512]) => 0x82007A0A | |
_IOR('z', 10, char[1 << 32] => 0x80007A0A | |
_IOWR('z', 10, char[1]) => 0xC0017A0A | |
_IOWR('z', 10, char[512]) => 0xC2007A0A | |
_IOWR('z', 10, char[1 << 32] => 0xC0007A0A |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment