6 #include <sys/select.h>
10 #define DEFDEV "/dev/ttyu0"
12 #define DEFDEV "/dev/ttyS0"
15 static void sighandler(int s);
17 static struct sball *sb;
20 int main(int argc, char **argv)
25 signal(SIGINT, sighandler);
27 if(!(sb = sball_open(argv[1] ? argv[1] : DEFDEV))) {
28 fprintf(stderr, "Failed to open spaceball at %s\n", argv[1] ? argv[1] : DEFDEV);
33 printf("Monitoring device, ctrl-c to quit\n");
39 if(select(fd + 1, &rdset, 0, 0, 0) > 0) {
40 if(FD_ISSET(fd, &rdset)) {
52 static void sighandler(int s)