vgdb: Handle EAGAIN in read_buf
[valgrind.git] / none / tests / ioctl_moans.c
blobd35075834252c7a4312df1b5eab9e9666c8e5aca
1 /* Tests Valgrind moans about unknown ioctl.
2 10 unique moans should be produced.
3 */
5 #include <unistd.h>
6 #include <sys/ioctl.h>
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 # elif defined(VGO_freebsd)
15 #define IOCTL_REQUEST_BASE (0x12345670 | _IO(0,0))
16 # else
17 #define IOCTL_REQUEST_BASE 0x12345670
18 # endif
20 int main(int argc, const char *argv[])
22 ioctl(-1, IOCTL_REQUEST_BASE + 0x0);
23 ioctl(-1, IOCTL_REQUEST_BASE + 0x1);
24 ioctl(-1, IOCTL_REQUEST_BASE + 0x0);
25 ioctl(-1, IOCTL_REQUEST_BASE + 0x2);
26 ioctl(-1, IOCTL_REQUEST_BASE + 0x3);
27 ioctl(-1, IOCTL_REQUEST_BASE + 0x4);
28 ioctl(-1, IOCTL_REQUEST_BASE + 0x1);
29 ioctl(-1, IOCTL_REQUEST_BASE + 0x5);
30 ioctl(-1, IOCTL_REQUEST_BASE + 0x5);
31 ioctl(-1, IOCTL_REQUEST_BASE + 0x1);
32 ioctl(-1, IOCTL_REQUEST_BASE + 0x6);
33 ioctl(-1, IOCTL_REQUEST_BASE + 0x7);
34 ioctl(-1, IOCTL_REQUEST_BASE + 0x8);
35 ioctl(-1, IOCTL_REQUEST_BASE + 0x1);
36 ioctl(-1, IOCTL_REQUEST_BASE + 0x9);
37 ioctl(-1, IOCTL_REQUEST_BASE + 0x1);
38 ioctl(-1, IOCTL_REQUEST_BASE + 0x0);
39 ioctl(-1, IOCTL_REQUEST_BASE + 0xa);
40 ioctl(-1, IOCTL_REQUEST_BASE + 0xb);
41 ioctl(-1, IOCTL_REQUEST_BASE + 0xc);
42 ioctl(-1, IOCTL_REQUEST_BASE + 0xd);
43 ioctl(-1, IOCTL_REQUEST_BASE + 0x1);
44 ioctl(-1, IOCTL_REQUEST_BASE + 0xe);
45 ioctl(-1, IOCTL_REQUEST_BASE + 0x0);
46 ioctl(-1, IOCTL_REQUEST_BASE + 0xf);
48 return 0;