Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mknod(2) — Ultrix-11 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mkdir(1)

mknod(1)

filsys(5)

MKNOD(2)

NAME

mknod − make a directory or a special file

SYNOPSIS

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

DESCRIPTION

Mknod creates a new file whose name is the null-terminated string pointed to by name. The mode of the new file (including directory and special file bits) is initialized from mode. (The protection part of the mode is modified by the process’s mode mask; see umask(2)). The first block pointer of the i-node is initialized from addr. For ordinary files and directories addr is normally zero.  In the case of a special file, addr specifies which special file. 

Mknod may be invoked only by the superuser. 

RETURN VALUE

Upon successful completion, a value of 0 is returned.  Otherwise, a value of -1 is returned and errno is set to indicate the error. 

DIAGNOSTICS

Mknod will fail and the file mode will be unchanged if:

[EACCES] Access to a directory file denied. 

[EACCES] A component of the path prefix denies search permission. 

[EEXIST] The named file exists. 

[EFAULT] Name points outside the process’s allocated address space. 

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

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

[ENOSPC] No i-nodes are available on the device. 

[EPERM] The effective user ID does not match the owner of the file and the effective user ID is not the superuser. 

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

SEE ALSO

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

ASSEMBLER

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

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026