1MKNODAT(2)                 Linux Programmer's Manual                MKNODAT(2)
2
3
4

NAME

6       mknodat  -  create  a  special or ordinary file relative to a directory
7       file descriptor
8

SYNOPSIS

10       #define _ATFILE_SOURCE
11       #include <sys/stat.h>
12
13       int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev);
14

DESCRIPTION

16       The mknodat() system call operates in exactly the same way as mknod(2),
17       except for the differences described in this manual page.
18
19       If  the  pathname given in pathname is relative, then it is interpreted
20       relative to the directory referred to  by  the  file  descriptor  dirfd
21       (rather  than  relative to the current working directory of the calling
22       process, as is done by mknod(2) for a relative pathname).
23
24       If pathname is relative and dirfd is the special value  AT_FDCWD,  then
25       pathname  is  interpreted  relative to the current working directory of
26       the calling process (like mknod(2)).
27
28       If pathname is absolute, then dirfd is ignored.
29

RETURN VALUE

31       On success, mknodat() returns 0.  On error, -1 is returned and errno is
32       set to indicate the error.
33

ERRORS

35       The  same  errors that occur for mknod(2) can also occur for mknodat().
36       The following additional errors can occur for mknodat():
37
38       EBADF  dirfd is not a valid file descriptor.
39
40       ENOTDIR
41              pathname is relative and dirfd is a file descriptor referring to
42              a file other than a directory.
43

NOTES

45       See openat(2) for an explanation of the need for mknodat().
46

CONFORMING TO

48       This  system  call  is  non-standard but is proposed for inclusion in a
49       future revision of POSIX.1.
50

VERSIONS

52       mknodat() was added to Linux in kernel 2.6.16.
53

SEE ALSO

55       mknod(2), openat(2), path_resolution(2)
56
57
58
59Linux 2.6.16                      2006-04-06                        MKNODAT(2)
Impressum