]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (C) 2003 John Levon <levon@movementarian.org> |
2 | .\" | |
5fbde956 | 3 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da | 4 | .\" |
c11b1abf | 5 | .\" Modified 2004-06-17 Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da | 6 | .\" |
4c1c5274 | 7 | .TH lookup_dcookie 2 (date) "Linux man-pages (unreleased)" |
fea681da MK |
8 | .SH NAME |
9 | lookup_dcookie \- return a directory entry's path | |
52633c69 AC |
10 | .SH LIBRARY |
11 | Standard C library | |
8fc3b2cf | 12 | .RI ( libc ", " \-lc ) |
fea681da | 13 | .SH SYNOPSIS |
c7db92b9 | 14 | .nf |
3977e9ff AC |
15 | .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */" |
16 | .B #include <unistd.h> | |
17 | .PP | |
18 | .BI "int syscall(SYS_lookup_dcookie, uint64_t " cookie ", char *" buffer , | |
19 | .BI " size_t " len ); | |
c7db92b9 | 20 | .fi |
fa646e18 AC |
21 | .PP |
22 | .IR Note : | |
3977e9ff AC |
23 | glibc provides no wrapper for |
24 | .BR lookup_dcookie (), | |
25 | necessitating the use of | |
26 | .BR syscall (2). | |
fea681da MK |
27 | .SH DESCRIPTION |
28 | Look up the full path of the directory entry specified by the value | |
ce28864c | 29 | .IR cookie . |
c13182ef MK |
30 | The cookie is an opaque identifier uniquely identifying a particular |
31 | directory entry. | |
32 | The buffer given is filled in with the full path of the directory entry. | |
efeece04 | 33 | .PP |
fea681da | 34 | For |
e511ffb6 | 35 | .BR lookup_dcookie () |
c13182ef | 36 | to return successfully, |
fea681da | 37 | the kernel must still hold a cookie reference to the directory entry. |
47297adb | 38 | .SH RETURN VALUE |
fea681da | 39 | On success, |
e511ffb6 | 40 | .BR lookup_dcookie () |
fea681da MK |
41 | returns the length of the path string copied into the buffer. |
42 | On error, \-1 is returned, and | |
43 | .I errno | |
f6a4078b | 44 | is set to indicate the error. |
fea681da MK |
45 | .SH ERRORS |
46 | .TP | |
47 | .B EFAULT | |
48 | The buffer was not valid. | |
49 | .TP | |
50 | .B EINVAL | |
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. | |
53 | .TP | |
54 | .B ENAMETOOLONG | |
55 | The name could not fit in the buffer. | |
56 | .TP | |
57 | .B ENOMEM | |
58 | The kernel could not allocate memory for the temporary buffer holding | |
59 | the path. | |
60 | .TP | |
61 | .B EPERM | |
c13182ef | 62 | The process does not have the capability |
fea681da MK |
63 | .B CAP_SYS_ADMIN |
64 | required to look up cookie values. | |
65 | .TP | |
66 | .B ERANGE | |
67 | The buffer was not large enough to hold the path of the directory entry. | |
a759cc87 MK |
68 | .SH VERSIONS |
69 | Available since Linux 2.5.43. | |
682edefb | 70 | The |
0daa9e92 | 71 | .B ENAMETOOLONG |
682edefb | 72 | error return was added in 2.5.70. |
3113c7f3 | 73 | .SH STANDARDS |
a1d5f77c | 74 | .BR lookup_dcookie () |
8382f16d | 75 | is Linux-specific. |
47297adb | 76 | .SH NOTES |
a1d5f77c | 77 | .BR lookup_dcookie () |
9484e1a3 MK |
78 | is a special-purpose system call, currently used only by the |
79 | .BR oprofile (1) | |
80 | profiler. | |
a1d5f77c | 81 | It relies on a kernel driver to register cookies for directory entries. |
efeece04 | 82 | .PP |
a1d5f77c MK |
83 | The path returned may be suffixed by the string " (deleted)" if the directory |
84 | entry has been removed. | |
d133313f MK |
85 | .SH SEE ALSO |
86 | .BR oprofile (1) |