LJ Archive

Listing 5. Using EVIOCGPHYS for Topology Information

if(ioctl(fd, EVIOCGPHYS(sizeof(phys)), phys) < 0) {
    perror("event ioctl");
}
printf("The device on %s says its path is %s\n",
       argv[1], phys);
LJ Archive