title: How to register a callback to execute on a file change in linux?
body: <p>I'm writing a little linux utility in C that will monitor a virtual device that exposes basic data (e.g. temperature sensor).  I want to avoid polling the file (e.g. by continuously <code>cat /sys/devices/virtual/thermal/thermal_zone0/temp</code>) and instead register a callback to execute on changes to that file.  Requirements are not realtime at all.</p>
  
  <p>How can I avoid continuously reading that file as fast as I can?</p>