1lookup_dcookie(2)             System Calls Manual            lookup_dcookie(2)
2
3
4

NAME

6       lookup_dcookie - return a directory entry's path
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

STANDARDS

55       Linux.
56

HISTORY

58       Linux 2.5.43.
59
60       The ENAMETOOLONG error was added in Linux 2.5.70.
61

NOTES

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

SEE ALSO

71       oprofile(1)
72
73
74
75Linux man-pages 6.04              2023-03-30                 lookup_dcookie(2)
Impressum