6 #define IOC_REQUEST_GETATTR _IOWR('f', 30, long)
7 #define IOC_REQUEST_READPAGE _IOWR('f', 31, long)
9 int main(int argc, char **argv)
12 int cmd = IOC_REQUEST_GETATTR;
14 printf("ioctl type %d, nr %d size %d\n",
15 _IOC_TYPE(cmd), _IOC_NR(cmd), _IOC_SIZE(cmd));
17 fd = open("/dev/request", O_RDONLY);
19 printf("error opening /dev/request: %s\n", strerror(errno));
23 printf("getattr test... ");
24 rc = ioctl(fd, IOC_REQUEST_GETATTR, NULL);
25 printf("result: %d\n", rc);
27 printf("readpage test... ");
28 rc = ioctl(fd, IOC_REQUEST_READPAGE, NULL);
29 printf("result: %d\n", rc);