1LOOKUP_DCOOKIE(2)          Linux Programmer's Manual         LOOKUP_DCOOKIE(2)
2
3
4

NAME

6       lookup_dcookie - return a directory entry's path
7

SYNOPSIS

9       #include <sys/syscall.h>      /* Definition of SYS_* constants */
10       #include <unistd.h>
11
12       int syscall(SYS_lookup_dcookie, uint64_t cookie, char *buffer,
13                   size_t len);
14
15       Note: glibc provides no wrapper for lookup_dcookie(), necessitating the
16       use of syscall(2).
17

DESCRIPTION

19       Look up the full path of the directory entry  specified  by  the  value
20       cookie.  The cookie is an opaque identifier uniquely identifying a par‐
21       ticular directory entry.  The buffer given is filled in with  the  full
22       path of the directory entry.
23
24       For lookup_dcookie() to return successfully, the kernel must still hold
25       a cookie reference to the directory entry.
26

RETURN VALUE

28       On success, lookup_dcookie() returns the  length  of  the  path  string
29       copied  into the buffer.  On error, -1 is returned, and errno is set to
30       indicate the error.
31

ERRORS

33       EFAULT The buffer was not valid.
34
35       EINVAL The kernel has no registered cookie/directory entry mappings  at
36              the  time of lookup, or the cookie does not refer to a valid di‐
37              rectory entry.
38
39       ENAMETOOLONG
40              The name could not fit in the buffer.
41
42       ENOMEM The kernel could not allocate memory for  the  temporary  buffer
43              holding the path.
44
45       EPERM  The  process does not have the capability CAP_SYS_ADMIN required
46              to look up cookie values.
47
48       ERANGE The buffer was not large enough to hold the path of  the  direc‐
49              tory entry.
50

VERSIONS

52       Available  since Linux 2.5.43.  The ENAMETOOLONG error return was added
53       in 2.5.70.
54

CONFORMING TO

56       lookup_dcookie() is Linux-specific.
57

NOTES

59       lookup_dcookie() is a special-purpose system call, currently used  only
60       by  the oprofile(1) profiler.  It relies on a kernel driver to register
61       cookies for directory entries.
62
63       The path returned may be suffixed by the string " (deleted)" if the di‐
64       rectory entry has been removed.
65

SEE ALSO

67       oprofile(1)
68

COLOPHON

70       This  page  is  part of release 5.13 of the Linux man-pages project.  A
71       description of the project, information about reporting bugs,  and  the
72       latest     version     of     this    page,    can    be    found    at
73       https://www.kernel.org/doc/man-pages/.
74
75
76
77Linux                             2021-03-22                 LOOKUP_DCOOKIE(2)
Impressum