]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/lookup_dcookie.2
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man2 / lookup_dcookie.2
CommitLineData
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
9lookup_dcookie \- return a directory entry's path
52633c69
AC
10.SH LIBRARY
11Standard 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
23glibc provides no wrapper for
24.BR lookup_dcookie (),
25necessitating the use of
26.BR syscall (2).
fea681da
MK
27.SH DESCRIPTION
28Look up the full path of the directory entry specified by the value
ce28864c 29.IR cookie .
c13182ef
MK
30The cookie is an opaque identifier uniquely identifying a particular
31directory entry.
32The buffer given is filled in with the full path of the directory entry.
efeece04 33.PP
fea681da 34For
e511ffb6 35.BR lookup_dcookie ()
c13182ef 36to return successfully,
fea681da 37the kernel must still hold a cookie reference to the directory entry.
47297adb 38.SH RETURN VALUE
fea681da 39On success,
e511ffb6 40.BR lookup_dcookie ()
fea681da
MK
41returns the length of the path string copied into the buffer.
42On error, \-1 is returned, and
43.I errno
f6a4078b 44is set to indicate the error.
fea681da
MK
45.SH ERRORS
46.TP
47.B EFAULT
48The buffer was not valid.
49.TP
50.B EINVAL
51The kernel has no registered cookie/directory entry mappings at the
52time of lookup, or the cookie does not refer to a valid directory entry.
53.TP
54.B ENAMETOOLONG
55The name could not fit in the buffer.
56.TP
57.B ENOMEM
58The kernel could not allocate memory for the temporary buffer holding
59the path.
60.TP
61.B EPERM
c13182ef 62The process does not have the capability
fea681da
MK
63.B CAP_SYS_ADMIN
64required to look up cookie values.
65.TP
66.B ERANGE
67The buffer was not large enough to hold the path of the directory entry.
a759cc87
MK
68.SH VERSIONS
69Available since Linux 2.5.43.
682edefb 70The
0daa9e92 71.B ENAMETOOLONG
682edefb 72error return was added in 2.5.70.
3113c7f3 73.SH STANDARDS
a1d5f77c 74.BR lookup_dcookie ()
8382f16d 75is Linux-specific.
47297adb 76.SH NOTES
a1d5f77c 77.BR lookup_dcookie ()
9484e1a3
MK
78is a special-purpose system call, currently used only by the
79.BR oprofile (1)
80profiler.
a1d5f77c 81It relies on a kernel driver to register cookies for directory entries.
efeece04 82.PP
a1d5f77c
MK
83The path returned may be suffixed by the string " (deleted)" if the directory
84entry has been removed.
d133313f
MK
85.SH SEE ALSO
86.BR oprofile (1)