Is there a userland C function available that will tell me the number of open file descriptors on a file? I'm trying to write a program that accesses a user's mailbox, and once I rename the mailbox to mailbox.lock, I want to be sure that there are no open file descriptors left open on it before I start processing the file. (I want to make sure procmail has finished any pending writes). I thought the best way to do this would be to check for remaining open file descriptors, but I cannot find a userland C function that supports this.