Is there any way to get the number of process those are mapped to a particular file ?
Actually, I want to delete the file which is shared by multiple process when all processes are down. Is there any way to do that?
I tried with fstat
function call to get the number of hard links
but since after mapping I am closing the file so stat.st_nlink
is always 0
.