Node:Making Special Files, Next:Temporary Files, Previous:File Attributes, Up:File System Interface
The 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
.
int mknod (const char *filename, int mode, int dev) | Function |
The mknod function 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 Testing File Type.
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
|