Commit | Line | Data |
---|---|---|
88b3ccf2 KB |
1 | .\" Copyright (c) 1983 The Regents of the University of California. |
2 | .\" All rights reserved. | |
9c8e3df4 | 3 | .\" |
88b3ccf2 KB |
4 | .\" Redistribution and use in source and binary forms are permitted |
5 | .\" provided that the above copyright notice and this paragraph are | |
6 | .\" duplicated in all such forms and that any documentation, | |
7 | .\" advertising materials, and other materials related to such | |
8 | .\" distribution and use acknowledge that the software was developed | |
9 | .\" by the University of California, Berkeley. The name of the | |
10 | .\" University may not be used to endorse or promote products derived | |
11 | .\" from this software without specific prior written permission. | |
12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
14 | .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
15 | .\" | |
16 | .\" @(#)mkdir.2 6.5 (Berkeley) %G% | |
9c8e3df4 | 17 | .\" |
f5db7458 | 18 | .TH MKDIR 2 "" |
9c8e3df4 KM |
19 | .UC 5 |
20 | .SH NAME | |
21 | mkdir \- make a directory file | |
22 | .SH SYNOPSIS | |
23 | .nf | |
24 | .ft B | |
25 | mkdir(path, mode) | |
26 | char *path; | |
27 | int mode; | |
28 | .fi | |
29 | .ft R | |
30 | .SH DESCRIPTION | |
31 | .I Mkdir | |
32 | creates a new directory file with name | |
33 | .IR path . | |
34 | The mode of the new file | |
35 | is initialized from | |
36 | .IR mode . | |
37 | (The protection part of the mode | |
38 | is modified by the process's mode mask; see | |
39 | .IR umask (2)). | |
40 | .PP | |
41 | The directory's owner ID is set to the process's effective user ID. | |
42 | The directory's group ID is set to that of the parent directory in | |
43 | which it is created. | |
44 | .PP | |
45 | The low-order 9 bits of mode are modified by the process's | |
46 | file mode creation mask: all bits set in the process's file mode | |
47 | creation mask are cleared. See | |
48 | .IR umask (2). | |
49 | .SH "RETURN VALUE | |
50 | A 0 return value indicates success. A \-1 return value | |
51 | indicates an error, and an error code is stored in | |
52 | .I errno. | |
53 | .SH "ERRORS | |
54 | .I Mkdir | |
55 | will fail and no directory will be created if: | |
56 | .TP 15 | |
9c8e3df4 KM |
57 | [ENOTDIR] |
58 | A component of the path prefix is not a directory. | |
59 | .TP 15 | |
b5984ffe KM |
60 | [EINVAL] |
61 | The pathname contains a character with the high-order bit set. | |
62 | .TP 15 | |
63 | [ENAMETOOLONG] | |
64 | A component of a pathname exceeded 255 characters, | |
65 | or an entire path name exceeded 1023 characters. | |
66 | .TP 15 | |
9c8e3df4 KM |
67 | [ENOENT] |
68 | A component of the path prefix does not exist. | |
69 | .TP 15 | |
b5984ffe KM |
70 | [EACCES] |
71 | Search permission is denied for a component of the path prefix. | |
72 | .TP 15 | |
73 | [ELOOP] | |
74 | Too many symbolic links were encountered in translating the pathname. | |
75 | .TP 15 | |
76 | [EPERM] | |
b5984ffe KM |
77 | The \fIpath\fP argument contains a byte with the high-order bit set. |
78 | .TP 15 | |
9c8e3df4 KM |
79 | [EROFS] |
80 | The named file resides on a read-only file system. | |
81 | .TP 15 | |
82 | [EEXIST] | |
83 | The named file exists. | |
84 | .TP 15 | |
fd690c8b KM |
85 | [ENOSPC] |
86 | The directory in which the entry for the new directory is being placed | |
87 | cannot be extended because there is no space left on the file | |
88 | system containing the directory. | |
89 | .TP 15 | |
90 | [ENOSPC] | |
91 | The new directory cannot be created because there | |
92 | there is no space left on the file | |
93 | system that will contain the directory. | |
94 | .TP 15 | |
95 | [ENOSPC] | |
96 | There are no free inodes on the file system on which the | |
97 | directory is being created. | |
98 | .TP 15 | |
99 | [EDQUOT] | |
100 | The directory in which the entry for the new directory | |
101 | is being placed cannot be extended because the | |
102 | user's quota of disk blocks on the file system | |
103 | containing the directory has been exhausted. | |
104 | .TP 15 | |
105 | [EDQUOT] | |
106 | The new directory cannot be created because the user's | |
107 | quota of disk blocks on the file system that will | |
108 | contain the directory has been exhausted. | |
109 | .TP 15 | |
110 | [EDQUOT] | |
111 | The user's quota of inodes on the file system on | |
112 | which the directory is being created has been exhausted. | |
113 | .TP 15 | |
b5984ffe KM |
114 | [EIO] |
115 | An I/O error occurred while making the directory entry or allocating the inode. | |
116 | .TP 15 | |
fd690c8b KM |
117 | [EIO] |
118 | An I/O error occurred while reading from or writing to the file system. | |
119 | .TP 15 | |
9c8e3df4 KM |
120 | [EFAULT] |
121 | .I Path | |
122 | points outside the process's allocated address space. | |
9c8e3df4 KM |
123 | .SH "SEE ALSO" |
124 | chmod(2), stat(2), umask(2) |