Dmitry V. Levin | df7aa2b | 2015-01-19 17:02:16 +0000 | [diff] [blame] | 1 | #ifdef HAVE_CONFIG_H |
| 2 | # include "config.h" |
| 3 | #endif |
| 4 | #include <fcntl.h> |
| 5 | #include <stdint.h> |
| 6 | #include <unistd.h> |
| 7 | #include <termios.h> |
| 8 | #include <sys/ioctl.h> |
| 9 | |
| 10 | #ifdef HAVE_LINUX_MMTIMER_H |
| 11 | # include <linux/mmtimer.h> |
| 12 | #endif |
| 13 | #ifdef HAVE_LINUX_HIDDEV_H |
| 14 | # include <linux/hiddev.h> |
| 15 | #endif |
| 16 | #ifdef HAVE_LINUX_INPUT_H |
| 17 | # include <linux/input.h> |
| 18 | #endif |
| 19 | |
Dmitry V. Levin | 8c20d89 | 2015-05-21 16:19:40 +0000 | [diff] [blame^] | 20 | #include <linux/videodev2.h> |
| 21 | |
Dmitry V. Levin | df7aa2b | 2015-01-19 17:02:16 +0000 | [diff] [blame] | 22 | #if defined MMTIMER_GETRES \ |
Dmitry V. Levin | 8c20d89 | 2015-05-21 16:19:40 +0000 | [diff] [blame^] | 23 | && defined VIDIOC_ENUMINPUT \ |
Dmitry V. Levin | df7aa2b | 2015-01-19 17:02:16 +0000 | [diff] [blame] | 24 | && defined HIDIOCGVERSION \ |
| 25 | && defined HIDIOCGPHYS \ |
| 26 | && defined EVIOCGBIT \ |
| 27 | && defined EV_KEY |
| 28 | |
| 29 | int |
| 30 | main(void ) |
| 31 | { |
| 32 | struct termios tty; |
| 33 | uint64_t data; |
| 34 | |
| 35 | if (ioctl(-1, TCGETS, &tty) != -1 || |
| 36 | ioctl(-1, MMTIMER_GETRES, &data) != -1 || |
Dmitry V. Levin | 8c20d89 | 2015-05-21 16:19:40 +0000 | [diff] [blame^] | 37 | ioctl(-1, VIDIOC_ENUMINPUT, 0) != -1 || |
Dmitry V. Levin | df7aa2b | 2015-01-19 17:02:16 +0000 | [diff] [blame] | 38 | ioctl(-1, HIDIOCGVERSION, &data) != -1 || |
| 39 | ioctl(-1, HIDIOCGPHYS(8), &data) != -1 || |
| 40 | ioctl(-1, EVIOCGBIT(EV_KEY, 8), &data) != -1 || |
| 41 | ioctl(-1, _IOR(0xde, 0xad, data), &data) != -1) |
| 42 | return 77; |
| 43 | |
| 44 | return 0; |
| 45 | } |
| 46 | |
| 47 | #else |
| 48 | |
| 49 | int |
| 50 | main(void ) |
| 51 | { |
| 52 | return 77; |
| 53 | } |
| 54 | |
| 55 | #endif |