PDA

View Full Version : Linux Device Files


BWiz
05-25-2010, 06:55 AM
As part of my engineering project, we need to read a device file (which is tied to an accelerometer) and retrieve data from the file.

The problem that I encountered is that the kernel will freeze the thread/process waiting for new data from the accelerometer - which potentially could never come say if the accelerometer fails.

My question is how to implement a timeout on reading the data without having to multi-thread the program.

Any ideas?