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