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.
5 .\" @(#)mkdir.2 6.4 (Berkeley) 8/26/85
7 .TH MKDIR 2 "August 26, 1985"
10 mkdir \- make a directory file
14 #include <sys/types.h>
17 int mkdir(const char *\fIpath\fP, mode_t \fImode\fP)
22 creates a new directory file with name
24 The mode of the new file
27 (The protection part of the mode
28 is modified by the process's mode mask; see
31 The directory's owner ID is set to the process's effective user ID.
32 The directory's group ID is set to that of the parent directory in
35 The low-order 9 bits of mode are modified by the process's
36 file mode creation mask: all bits set in the process's file mode
37 creation mask are cleared. See
40 A 0 return value indicates success. A \-1 return value
41 indicates an error, and an error code is stored in
45 will fail and no directory will be created if:
48 A component of the path prefix is not a directory.
51 The path name exceeds PATH_MAX characters.
54 A component of the path prefix does not exist.
57 Search permission is denied for a component of the path prefix.
60 Too many symbolic links were encountered in translating the pathname.
64 The named file resides on a read-only file system.
67 The named file exists.
70 The directory in which the entry for the new directory is being placed
71 cannot be extended because there is no space left on the file
72 system containing the directory.
75 The new directory cannot be created because there
76 there is no space left on the file
77 system that will contain the directory.
80 There are no free inodes on the file system on which the
81 directory is being created.
85 The directory in which the entry for the new directory
86 is being placed cannot be extended because the
87 user's quota of disk blocks on the file system
88 containing the directory has been exhausted.
91 The new directory cannot be created because the user's
92 quota of disk blocks on the file system that will
93 contain the directory has been exhausted.
96 The user's quota of inodes on the file system on
97 which the directory is being created has been exhausted.
101 An I/O error occurred while making the directory entry or allocating the inode.
104 An I/O error occurred while reading from or writing to the file system.
108 points outside the process's allocated address space.