Most UNIX file locking is discretionary, not mandatory, so you need co-operating processes for locking to achieve anything. Even if you get the lock, if the other process (Oracle) isn't using flock then it will have no effect.
You may be able to get a spin-off from the /proc filesystem. Some UNIXs (inc. Linux) keep a record of open files for each process in there, but the format varies considerably.