1MKNODAT(2) Linux Programmer's Manual MKNODAT(2)
2
3
4
6 mknodat - create a special or ordinary file relative to a directory
7 file descriptor
8
10 #include <fcntl.h> /* Definition of AT_* constants */
11 #include <sys/stat.h>
12
13 int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev);
14
15 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
16
17 mknodat():
18 Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L
19 Before glibc 2.10: _ATFILE_SOURCE
20
22 The mknodat() system call operates in exactly the same way as mknod(2),
23 except for the differences described in this manual page.
24
25 If the pathname given in pathname is relative, then it is interpreted
26 relative to the directory referred to by the file descriptor dirfd
27 (rather than relative to the current working directory of the calling
28 process, as is done by mknod(2) for a relative pathname).
29
30 If pathname is relative and dirfd is the special value AT_FDCWD, then
31 pathname is interpreted relative to the current working directory of
32 the calling process (like mknod(2)).
33
34 If pathname is absolute, then dirfd is ignored.
35
37 On success, mknodat() returns 0. On error, -1 is returned and errno is
38 set to indicate the error.
39
41 The same errors that occur for mknod(2) can also occur for mknodat().
42 The following additional errors can occur for mknodat():
43
44 EBADF dirfd is not a valid file descriptor.
45
46 ENOTDIR
47 pathname is relative and dirfd is a file descriptor referring to
48 a file other than a directory.
49
51 mknodat() was added to Linux in kernel 2.6.16.
52
54 POSIX.1-2008.
55
57 See openat(2) for an explanation of the need for mknodat().
58
60 mknod(2), openat(2), path_resolution(7)
61
63 This page is part of release 3.25 of the Linux man-pages project. A
64 description of the project, and information about reporting bugs, can
65 be found at http://www.kernel.org/doc/man-pages/.
66
67
68
69Linux 2009-12-13 MKNODAT(2)