]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/lookup_dcookie.2
Reordered sections to be more consistent, in some cases renaming
[thirdparty/man-pages.git] / man2 / lookup_dcookie.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (C) 2003 John Levon <levon@movementarian.org>
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified 2004-06-17 Michael Kerrisk <mtk-manpages@gmx.net>
26 .\"
27 .TH LOOKUP_DCOOKIE 2 2004-06-17 "Linux 2.6.7" "Linux Programmer's Manual"
28 .SH NAME
29 lookup_dcookie \- return a directory entry's path
30 .SH SYNOPSIS
31 .sp
32 .BI "int lookup_dcookie(u64 " cookie ", char *" buffer ", size_t " len );
33 .SH DESCRIPTION
34 Look up the full path of the directory entry specified by the value
35 .I cookie
36 .
37 The cookie is an opaque identifier uniquely identifying a particular
38 directory entry.
39 The buffer given is filled in with the full path of the directory entry.
40
41 For
42 .BR lookup_dcookie ()
43 to return successfully,
44 the kernel must still hold a cookie reference to the directory entry.
45 .SH "RETURN VALUE"
46 On success,
47 .BR lookup_dcookie ()
48 returns the length of the path string copied into the buffer.
49 On error, \-1 is returned, and
50 .I errno
51 is set appropriately.
52 .SH ERRORS
53 .TP
54 .B EFAULT
55 The buffer was not valid.
56 .TP
57 .B EINVAL
58 The kernel has no registered cookie/directory entry mappings at the
59 time of lookup, or the cookie does not refer to a valid directory entry.
60 .TP
61 .B ENAMETOOLONG
62 The name could not fit in the buffer.
63 .TP
64 .B ENOMEM
65 The kernel could not allocate memory for the temporary buffer holding
66 the path.
67 .TP
68 .B EPERM
69 The process does not have the capability
70 .B CAP_SYS_ADMIN
71 required to look up cookie values.
72 .TP
73 .B ERANGE
74 The buffer was not large enough to hold the path of the directory entry.
75 .SH VERSIONS
76 Available since Linux 2.5.43.
77 The ENAMETOOLONG error return was added in 2.5.70.
78 .SH "CONFORMING TO"
79 .BR lookup_dcookie ()
80 is Linux specific.
81 .SH "NOTES"
82 .BR lookup_dcookie ()
83 is a special-purpose system call, currently used only by the oprofile profiler.
84 It relies on a kernel driver to register cookies for directory entries.
85
86 The path returned may be suffixed by the string " (deleted)" if the directory
87 entry has been removed.