RENAME(2) BSD Programmer's Manual RENAME(2)
rename - change the name of a file
#include <stdio.h> int rename(const char *from, const char *to);
rename() al- ways exist, even if the system should crash in the middle of the opera- tion. If the final component of from is a symbolic link, the symbolic link is renamed, not the file or directory to which it points. error code will not be returned if the implementation permits cross-device links. [ENOSPC] The directory in which the entry for the new name is being placed cannot be extended because there is no space left on the file system containing the directory. .
open(2), symlink(7)
The rename() function conforms to IEEE Std 1003.1-1988 ("POSIX"). separate processes attempt to perform 'rename a/foo b/bar' and 'rename b/bar a/foo', respectively, the system may deadlock attempting to lock both directories for modification. Hard links to directories should be replaced by symbolic links by the system administrator..