Hopefully someone, somewhere, sometime needed to do this and succeeded...
What I need to do is check if a file is locked without actually locking it. What that means is that I can't use flock(FH, LOCK_EX|LOCK_NB) because it will actually lock the file in question and I can't allow that to happen even for a split second.