summaryrefslogtreecommitdiffstats
path: root/man2/open.2
diff options
context:
space:
mode:
Diffstat (limited to 'man2/open.2')
-rw-r--r--man2/open.28
1 files changed, 4 insertions, 4 deletions
diff --git a/man2/open.2 b/man2/open.2
index b5aff887c..f79330a17 100644
--- a/man2/open.2
+++ b/man2/open.2
@@ -803,16 +803,16 @@ permanent, using code like the following:
char path[PATH_MAX];
fd = open("/path/to/dir", O_TMPFILE | O_RDWR,
S_IRUSR | S_IWUSR);
-
+\&
/* File I/O on \[aq]fd\[aq]... */
-
+\&
linkat(fd, "", AT_FDCWD, "/path/for/file", AT_EMPTY_PATH);
-
+\&
/* If the caller doesn\[aq]t have the CAP_DAC_READ_SEARCH
capability (needed to use AT_EMPTY_PATH with linkat(2)),
and there is a proc(5) filesystem mounted, then the
linkat(2) call above can be replaced with:
-
+\&
snprintf(path, PATH_MAX, "/proc/self/fd/%d", fd);
linkat(AT_FDCWD, path, AT_FDCWD, "/path/for/file",
AT_SYMLINK_FOLLOW);