


      MMMMKKKKNNNNOOOODDDD((((2222))))                    ((((UUUUNNNNIIIIXXXX 5555....0000))))                   MMMMKKKKNNNNOOOODDDD((((2222))))



      NNNNAAAAMMMMEEEE
           mknod - make a directory, or a special or ordinary file

      SSSSYYYYNNNNTTTTAAAAXXXX
           iiiinnnntttt mmmmkkkknnnnoooodddd ((((ppppaaaatttthhhh,,,, mmmmooooddddeeee,,,, ddddeeeevvvv))))
           cccchhhhaaaarrrr ****ppppaaaatttthhhh;;;;
           iiiinnnntttt mmmmooooddddeeee,,,, ddddeeeevvvv;;;;

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           _M_k_n_o_d creates a new file named by the path name pointed to
           by _p_a_t_h.  The mode of the new file is initialized from _m_o_d_e.
           Where the value of _m_o_d_e is interpreted as follows (in
           octal):

              0170000 file type; one of the following:
                      0010000 fifo special
                      0020000 character special
                      0040000 directory
                      0060000 block special
                      0100000 or 0000000 ordinary file
              0004000 set user ID on execution
              0002000 set group ID on execution
              0000777 access permissions; constructed from the following
                      00000400 read by owner
                      0000200 write by owner
                      0000100 execute (search on directory) by owner
                      0000070 read, write, execute (search) by group
                      0000007 read, write, execute (search) by others

           The file's owner ID is set to the process's effective user
           ID.  The file's group ID is set to the process's effective
           group ID.

           Values of _m_o_d_e other than those above are undefined and
           should not be used.  The low-order 9 bits of _m_o_d_e are
           modified by the process's file mode creation mask:  all bits
           set in the process's file mode creation mask are cleared.
           See _u_m_a_s_k(2).  If _m_o_d_e indicates a block or character
           special file, _d_e_v is a configuration dependent specification
           of a character or block I/O device.  If _m_o_d_e does not
           indicate a block special or character special device, _d_e_v is
           ignored.

           _M_k_n_o_d may be invoked only by the super-user for file types
           other than FIFO special.

           _M_k_n_o_d will fail and the new file will not be created if one
           or more of the following are true:

                The process's effective user ID is not super-user.
                [EPERM]




      Page 1                                                   (9010-E)






      MMMMKKKKNNNNOOOODDDD((((2222))))                    ((((UUUUNNNNIIIIXXXX 5555....0000))))                   MMMMKKKKNNNNOOOODDDD((((2222))))



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

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

                The directory in which the file is to be created is
                located on a read-only file system.  [EROFS]

                The named file exists.  [EEXIST]

                _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
           mkdir(1), chmod(2), exec(2), umask(2), fs(4).


































      Page 2                                                   (9010-E)



