#include <fcntl.h>
#include <linux/joystick.h>
void main()
{
	int fd;
	int version =  0x000800;
	int ret;
	fd = open("/dev/input/js0", O_RDONLY);
	if (fd < 0)
	{
	perror("open");
	exit(1);
	}
	printf("opened joystick\n");
	printf("ioctl number is %08x\n", JSIOCGVERSION);
	ret = ioctl(fd, JSIOCGVERSION, &version);
	printf("ioctl returned %d\n", ret);
	printf("version is now %06x\n", version);
	close(fd);
	
}