]>
Commit | Line | Data |
---|---|---|
4a929ee1 MK |
1 | .\" Hey Emacs! This file is -*- nroff -*- source. |
2 | .\" | |
3 | .\" This manpage is Copyright (C) 2006, Michael Kerrisk | |
4 | .\" | |
5 | .\" Permission is granted to make and distribute verbatim copies of this | |
6 | .\" manual provided the copyright notice and this permission notice are | |
7 | .\" preserved on all copies. | |
8 | .\" | |
9 | .\" Permission is granted to copy and distribute modified versions of this | |
10 | .\" manual under the conditions for verbatim copying, provided that the | |
11 | .\" entire resulting derived work is distributed under the terms of a | |
12 | .\" permission notice identical to this one. | |
13 | .\" | |
14 | .\" Since the Linux kernel and libraries are constantly changing, this | |
15 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
16 | .\" responsibility for errors or omissions, or for damages resulting from | |
17 | .\" the use of the information contained herein. The author(s) may not | |
18 | .\" have taken the same level of care in the production of this manual, | |
19 | .\" which is licensed free of charge, as they might when working | |
20 | .\" professionally. | |
21 | .\" | |
22 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
23 | .\" the source, must acknowledge the copyright and authors of this work. | |
24 | .\" | |
25 | .\" | |
26 | .TH MKDIRAT 2 2006-04-06 "Linux 2.6.16" "Linux Programmer's Manual" | |
27 | .SH NAME | |
97c0488f | 28 | mkdirat \- create a directory relative to a directory file descriptor |
4a929ee1 MK |
29 | .SH SYNOPSIS |
30 | .nf | |
d44417fb | 31 | .B #define _ATFILE_SOURCE |
4a929ee1 MK |
32 | .B #include <sys/stat.h> |
33 | .sp | |
34 | .BI "int mkdirat(int " dirfd ", const char *" pathname ", mode_t " mode ); | |
35 | .fi | |
36 | .SH DESCRIPTION | |
37 | The | |
38 | .BR mkdirat () | |
39 | system call operates in exactly the same way as | |
40 | .BR mkdir (2), | |
41 | except for the differences described in this manual page. | |
42 | ||
43 | If the pathname given in | |
44 | .I pathname | |
45 | is relative, then it is interpreted relative to the directory | |
46 | referred to by the file descriptor | |
47 | .IR dirfd | |
48 | (rather than relative to the current working directory of | |
49 | the calling process, as is done by | |
50 | .BR mkdir (2) | |
51 | for a relative pathname). | |
52 | ||
1343b604 | 53 | If |
4a929ee1 MK |
54 | .I pathname |
55 | is relative and | |
56 | .I dirfd | |
57 | is the special value | |
58 | .BR AT_FDCWD , | |
7fe3091d MK |
59 | then |
60 | .I pathname | |
61 | is interpreted relative to the current working | |
4a929ee1 MK |
62 | directory of the calling process (like |
63 | .BR mkdir (2)). | |
64 | ||
1343b604 | 65 | If |
4a929ee1 MK |
66 | .IR pathname |
67 | is absolute, then | |
68 | .I dirfd | |
69 | is ignored. | |
70 | .SH "RETURN VALUE" | |
7fe3091d | 71 | On success, |
4a929ee1 MK |
72 | .BR mkdirat () |
73 | returns 0. | |
74 | On error, \-1 is returned and | |
75 | .I errno | |
76 | is set to indicate the error. | |
77 | .SH ERRORS | |
78 | The same errors that occur for | |
79 | .BR mkdir (2) | |
80 | can also occur for | |
81 | .BR mkdirat (). | |
82 | The following additional errors can occur for | |
83 | .BR mkdirat (): | |
84 | .TP | |
85 | .B EBADF | |
86 | .I dirfd | |
87 | is not a valid file descriptor. | |
88 | .TP | |
89 | .B ENOTDIR | |
97c0488f | 90 | .I pathname |
b328773d | 91 | is relative and |
4a929ee1 MK |
92 | .I dirfd |
93 | is a file descriptor referring to a file other than a directory. | |
94 | .SH NOTES | |
95 | See | |
96 | .BR openat (2) | |
97 | for an explanation of the need for | |
98 | .BR mkdirat (). | |
99 | .SH "CONFORMING TO" | |
100 | This system call is non-standard but is proposed | |
101 | for inclusion in a future revision of POSIX.1. | |
102 | .SH VERSIONS | |
103 | .BR mkdirat () | |
104 | was added to Linux in kernel 2.6.16. | |
105 | .SH "SEE ALSO" | |
106 | .BR mkdir (2), | |
107 | .BR openat (2), | |
108 | .BR path_resolution (2) |