177 lines
4.5 KiB
HTML
177 lines
4.5 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of GET_KERNEL_SYMS</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>GET_KERNEL_SYMS</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"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
get_kernel_syms - retrieve exported kernel and module symbols
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<PRE>
|
|
<B>#include <<A HREF="file:///usr/include/linux/module.h">linux/module.h</A>></B>
|
|
|
|
<B>int get_kernel_syms(struct kernel_sym *</B><I>table</I><B>);</B>
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
<I>Note</I>:
|
|
|
|
No declaration of this system call is provided in glibc headers; see NOTES.
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>Note</B>:
|
|
|
|
This system call is present only in kernels before Linux 2.6.
|
|
<P>
|
|
|
|
If
|
|
<I>table</I>
|
|
|
|
is NULL,
|
|
<B>get_kernel_syms</B>()
|
|
|
|
returns the number of symbols available for query.
|
|
Otherwise, it fills in a table of structures:
|
|
<P>
|
|
|
|
|
|
|
|
struct kernel_sym {
|
|
<BR> unsigned long value;
|
|
<BR> char name[60];
|
|
};
|
|
|
|
|
|
<P>
|
|
|
|
The symbols are interspersed with magic symbols of the form
|
|
<B>#</B><I>module-name</I>
|
|
|
|
with the kernel having an empty name.
|
|
The value associated with a symbol of this form is the address at
|
|
which the module is loaded.
|
|
<P>
|
|
|
|
The symbols exported from each module follow their magic module tag
|
|
and the modules are returned in the reverse of the
|
|
order in which they were loaded.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
On success, returns the number of symbols copied to
|
|
<I>table</I>.
|
|
|
|
On error, -1 is returned and
|
|
<I>errno</I>
|
|
|
|
is set appropriately.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>ERRORS</H2>
|
|
|
|
There is only one possible error return:
|
|
<DL COMPACT>
|
|
<DT id="1"><B>ENOSYS</B>
|
|
|
|
<DD>
|
|
<B>get_kernel_syms</B>()
|
|
|
|
is not supported in this version of the kernel.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>VERSIONS</H2>
|
|
|
|
This system call is present on Linux only up until kernel 2.4;
|
|
it was removed in Linux 2.6.
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
<B>get_kernel_syms</B>()
|
|
|
|
is Linux-specific.
|
|
<A NAME="lbAI"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
This obsolete system call is not supported by glibc.
|
|
No declaration is provided in glibc headers, but, through a quirk of history,
|
|
glibc versions before 2.23 did export an ABI for this system call.
|
|
Therefore, in order to employ this system call,
|
|
it was sufficient to manually declare the interface in your code;
|
|
alternatively, you could invoke the system call using
|
|
<B><A HREF="/cgi-bin/man/man2html?2+syscall">syscall</A></B>(2).
|
|
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
There is no way to indicate the size of the buffer allocated for
|
|
<I>table</I>.
|
|
|
|
If symbols have been added to the kernel since the
|
|
program queried for the symbol table size, memory will be corrupted.
|
|
<P>
|
|
|
|
The length of exported symbol names is limited to 59 characters.
|
|
<P>
|
|
|
|
Because of these limitations, this system call is deprecated in
|
|
favor of
|
|
<B><A HREF="/cgi-bin/man/man2html?2+query_module">query_module</A></B>(2)
|
|
|
|
(which is itself nowadays deprecated
|
|
in favor of other interfaces described on its manual page).
|
|
<A NAME="lbAK"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+create_module">create_module</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+delete_module">delete_module</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+init_module">init_module</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+query_module">query_module</A></B>(2)
|
|
|
|
<A NAME="lbAL"> </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"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="2"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="3"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="4"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="5"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="6"><A HREF="#lbAF">ERRORS</A><DD>
|
|
<DT id="7"><A HREF="#lbAG">VERSIONS</A><DD>
|
|
<DT id="8"><A HREF="#lbAH">CONFORMING TO</A><DD>
|
|
<DT id="9"><A HREF="#lbAI">NOTES</A><DD>
|
|
<DT id="10"><A HREF="#lbAJ">BUGS</A><DD>
|
|
<DT id="11"><A HREF="#lbAK">SEE ALSO</A><DD>
|
|
<DT id="12"><A HREF="#lbAL">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:32 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|