1 .\" Copyright (C) 2003 John Levon <levon@movementarian.org>
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" Modified 2004-06-17 Michael Kerrisk <mtk.manpages@gmail.com>
7 .TH LOOKUP_DCOOKIE 2 2022-09-09 "Linux man-pages (unreleased)"
9 lookup_dcookie \- return a directory entry's path
12 .RI ( libc ", " \-lc )
15 .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
16 .B #include <unistd.h>
18 .BI "int syscall(SYS_lookup_dcookie, uint64_t " cookie ", char *" buffer ,
23 glibc provides no wrapper for
24 .BR lookup_dcookie (),
25 necessitating the use of
28 Look up the full path of the directory entry specified by the value
30 The cookie is an opaque identifier uniquely identifying a particular
32 The buffer given is filled in with the full path of the directory entry.
36 to return successfully,
37 the kernel must still hold a cookie reference to the directory entry.
41 returns the length of the path string copied into the buffer.
42 On error, \-1 is returned, and
44 is set to indicate the error.
48 The buffer was not valid.
51 The kernel has no registered cookie/directory entry mappings at the
52 time of lookup, or the cookie does not refer to a valid directory entry.
55 The name could not fit in the buffer.
58 The kernel could not allocate memory for the temporary buffer holding
62 The process does not have the capability
64 required to look up cookie values.
67 The buffer was not large enough to hold the path of the directory entry.
69 Available since Linux 2.5.43.
72 error return was added in 2.5.70.
78 is a special-purpose system call, currently used only by the
81 It relies on a kernel driver to register cookies for directory entries.
83 The path returned may be suffixed by the string " (deleted)" if the directory
84 entry has been removed.