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

NAME

6       symlinkat  -  create  a  symbolic  link  relative  to  a directory file
7       descriptor
8

SYNOPSIS

10       #include <fcntl.h> /* Definition of AT_* constants */
11       #include <stdio.h>
12
13       int symlinkat(const char *oldpath, int newdirfd, const char *newpath);
14
15   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
16
17       symlinkat():
18       Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L
19       Before glibc 2.10: _ATFILE_SOURCE
20

DESCRIPTION

22       The symlinkat() system call operates in exactly the same  way  as  sym‐
23       link(2), except for the differences described in this manual page.
24
25       If  the  pathname  given in newpath is relative, then it is interpreted
26       relative to the directory referred to by the file  descriptor  newdirfd
27       (rather  than  relative to the current working directory of the calling
28       process, as is done by symlink(2) for a relative pathname).
29
30       If newpath is relative and newdirfd is the special value AT_FDCWD, then
31       newpath is interpreted relative to the current working directory of the
32       calling process (like symlink(2)).
33
34       If newpath is absolute, then newdirfd is ignored.
35

RETURN VALUE

37       On success, symlinkat() returns 0.  On error, -1 is returned and  errno
38       is set to indicate the error.
39

ERRORS

41       The  same  errors  that  occur  for  symlink(2) can also occur for sym‐
42       linkat().  The following additional errors can occur for symlinkat():
43
44       EBADF  newdirfd is not a valid file descriptor.
45
46       ENOTDIR
47              newpath is relative and newdirfd is a file descriptor  referring
48              to a file other than a directory.
49

VERSIONS

51       symlinkat() was added to Linux in kernel 2.6.16.
52

CONFORMING TO

54       POSIX.1-2008.
55

NOTES

57       See openat(2) for an explanation of the need for symlinkat().
58

SEE ALSO

60       openat(2), symlink(2), path_resolution(7), symlink(7)
61

COLOPHON

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                      SYMLINKAT(2)
Impressum