bart | d77a4ca | 2014-06-28 07:18:33 +0000 | [diff] [blame] | 1 | /* Tests Valgrind moans about unknown ioctl. |
| 2 | 10 unique moans should be produced. |
| 3 | */ |
| 4 | |
Elliott Hughes | a0664b9 | 2017-04-18 17:46:52 -0700 | [diff] [blame] | 5 | #include <unistd.h> |
bart | d77a4ca | 2014-06-28 07:18:33 +0000 | [diff] [blame] | 6 | #include <sys/ioctl.h> |
| 7 | |
florian | 21628d2 | 2015-03-14 15:54:05 +0000 | [diff] [blame] | 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. */ |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 12 | # if defined(VGO_linux) |
florian | 21628d2 | 2015-03-14 15:54:05 +0000 | [diff] [blame] | 13 | #define IOCTL_REQUEST_BASE (0x12345670 | _IOC(_IOC_NONE,0,0,0)) |
rhyskidd | 05d2cab | 2015-03-21 06:35:32 +0000 | [diff] [blame] | 14 | # else |
| 15 | #define IOCTL_REQUEST_BASE 0x12345670 |
| 16 | # endif |
bart | d77a4ca | 2014-06-28 07:18:33 +0000 | [diff] [blame] | 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 | } |