Improved english
[unix-history] / usr / src / lib / libc / sys / mknod.2
CommitLineData
ef3c3516
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
b5984ffe 5.\" @(#)mknod.2 6.2 (Berkeley) %G%
ef3c3516 6.\"
ea5a97a6 7.TH MKNOD 2 ""
ef3c3516
KM
8.UC 4
9.SH NAME
caa37210 10mknod \- make a special file
ef3c3516
KM
11.SH SYNOPSIS
12.nf
caa37210
KM
13.ft B
14mknod(path, mode, dev)
15char *path;
16int mode, dev;
17.fi
18.ft R
ef3c3516
KM
19.SH DESCRIPTION
20.I Mknod
21creates a new file
caa37210
KM
22whose name is
23.I path.
ef3c3516 24The mode of the new file
caa37210 25(including special file bits)
ef3c3516
KM
26is initialized from
27.IR mode .
28(The protection part of the mode
29is modified by the process's mode mask; see
30.IR umask (2)).
31The first block pointer of the i-node
32is initialized from
caa37210
KM
33.I dev
34and is used to specify which device the special file
35refers to.
36.PP
37If mode indicates a block or character special file,
38.I dev
39is a configuration dependent specification of a character or block
40I/O device. If
41.I mode
42does not indicate a block special or character special device,
43.I dev
44is ignored.
ef3c3516
KM
45.PP
46.I Mknod
47may be invoked only by the super-user.
caa37210
KM
48.SH "RETURN VALUE
49Upon successful completion a value of 0 is returned.
50Otherwise, a value of \-1 is returned and \fIerrno\fP
51is set to indicate the error.
52.SH ERRORS
53.I Mknod
54will fail and the file mode will be unchanged if:
55.TP 15
b5984ffe
KM
56[ENOTDIR]
57A component of the path prefix is not a directory.
caa37210 58.TP 15
b5984ffe 59[EINVAL]
caa37210
KM
60The pathname contains a character with the high-order bit set.
61.TP 15
b5984ffe
KM
62[ENAMETOOLONG]
63A component of a pathname exceeded 255 characters,
64or an entire path name exceeded 1023 characters.
caa37210
KM
65.TP 15
66[ENOENT]
67A component of the path prefix does not exist.
68.TP 15
b5984ffe
KM
69[EACCES]
70Search permission is denied for a component of the path prefix.
71.TP 15
72[ELOOP]
73Too many symbolic links were encountered in translating the pathname.
74.TP 15
75[EPERM]
76The process's effective user ID is not super-user.
77.TP 15
78[EPERM]
79The pathname contains a character with the high-order bit set.
80.TP 15
81[EIO]
82An I/O error occurred while making the directory entry or allocating the inode.
83.TP 15
caa37210
KM
84[EROFS]
85The named file resides on a read-only file system.
86.TP 15
87[EEXIST]
88The named file exists.
89.TP 15
90[EFAULT]
91.I Path
92points outside the process's allocated address space.
ef3c3516 93.SH "SEE ALSO"
caa37210 94chmod(2), stat(2), umask(2)