2.9BSD/usr/man/cat2/mknod.2

Compare this file to the similar file:
Show the results in this format:


MKNOD(2)            UNIX Programmer's Manual             MKNOD(2)

NAME
     mknod - make a directory or a special file

SYNOPSIS
     mknod(name, mode, addr)
     char *name;

DESCRIPTION
     _M_k_n_o_d creates a new file whose name is the null-terminated
     string pointed to by _n_a_m_e.  The mode of the new file
     (including directory and special file bits) is initialized
     from _m_o_d_e.  (The protection part of the mode is modified by
     the process's mode mask; see _u_m_a_s_k(2)).  The first block
     pointer of the i-node is initialized from _a_d_d_r.  For ordi-
     nary files and directories _a_d_d_r is normally zero.  In the
     case of a special file, _a_d_d_r specifies which special file.

     _M_k_n_o_d may be invoked only by the super-user.

RETURN VALUE
     Upon successful completion, a value of 0 is returned.  Oth-
     erwise, a value of -1 is returned and _e_r_r_n_o is set to indi-
     cate the error.

ERRORS
     _M_k_n_o_d will fail and the file mode will be unchanged if:

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

     [EINVAL]            The path name contains a non-ASCII byte.

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

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

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

     [EEXIST]            The named file exists.

     [EFAULT]            _N_a_m_e points outside the process's allo-
                         cated address space.

     [ELOOP]             Too many symbolic links were encountered
                         in translating the path name.

SEE ALSO
     mkdir(1), mknod(1), filsys(5)

Printed 5/23/83                                                 1

MKNOD(2)            UNIX Programmer's Manual             MKNOD(2)

ASSEMBLER
     (mknod = 14.)
     sys mknod; name; mode; addr

Printed 5/23/83                                                 2