c++inotifyinotifydataerrorinfoinotify-tools

inotify_init() Function Falied


I installed inotify and plugin code into my existing code for watch file.I am always getting message that inotify failed.

I googled and found that kernel should with inotify option.(Not sure how will I check as I am using remote machine).

I have added all shared library in compilation.( does not relate but in case any possibility)

Linux machinename 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:33:05 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

Any idea How can I debug the issue as I am using inotify tool first time

inotify = inotify_init();
         if(inotify<0)
         {
             loginfo<<" inotify_init fail"<<inotify<<endl;
         }

 output = -1

Solution

  • I have done analysis and found that inotify does not work less than 2.6.13 kernel version.It was the primary reason I was getting error and did not get desire result