From caa372107236a99cd341f991e7a35c967d5b738c Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Thu, 9 May 1985 23:39:58 -0800 Subject: [PATCH] manual page distributed with 4.2BSD SCCS-vsn: lib/libc/sys/mknod.2 5.1 --- usr/src/lib/libc/sys/mknod.2 | 83 +++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 26 deletions(-) diff --git a/usr/src/lib/libc/sys/mknod.2 b/usr/src/lib/libc/sys/mknod.2 index d59da57f71..8812f2f190 100644 --- a/usr/src/lib/libc/sys/mknod.2 +++ b/usr/src/lib/libc/sys/mknod.2 @@ -2,25 +2,27 @@ .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)mknod.2 4.1 (Berkeley) %G% +.\" @(#)mknod.2 5.1 (Berkeley) %G% .\" -.TH MKNOD 2 +.TH MKNOD 2 "2 July 1983" .UC 4 .SH NAME -mknod \- make a directory or a special file +mknod \- make a special file .SH SYNOPSIS .nf -.B mknod(name, mode, addr) -.B char *name; -.nf +.ft B +mknod(path, mode, dev) +char *path; +int mode, dev; +.fi +.ft R .SH DESCRIPTION .I Mknod creates a new file -whose name is the null-terminated string pointed -to by -.IR name . +whose name is +.I path. The mode of the new file -(including directory and special file bits) +(including special file bits) is initialized from .IR mode . (The protection part of the mode @@ -28,23 +30,52 @@ is modified by the process's mode mask; see .IR umask (2)). The first block pointer of the i-node is initialized from -.IR addr . -For ordinary files and directories -.I addr -is normally zero. -In the case of a special file, -.I addr -specifies which special file. +.I dev +and is used to specify which device the special file +refers to. +.PP +If mode indicates a block or character special file, +.I dev +is a configuration dependent specification of a character or block +I/O device. If +.I mode +does not indicate a block special or character special device, +.I dev +is ignored. .PP .I Mknod may be invoked only by the super-user. +.SH "RETURN VALUE +Upon successful completion a value of 0 is returned. +Otherwise, a value of \-1 is returned and \fIerrno\fP +is set to indicate the error. +.SH ERRORS +.I Mknod +will fail and the file mode will be unchanged if: +.TP 15 +[EPERM] +The process's effective user ID is not super-user. +.TP 15 +[EPERM] +The pathname contains a character with the high-order bit set. +.TP 15 +[ENOTDIR] +A component of the path prefix is not a directory. +.TP 15 +[ENOENT] +A component of the path prefix does not exist. +.TP 15 +[EROFS] +The named file resides on a read-only file system. +.TP 15 +[EEXIST] +The named file exists. +.TP 15 +[EFAULT] +.I Path +points outside the process's allocated address space. +.TP 15 +[ELOOP] +Too many symbolic links were encountered in translating the pathname. .SH "SEE ALSO" -mkdir(1), mknod(1), filsys(5) -.SH DIAGNOSTICS -Zero is returned if the file has been made; \-1 -if the file already exists -or if the user is not the super-user. -.SH "ASSEMBLER (PDP-11)" -(mknod = 14.) -.br -.B sys mknod; name; mode; addr +chmod(2), stat(2), umask(2) -- 2.20.1