blob: d2807f5a6b5baf7bbdba6f1bdca9878ce0b3e7ff [file] [log] [blame]
Dmitry V. Levindf7aa2b2015-01-19 17:02:16 +00001#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. Levin8c20d892015-05-21 16:19:40 +000020#include <linux/videodev2.h>
21
Dmitry V. Levindf7aa2b2015-01-19 17:02:16 +000022#if defined MMTIMER_GETRES \
Dmitry V. Levin8c20d892015-05-21 16:19:40 +000023 && defined VIDIOC_ENUMINPUT \
Dmitry V. Levindf7aa2b2015-01-19 17:02:16 +000024 && defined HIDIOCGVERSION \
25 && defined HIDIOCGPHYS \
26 && defined EVIOCGBIT \
27 && defined EV_KEY
28
29int
30main(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. Levin8c20d892015-05-21 16:19:40 +000037 ioctl(-1, VIDIOC_ENUMINPUT, 0) != -1 ||
Dmitry V. Levindf7aa2b2015-01-19 17:02:16 +000038 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
49int
50main(void )
51{
52 return 77;
53}
54
55#endif