Does dnotify or inotify work in TS-Linux?
I can't seem to get this code to work.
http://souptonuts.sourceforge.net/code/dnotify.c.html
Ultimately, I need a way to tell in a user space app if a USB serial device is
plugged in while the app is running. I tried the above code modified to look
into /dev/usb/tts and that didn't work so I tried the above code unmodified
running as a background process and cp'ing a file. Again, no soap.
And I even tried this:
int main()
{
int fd, c;
struct pollfd pfd;
fd=open("/dev/usb/tts", O_RDONLY);
if(fd==-1)
return -1;
pfd.fd=fd;
pfd.events=POLLIN;
while(1) {
c=poll(&pfd, 1, 20000);
if(c==-1)
printf("Error polling\n");
else if(c==0)
printf("Timeout\n");
else
printf("Something changed");
}
}
But it's always printing "Something changed".
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|