title: How do i set a watch on an object in ceph?
body: <p>I am trying to keep a watch on an object in Ceph, but I don't know how to do it. I searched for examples online but could not find any. Found some documentation <a href="http://docs.ceph.com/docs/jewel/rados/api/librados/" rel="nofollow noreferrer">here</a>. It says that I can use rados_watch to watch an object for changes. But I dont know how to implement it in C, especially the rados_watchcb_t part. It says rados_watchcb_t would contain the action to execute on notification. How do I declare it?</p>
  
  <p>This is what I tried:</p>
  
  <pre><code>rados_watchcb_t rados_watch = printf("Updated");
  </code></pre>
  
  <p>But this gives an error.</p>