.\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
.\"
-.TH SYMLINK 2 2016-10-08 "Linux" "Linux Programmer's Manual"
+.TH SYMLINK 2 2017-09-15 "Linux" "Linux Programmer's Manual"
.SH NAME
symlink, symlinkat \- make a new name for a file
.SH SYNOPSIS
.nf
.B #include <unistd.h>
-.sp
+.PP
.BI "int symlink(const char *" target ", const char *" linkpath );
-.sp
+
.BR "#include <fcntl.h> " "/* Definition of AT_* constants */"
.B #include <unistd.h>
-.sp
+.PP
.BI "int symlinkat(const char *" target ", int " newdirfd \
", const char *" linkpath );
-.sp
+.PP
.fi
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
-.sp
+.PP
.ad l
.BR symlink ():
.RS 4
.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
|| /* Glibc versions <= 2.19: */ _BSD_SOURCE
.RE
-.sp
+.PP
.BR symlinkat ():
.PD 0
.ad l
.I linkpath
which contains the string
.IR target .
-
+.PP
Symbolic links are interpreted at run time as if the contents of the
link had been substituted into the path being followed to find a file or
directory.
-
+.PP
Symbolic links may contain
.I ..
path components, which (if used at the start of the link) refer to the
parent directories of that in which the link resides.
-
+.PP
A symbolic link (also known as a soft link) may point to an existing
file or to a nonexistent one; the latter case is known as a dangling
link.
-
+.PP
The permissions of a symbolic link are irrelevant; the ownership is
ignored when following the link, but is checked when removal or
renaming of the link is requested and the link is in a directory with
the sticky bit
.RB ( S_ISVTX )
set.
-
+.PP
If
.I linkpath
exists, it will
system call operates in exactly the same way as
.BR symlink (),
except for the differences described here.
-
+.PP
If the pathname given in
.I linkpath
is relative, then it is interpreted relative to the directory
the calling process, as is done by
.BR symlink ()
for a relative pathname).
-
+.PP
If
.I linkpath
is relative and
is interpreted relative to the current working
directory of the calling process (like
.BR symlink ()).
-
+.PP
If
.I linkpath
is absolute, then
.\" See
.\" .BR open (2)
.\" re multiple files with the same name, and NFS.
-
+.PP
.BR symlinkat ():
POSIX.1-2008.
.SH NOTES
No checking of
.I target
is done.
-
+.PP
Deleting the name referred to by a symbolic link will actually delete the
file (unless it also has other hard links).
If this behavior is not desired, use
argument.
.SH SEE ALSO
.BR ln (1),
+.BR namei (1),
.BR lchown (2),
.BR link (2),
.BR lstat (2),