I am trying to read a value from a pseudo file in a linux system. Basically, I am using a pandaboard and trying to detect a change on GPIO pin. for the first time when I thought about it, I though of having a while(1) loop and keep opening the file and check its value if it is 0 or 1. This is stupid I know. The other way to solve is to have an interrupt or something to generate me an event or send me a signal whenever the content of the pseudo file changes. I have been searching for 3 days but no useful result. Any help ??
The file I would like to read is
/sys/class/gpio/gpio113/value
This is the input value of the button on the pandaboard.