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