Is there any C API using which my process can register a callback with the OS for informing my process whenever a file is updated (i.e., the time stamp of the file undergoes a change).

I have some experience of working in Windows OS and there is some facility available there.

In linux I was not getting such an API. What I am now thinking of doing is to run a thread which monitors the file timestamp with a periodicity. Though this would serve my purpose but it is not a very performant solution. Besides it is also not possible to continuously monitor and so instantaneous notification upon update is not possible.

If anyone knows of some direct and better way pls help.