Merge branch 'vendor/LIBPCAP' and updated build for new version.
[dragonfly.git] / lib / libc / sys / mkdir.2
1 .\" Copyright (c) 1983, 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 .\"     @(#)mkdir.2     8.2 (Berkeley) 12/11/93
33 .\" $FreeBSD: src/lib/libc/sys/mkdir.2,v 1.9.2.6 2001/12/14 18:34:01 ru Exp $
34 .\" $DragonFly: src/lib/libc/sys/mkdir.2,v 1.2 2003/06/17 04:26:47 dillon Exp $
35 .\"
36 .Dd December 11, 1993
37 .Dt MKDIR 2
38 .Os
39 .Sh NAME
40 .Nm mkdir
41 .Nd make a directory file
42 .Sh LIBRARY
43 .Lb libc
44 .Sh SYNOPSIS
45 .In sys/types.h
46 .In sys/stat.h
47 .Ft int
48 .Fn mkdir "const char *path" "mode_t mode"
49 .Sh DESCRIPTION
50 The directory
51 .Fa path
52 is created with the access permissions specified by
53 .Fa mode
54 and restricted by the
55 .Xr umask 2
56 of the calling process.
57 .Pp
58 The directory's owner ID is set to the process's effective user ID.
59 The directory's group ID is set to that of the parent directory in
60 which it is created.
61 .Sh RETURN VALUES
62 .Rv -std mkdir
63 .Sh ERRORS
64 .Fn Mkdir
65 will fail and no directory will be created if:
66 .Bl -tag -width Er
67 .It Bq Er ENOTDIR
68 A component of the path prefix is not a directory.
69 .It Bq Er ENAMETOOLONG
70 A component of a pathname exceeded 255 characters,
71 or an entire path name exceeded 1023 characters.
72 .It Bq Er ENOENT
73 A component of the path prefix does not exist.
74 .It Bq Er EACCES
75 Search permission is denied for a component of the path prefix,
76 or write permission is denied
77 on the parent directory of the directory to be created.
78 .It Bq Er ELOOP
79 Too many symbolic links were encountered in translating the pathname.
80 .It Bq Er EROFS
81 The named file resides on a read-only file system.
82 .It Bq Er EEXIST
83 The named file exists.
84 .It Bq Er ENOSPC
85 The new directory cannot be created because there is no space left
86 on the file system that will contain the directory.
87 .It Bq Er ENOSPC
88 There are no free inodes on the file system on which the
89 directory is being created.
90 .It Bq Er EDQUOT
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.
94 .It Bq Er EDQUOT
95 The user's quota of inodes on the file system on
96 which the directory is being created has been exhausted.
97 .It Bq Er EIO
98 An I/O error occurred while making the directory entry or allocating the inode.
99 .It Bq Er EIO
100 An I/O error occurred while reading from or writing to the file system.
101 .It Bq Er EFAULT
102 .Fa Path
103 points outside the process's allocated address space.
104 .El
105 .Sh SEE ALSO
106 .Xr chmod 2 ,
107 .Xr stat 2 ,
108 .Xr umask 2
109 .Sh STANDARDS
110 The
111 .Fn mkdir
112 function call is expected to conform to
113 .St -p1003.1-90 .