


      RRRREEEENNNNAAAAMMMMEEEE((((2222))))                   ((((bbbbssssdddd 4444....2222))))                   RRRREEEENNNNAAAAMMMMEEEE((((2222))))



      NNNNAAAAMMMMEEEE
           rename - change the name of a file

      SSSSYYYYNNNNTTTTAAAAXXXX
           rrrreeeennnnaaaammmmeeee((((ffffrrrroooommmm,,,, ttttoooo))))
           cccchhhhaaaarrrr ****ffffrrrroooommmm,,,, ****ttttoooo;;;;

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           _R_e_n_a_m_e causes the link named _f_r_o_m to be renamed as _t_o.  If
           _t_o exists, then it is first removed.  Both _f_r_o_m and _t_o must
           be of the same type (that is, both directories or both non-
           directories), and must reside on the same file system.

           _R_e_n_a_m_e guarantees that an instance of _t_o will always exist,
           even if the system should crash in the middle of the
           operation.

      RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
           A 0 value is returned if the operation succeeds, otherwise
           _r_e_n_a_m_e returns -1 and the global variable _e_r_r_n_o indicates
           the reason for the failure.

      EEEERRRRRRRROOOORRRRSSSS
           _R_e_n_a_m_e will fail and neither of the argument files will be
           affected if any of the following are true:

           [ENOTDIR]      A component of either path prefix is not a
                          directory.

           [ENOENT]       A component of either path prefix does not
                          exist.

           [EACCES]       A component of either path prefix denies
                          search permission.

           [ENOENT]       The file named by _f_r_o_m does not exist.

           [EPERM]        The file named by _f_r_o_m is a directory and the
                          effective user ID is not super-user.

           [EXDEV]        The link named by _t_o and the file named by
                          _f_r_o_m are on different logical devices (file
                          systems).  Note that this error code will not
                          be returned if the implementation permits
                          cross-device links.

           [EACCES]       The requested link requires writing in a
                          directory with a mode that denies write
                          permission.

           [EROFS]        The requested link requires writing in a
                          directory on a read-only file system.



      Page 1                                                   (9010-E)






      RRRREEEENNNNAAAAMMMMEEEE((((2222))))                   ((((bbbbssssdddd 4444....2222))))                   RRRREEEENNNNAAAAMMMMEEEE((((2222))))



           [EFAULT]       _P_a_t_h points outside the process's allocated
                          address space.

           [EINVAL]       _F_r_o_m is a parent directory of _t_o.

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           open(2)
















































      Page 2                                                   (9010-E)



