


      CCCCRRRREEEEAAAATTTT((((2222))))                    ((((UUUUNNNNIIIIXXXX 5555....0000))))                   CCCCRRRREEEEAAAATTTT((((2222))))



      NNNNAAAAMMMMEEEE
           creat - create a new file or rewrite an existing one

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

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           _C_r_e_a_t creates a new ordinary file or prepares to rewrite an
           existing file named by the path name pointed to by _p_a_t_h.

           If the file exists, the length is truncated to 0 and the
           mode and owner are unchanged.  Otherwise, 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, and the
           low-order 12 bits of the file mode are set to the value of
           _m_o_d_e modified as follows:

                All bits set in the process's file mode creation mask
                are cleared.  See _u_m_a_s_k(2).

           Upon successful completion, a non-negative integer, namely
           the file descriptor, is returned and the file is open for
           writing, even if the mode does not permit writing.  The file
           pointer is set to the beginning of the file.  The file
           descriptor is set to remain open across _e_x_e_c system calls.
           See _f_c_n_t_l(2).  No process may have more than 64 files open
           simultaneously.  A new file may be created with a mode that
           forbids writing.

           _C_r_e_a_t will fail if one or more of the following are true:

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

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

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

                The path name is null.  [ENOENT]

                The file does not exist and the directory in which the
                file is to be created does not permit writing.
                [EACCES]

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

                The file is a pure procedure (shared text) file that is



      Page 1                                                   (9010-E)






      CCCCRRRREEEEAAAATTTT((((2222))))                    ((((UUUUNNNNIIIIXXXX 5555....0000))))                   CCCCRRRREEEEAAAATTTT((((2222))))



                being executed.  [ETXTBSY]

                The file exists and write permission is denied.
                [EACCES]

                The named file is an existing directory.  [EISDIR]

                Sixty-four (64) file descriptors are currently open.
                [EMFILE]

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

      RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
           Upon successful completion, a non-negative integer, namely
           the file descriptor, is returned.  Otherwise, a value of -1
           is returned and _e_r_r_n_o is set to indicate the error.

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           close(2), dup(2), lseek(2), open(2), read(2), umask(2),
           write(2).


































      Page 2                                                   (9010-E)



