title: C: How to add timeout on flock?
body: <p>In C programming, is there a way to achieve timeout on flock()?</p>
  
  <p>Thanks.</p>
  
  <pre><code>#include &lt;sys/file.h&gt;
  
  int flock(int fd, int operation);
  </code></pre>