From 4ec5bffac93eca569b56b5a1950d3ffb60c78371 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Fri, 2 May 2014 10:10:07 +0200 Subject: [PATCH] link.2: Tweaks to Andy Lutomirski's patch Signed-off-by: Michael Kerrisk --- man2/link.2 | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/man2/link.2 b/man2/link.2 index 8af6ec646..063ff1f4c 100644 --- a/man2/link.2 +++ b/man2/link.2 @@ -135,8 +135,8 @@ is an empty string, create a link to the file referenced by flag). In this case, .I olddirfd -can refer to any type of file, not just a directory. This will -generally not work if the file has a link count of zero (files +can refer to any type of file, not just a directory. +This will generally not work if the file has a link count of zero (files created with .BR O_TMPFILE and without @@ -167,14 +167,16 @@ to cause .I oldpath to be dereferenced if it is a symbolic link. If procfs is mounted, -this can be used as an alternative to AT_EMPTY_PATH, even by -unprivileged processes on Linux versions before 3.11, like this: -.RS -.PP -.EX -linkat(AT_FDCWD, "/proc/self/fd/", newdirfd, newname, AT_SYMLINK_FOLLOW); -.EE -.RE +this can be used as an alternative to +.BR AT_EMPTY_PATH , +even by unprivileged processes on Linux versions before 3.11, like this: + +.nf +.in +4n +linkat(AT_FDCWD, "/proc/self/fd/", newdirfd, + newname, AT_SYMLINK_FOLLOW); +.in +.fi .PP Before kernel 2.6.18, the .I flags