


      CCCCHHHHMMMMOOOODDDD((((2222))))                    ((((UUUUNNNNIIIIXXXX 5555....0000))))                   CCCCHHHHMMMMOOOODDDD((((2222))))



      NNNNAAAAMMMMEEEE
           chmod - change mode of file

      SSSSYYYYNNNNTTTTAAAAXXXX
           iiiinnnntttt cccchhhhmmmmoooodddd ((((ppppaaaatttthhhh,,,, mmmmooooddddeeee))))
           cccchhhhaaaarrrr ****ppppaaaatttthhhh;;;;
           iiiinnnntttt mmmmooooddddeeee;;;;

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           _P_a_t_h points to a path name naming a file.  _C_h_m_o_d sets the
           access permission portion of the named file's mode according
           to the bit pattern contained in _m_o_d_e.

           Access permission bits are interpreted as follows:

                04000
                     Set user ID on execution.
                02000
                     Set group ID on execution.
                00400
                     Read by owner
                00200
                     Write by owner
                00100
                     Execute (or search if a directory) by owner
                00070
                     Read, write, execute (search) by group
                00007
                     Read, write, execute (search) by others

           The effective user ID of the process must match the owner of
           the file or be super-user to change the mode of a file.

           If the effective user ID of the process is not super-user or
           the effective group ID of the process does not match the
           group ID of the file, mode bit 02000 (set group ID on
           execution) is cleared.

           _C_h_m_o_d will fail and the file mode will be unchanged if one
           or more of the following are true:

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

                The named file does not exist.  [ENOENT]

                Search permission is denied on a component of the path
                prefix.  [EACCES]

                The effective user ID does not match the owner of the
                file and the effective user ID is not super-user.
                [EPERM]



      Page 1                                                   (9010-E)






      CCCCHHHHMMMMOOOODDDD((((2222))))                    ((((UUUUNNNNIIIIXXXX 5555....0000))))                   CCCCHHHHMMMMOOOODDDD((((2222))))



                The named file resides on a read-only file system.
                [EROFS]

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

      RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
           Upon successful completion, a value of 0 is returned.
           Otherwise, a value of -1 is returned and _e_r_r_n_o is set to
           indicate the error.

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           chown(2), mknod(2).










































      Page 2                                                   (9010-E)



