]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/sys/mknod.2
This commit was generated by cvs2svn to compensate for changes in r161751,
[FreeBSD/FreeBSD.git] / lib / libc / sys / mknod.2
1 .\" Copyright (c) 1980, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)mknod.2     8.1 (Berkeley) 6/4/93
33 .\" $FreeBSD$
34 .\"
35 .Dd June 4, 1993
36 .Dt MKNOD 2
37 .Os
38 .Sh NAME
39 .Nm mknod
40 .Nd make a special file node
41 .Sh LIBRARY
42 .Lb libc
43 .Sh SYNOPSIS
44 .In unistd.h
45 .Ft int
46 .Fn mknod "const char *path" "mode_t mode" "dev_t dev"
47 .Sh DESCRIPTION
48 The file system node
49 .Fa path
50 is created with the file type and access permissions specified in
51 .Fa mode .
52 The access permissions are modified by the process's umask value.
53 .Pp
54 If
55 .Fa mode
56 indicates a block or character special file,
57 .Fa dev
58 is a configuration dependent specification denoting a particular device
59 on the system.
60 Otherwise,
61 .Fa dev
62 is ignored.
63 .Pp
64 The
65 .Fn mknod
66 system call
67 requires super-user privileges.
68 .Sh RETURN VALUES
69 .Rv -std mknod
70 .Sh ERRORS
71 The
72 .Fn mknod
73 system call
74 will fail and the file will be not created if:
75 .Bl -tag -width Er
76 .It Bq Er ENOTDIR
77 A component of the path prefix is not a directory.
78 .It Bq Er ENAMETOOLONG
79 A component of a pathname exceeded 255 characters,
80 or an entire path name exceeded 1023 characters.
81 .It Bq Er ENOENT
82 A component of the path prefix does not exist.
83 .It Bq Er EACCES
84 Search permission is denied for a component of the path prefix.
85 .It Bq Er ELOOP
86 Too many symbolic links were encountered in translating the pathname.
87 .It Bq Er EPERM
88 The process's effective user ID is not super-user.
89 .It Bq Er EIO
90 An I/O error occurred while making the directory entry or allocating the inode.
91 .It Bq Er ENOSPC
92 The directory in which the entry for the new node is being placed
93 cannot be extended because there is no space left on the file
94 system containing the directory.
95 .It Bq Er ENOSPC
96 There are no free inodes on the file system on which the
97 node is being created.
98 .It Bq Er EDQUOT
99 The directory in which the entry for the new node
100 is being placed cannot be extended because the
101 user's quota of disk blocks on the file system
102 containing the directory has been exhausted.
103 .It Bq Er EDQUOT
104 The user's quota of inodes on the file system on
105 which the node is being created has been exhausted.
106 .It Bq Er EROFS
107 The named file resides on a read-only file system.
108 .It Bq Er EEXIST
109 The named file exists.
110 .It Bq Er EFAULT
111 The
112 .Fa path
113 argument
114 points outside the process's allocated address space.
115 .It Bq Er EINVAL
116 Creating anything else than a block or character special
117 file (or a
118 .Em whiteout )
119 is not supported.
120 .El
121 .Sh SEE ALSO
122 .Xr chmod 2 ,
123 .Xr mkfifo 2 ,
124 .Xr stat 2 ,
125 .Xr umask 2
126 .Sh HISTORY
127 The
128 .Fn mknod
129 function appeared in
130 .At v6 .