LJ Archive

Listing 1. Sample EVIOCGVERSION Function

/* ioctl() accesses the underlying driver */
if (ioctl(fd, EVIOCGVERSION, &version)) {
    perror("evdev ioctl");
}

/* the EVIOCGVERSION ioctl() returns an int */
/* so we unpack it and display it */
printf("evdev driver version is %d.%d.%d\n",
       version >> 16, (version >> 8) & 0xff,
       version & 0xff);
LJ Archive