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