Removing symbolic links for a original file in C

c, linux, unix

Solution

There is no way to get a list of symbolic links that point to a particular file save 'the hard way', IE go through the entire file system recursively (or whatever subset of the file system you know the symbolic links to be in) and determine whether any resolve to that file. You would probably be best outsourcing that to the `find` utility.

Problem

I am writing a C program, that uses *NIX System calls. Now, when the user calls for deleting a particular file, I want to remove all the symbolic links created to the file, also to be removed. How can this be achieved?

Original source