7 #define IOC_REQUEST_GETATTR _IOWR('f', 30, long)
8 #define IOC_REQUEST_READPAGE _IOWR('f', 31, long)
9 #define IOC_REQUEST_SETATTR _IOWR('f', 32, long)
11 int main(int argc, char **argv)
14 int cmd = IOC_REQUEST_GETATTR;
16 printf("ioctl type %d, nr %d size %d\n",
17 _IOC_TYPE(cmd), _IOC_NR(cmd), _IOC_SIZE(cmd));
19 fd = open("/dev/request", O_RDONLY);
21 printf("error opening /dev/request: %s\n", strerror(errno));
25 printf("getattr test... ");
26 rc = ioctl(fd, IOC_REQUEST_GETATTR, NULL);
27 printf("result: %d\n", rc);
29 printf("readpage test... ");
30 rc = ioctl(fd, IOC_REQUEST_READPAGE, NULL);
31 printf("result: %d\n", rc);
33 printf("setattr test... ");
34 rc = ioctl(fd, IOC_REQUEST_SETATTR, NULL);
35 printf("result: %d\n", rc);