On Tue, 18 Apr 2006, Andreas Jellinghaus wrote: > hmm. ok, I moved to flock() and now several processes have the same file > flock()#ed exclusively, i.e. that does not work either. > > next fcntl()? > > or are device files in any way special when it comes to flock(), fcntl() and > friend? I only want to make sure that only one process is talking to some > usb device at a time. and it would be nice if the kernel kept the log, so I > don't need to worry about cases like "what if the machines crashes / looses > power etc. and there is a stale lock file left".
All I know is what's in the man pages. You could try running your program with a regular file instead of the device file to see if the locking behavior changes. If you know that your program will use only one of the interfaces in the USB device, then claiming the interface is a good way to make it exclusive. Alan Stern ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel