OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / original / 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@gmail.com>
26 .\"
27 .TH LOOKUP_DCOOKIE 2 2004-06-17 "Linux" "Linux Programmer's Manual"
28 .SH NAME
29 lookup_dcookie \- return a directory entry's path
30 .SH SYNOPSIS
31 .BI "int lookup_dcookie(u64 " cookie ", char *" buffer ", size_t " len );
32 .SH DESCRIPTION
33 Look up the full path of the directory entry specified by the value
34 .I cookie
35 .
36 The cookie is an opaque identifier uniquely identifying a particular
37 directory entry.
38 The buffer given is filled in with the full path of the directory entry.
39
40 For
41 .BR lookup_dcookie ()
42 to return successfully,
43 the kernel must still hold a cookie reference to the directory entry.
44 .SH "RETURN VALUE"
45 On success,
46 .BR lookup_dcookie ()
47 returns the length of the path string copied into the buffer.
48 On error, \-1 is returned, and
49 .I errno
50 is set appropriately.
51 .SH ERRORS
52 .TP
53 .B EFAULT
54 The buffer was not valid.
55 .TP
56 .B EINVAL
57 The kernel has no registered cookie/directory entry mappings at the
58 time of lookup, or the cookie does not refer to a valid directory entry.
59 .TP
60 .B ENAMETOOLONG
61 The name could not fit in the buffer.
62 .TP
63 .B ENOMEM
64 The kernel could not allocate memory for the temporary buffer holding
65 the path.
66 .TP
67 .B EPERM
68 The process does not have the capability
69 .B CAP_SYS_ADMIN
70 required to look up cookie values.
71 .TP
72 .B ERANGE
73 The buffer was not large enough to hold the path of the directory entry.
74 .SH VERSIONS
75 Available since Linux 2.5.43.
76 The
77 .B ENAMETOOLONG
78 error return was added in 2.5.70.
79 .SH "CONFORMING TO"
80 .BR lookup_dcookie ()
81 is Linux-specific.
82 .SH "NOTES"
83 .BR lookup_dcookie ()
84 is a special-purpose system call, currently used only by the oprofile profiler.
85 It relies on a kernel driver to register cookies for directory entries.
86
87 The path returned may be suffixed by the string " (deleted)" if the directory
88 entry has been removed.