man-pages/man2/lookup_dcookie.2.html
2021-03-31 01:06:50 +01:00

147 lines
3.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of LOOKUP_DCOOKIE</TITLE>
</HEAD><BODY>
<H1>LOOKUP_DCOOKIE</H1>
Section: Linux Programmer's Manual (2)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
lookup_dcookie - return a directory entry's path
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>int lookup_dcookie(u64 </B><I>cookie</I><B>, char *</B><I>buffer</I><B>, size_t </B><I>len</I><B>);</B>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
Look up the full path of the directory entry specified by the value
<I>cookie</I>.
The cookie is an opaque identifier uniquely identifying a particular
directory entry.
The buffer given is filled in with the full path of the directory entry.
<P>
For
<B>lookup_dcookie</B>()
to return successfully,
the kernel must still hold a cookie reference to the directory entry.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
On success,
<B>lookup_dcookie</B>()
returns the length of the path string copied into the buffer.
On error, -1 is returned, and
<I>errno</I>
is set appropriately.
<A NAME="lbAF">&nbsp;</A>
<H2>ERRORS</H2>
<DL COMPACT>
<DT id="1"><B>EFAULT</B>
<DD>
The buffer was not valid.
<DT id="2"><B>EINVAL</B>
<DD>
The kernel has no registered cookie/directory entry mappings at the
time of lookup, or the cookie does not refer to a valid directory entry.
<DT id="3"><B>ENAMETOOLONG</B>
<DD>
The name could not fit in the buffer.
<DT id="4"><B>ENOMEM</B>
<DD>
The kernel could not allocate memory for the temporary buffer holding
the path.
<DT id="5"><B>EPERM</B>
<DD>
The process does not have the capability
<B>CAP_SYS_ADMIN</B>
required to look up cookie values.
<DT id="6"><B>ERANGE</B>
<DD>
The buffer was not large enough to hold the path of the directory entry.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>VERSIONS</H2>
Available since Linux 2.5.43.
The
<B>ENAMETOOLONG</B>
error return was added in 2.5.70.
<A NAME="lbAH">&nbsp;</A>
<H2>CONFORMING TO</H2>
<B>lookup_dcookie</B>()
is Linux-specific.
<A NAME="lbAI">&nbsp;</A>
<H2>NOTES</H2>
<B>lookup_dcookie</B>()
is a special-purpose system call, currently used only by the
<B><A HREF="/cgi-bin/man/man2html?1+oprofile">oprofile</A></B>(1)
profiler.
It relies on a kernel driver to register cookies for directory entries.
<P>
The path returned may be suffixed by the string &quot; (deleted)&quot; if the directory
entry has been removed.
<A NAME="lbAJ">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+oprofile">oprofile</A></B>(1)
<A NAME="lbAK">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="7"><A HREF="#lbAB">NAME</A><DD>
<DT id="8"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="9"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="10"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="11"><A HREF="#lbAF">ERRORS</A><DD>
<DT id="12"><A HREF="#lbAG">VERSIONS</A><DD>
<DT id="13"><A HREF="#lbAH">CONFORMING TO</A><DD>
<DT id="14"><A HREF="#lbAI">NOTES</A><DD>
<DT id="15"><A HREF="#lbAJ">SEE ALSO</A><DD>
<DT id="16"><A HREF="#lbAK">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:33 GMT, March 31, 2021
</BODY>
</HTML>