Go to the previous, next section.
int mknod(const char *path, mode_t mode, dev_t
dev);
path: [in] points to the path of the new file.
mode: [in] specifies the kind of special file to create. (Do not use it to specify the access bits of the file.)
dev: [in] the major and minor numbers of the new device.
Creates a special device file node. Only tasks with superuser privileges may
use this call. The access bits of the new file are the same as those of the
umask of the current task. If mode does not specify a
special device file, then dev is ignored.
On success zero is returned. On error, -1 is returned and errno
is set to one of the following values:
EINVAL: the path contains a caracter that is outside the
range [0,127].
EPERM: the calling process does not have superuser
privileges.
ENOTDIR, ENAMETOOLONG, ENOENT,
EACCESS, ELOOP, EIO,
ENOSPC, EDQUOT, EROFS,
EEXIST and EFAULT.