title: fcntl how to know which process hold lock file?
body: <p>I'm new with fcntl locking and following this example to create a sample lock in linux using c code: <a href="http://www.informit.com/articles/article.aspx?p=23618&amp;seqNum=4" rel="nofollow noreferrer">http://www.informit.com/articles/article.aspx?p=23618&amp;seqNum=4</a></p>
  
  <p>I wonder how can we can print out which process hold the lock file and which process is waiting for lock. I consider using l_pid to figure out the process id which is holding the lock but i'm not sure the right way to do it.
  What is the best way to print out which process is holding the lock?</p>