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