]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/symlinkat.2
Make naming of 'pathname' argument consistent; various minor rewordings.
[thirdparty/man-pages.git] / man2 / symlinkat.2
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 SYMLINKAT 2 2006-04-10 "Linux 2.6.16" "Linux Programmer's Manual"
27 .SH NAME
28 symlinkat \- create a symbolic link relative to a directory file descriptor
29 .SH SYNOPSIS
30 .nf
31 .B #include <stdio.h>
32 .sp
33 .BI "int symlinkat(const char *" oldpath ", int " newdirfd \
34 ", const char *" newpath );
35 .fi
36 .SH DESCRIPTION
37 The
38 .BR symlinkat ()
39 system call operates in exactly the same way as
40 .BR symlink (2),
41 except for the differences described in this manual page.
42
43 If the pathname given in
44 .I newpath
45 is relative, then it is interpreted relative to the directory
46 referred to by the file descriptor
47 .IR newdirfd
48 (rather than relative to the current working directory of
49 the calling process, as is done by
50 .BR symlink (2)
51 for a relative pathname).
52
53 If
54 .I newpath
55 is relative and
56 .I newdirfd
57 is the special value
58 .BR AT_FDCWD ,
59 then
60 .I newpath
61 is interpreted relative to the current working
62 directory of the calling process (like
63 .BR symlink (2)).
64
65 If
66 .IR newpath
67 is absolute, then
68 .I newdirfd
69 is ignored.
70 .SH "RETURN VALUE"
71 On success,
72 .BR symlinkat ()
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 symlink (2)
80 can also occur for
81 .BR symlinkat ().
82 The following additional errors can occur for
83 .BR symlinkat ():
84 .TP
85 .B EBADF
86 .I newdirfd
87 is not a valid file descriptor.
88 .TP
89 .B ENOTDIR
90 .I newpath
91 is relative and
92 .I newdirfd
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 symlinkat ().
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 symlinkat ()
104 was added to Linux in kernel 2.6.16.
105 .SH "SEE ALSO"
106 .BR openat (2),
107 .BR path_resolution (2),
108 .BR symlink (2)