The link() function creates a new link (directory entry) for the existing file and increments its link count by one. The existing argument points to a path
name naming an existing file. The new argument points to a pathname naming the new directory entry to be created.
To create hard links, both files must be on the same file system. Both the old and the new link share equal access and rights to the underlying object. The super-user may make multiple links to a
directory. Unless the caller is the super-user, the file named by existing must not be a directory.
Upon successful completion, link() marks for update the st_ctime field of the file. Also, the st_ctime and st_mtime fields
of the directory that contains the new entry are marked for update.
|