mknod function is the primitive for making special files,
such as files that correspond to devices. The GNU library includes
this function for compatibility with BSD.
The prototype for
mknod is declared in `sys/stat.h'.
mknodfunction makes a special file with name filename. The mode specifies the mode of the file, and may include the various special file bits, such as
S_IFCHR(for a character special file) or
S_IFBLK(for a block special file). See section Testing the Type of a File.
The dev argument specifies which device the special file refers to. Its exact interpretation depends on the kind of special file being created.
The return value is
0 on success and
-1 on error. In addition
to the usual file name errors (see section File Name Errors), the
errno error conditions are defined for this function:
Go to the first, previous, next, last section, table of contents.