manual page distributed with 4.2BSD
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 10 May 1985 07:39:58 +0000 (23:39 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 10 May 1985 07:39:58 +0000 (23:39 -0800)
SCCS-vsn: lib/libc/sys/mknod.2 5.1

usr/src/lib/libc/sys/mknod.2

index d59da57..8812f2f 100644 (file)
@@ -2,25 +2,27 @@
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
 .\" 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
 .UC 4
 .SH NAME
-mknod \- make a directory or a special file
+mknod \- make a special file
 .SH SYNOPSIS
 .nf
 .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
 .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
 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
 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 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.
 .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"
 .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)