The creation of the new name is atomic. The two names must be on the same filesystem. Directories may not be hard-linked.
ENODEV The device prefix of one of the names did not exist. ENOTDIR A non-final component of one of the names was not a directory. ENOENT A non-final component of newname did not exist. ENOENT oldname does not exist. EEXIST newname already exists. EISDIR oldname is a directory. EXDEV The two names are on different filesystems. ENOSPC The filesystem involved is full. EIO A hard I/O error occurred. EFAULT One of the arguments was an invalid pointer.