1 /* Tests Valgrind moans about unknown ioctl. 2 10 unique moans should be produced. 3 */ 4 5 #include <sys/ioctl.h> 6 7 /* An ioctl request for a strange ioctl device driver. 8 The choice of values here needs to match the logic in 9 ML_(PRE_unknown_ioctl) and take into account that _IOC_NONE 10 is not == 0 everywhere. */ 11 # if defined(VGO_linux) 12 #define IOCTL_REQUEST_BASE (0x12345670 | _IOC(_IOC_NONE,0,0,0)) 13 # else 14 #define IOCTL_REQUEST_BASE 0x12345670 15 # endif 16 17 int main(int argc, const char *argv[]) 18 { 19 ioctl(-1, IOCTL_REQUEST_BASE + 0x0); 20 ioctl(-1, IOCTL_REQUEST_BASE + 0x1); 21 ioctl(-1, IOCTL_REQUEST_BASE + 0x0); 22 ioctl(-1, IOCTL_REQUEST_BASE + 0x2); 23 ioctl(-1, IOCTL_REQUEST_BASE + 0x3); 24 ioctl(-1, IOCTL_REQUEST_BASE + 0x4); 25 ioctl(-1, IOCTL_REQUEST_BASE + 0x1); 26 ioctl(-1, IOCTL_REQUEST_BASE + 0x5); 27 ioctl(-1, IOCTL_REQUEST_BASE + 0x5); 28 ioctl(-1, IOCTL_REQUEST_BASE + 0x1); 29 ioctl(-1, IOCTL_REQUEST_BASE + 0x6); 30 ioctl(-1, IOCTL_REQUEST_BASE + 0x7); 31 ioctl(-1, IOCTL_REQUEST_BASE + 0x8); 32 ioctl(-1, IOCTL_REQUEST_BASE + 0x1); 33 ioctl(-1, IOCTL_REQUEST_BASE + 0x9); 34 ioctl(-1, IOCTL_REQUEST_BASE + 0x1); 35 ioctl(-1, IOCTL_REQUEST_BASE + 0x0); 36 ioctl(-1, IOCTL_REQUEST_BASE + 0xa); 37 ioctl(-1, IOCTL_REQUEST_BASE + 0xb); 38 ioctl(-1, IOCTL_REQUEST_BASE + 0xc); 39 ioctl(-1, IOCTL_REQUEST_BASE + 0xd); 40 ioctl(-1, IOCTL_REQUEST_BASE + 0x1); 41 ioctl(-1, IOCTL_REQUEST_BASE + 0xe); 42 ioctl(-1, IOCTL_REQUEST_BASE + 0x0); 43 ioctl(-1, IOCTL_REQUEST_BASE + 0xf); 44 45 return 0; 46 } 47