File: unw_set_iterate_phdr_function.tex

package info (click to toggle)
libunwind 1.8.1-0.2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 7,360 kB
  • sloc: ansic: 42,395; sh: 5,215; asm: 2,172; makefile: 1,557; cpp: 122
file content (57 lines) | stat: -rw-r--r-- 1,942 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
\documentclass{article}
\usepackage[fancyhdr,pdf]{latex2man}

\input{common.tex}

\begin{document}

\begin{Name}{3libunwind}{unw\_set\_iterate\_phdr\_function}{Bert Wesarg}{Programming Library}{unw\_set\_iterate\_phdr\_function}unw\_set\_iterate\_phdr\_function -- set \Func{dl\_iterate\_phdr} implementation
\end{Name}

\section{Synopsis}


\File{\#include $<$libunwind.h$>$}\\

\noindent
\Type{typedef~int}
\Func{(*unw\_iterate\_phdr\_callback\_t)}(\Type{struct~dl\_phdr\_info~*},
        \Type{size\_t}, \Type{void~*});\\
\noindent
\Type{typedef~int} \Func{(*unw\_iterate\_phdr\_func\_t)}(\Type{unw\_iterate\_phdr\_callback\_t},
        \Type{void~*});\\

\noindent
\Type{void} \Func{unw\_set\_iterate\_phdr\_function}(\Type{unw\_addr\_space\_t}
        \Var{as}, \Type{unw\_iterate\_phdr\_func\_t} \Var{function});\\

\section{Description}

The \Func{unw\_set\_iterate\_phdr\_function}() routine sets the \Func{dl\_iterate\_phdr} implementation of address space \Var{as} to the function by argument \Var{function}.
The \Var{function} will be called whenever \Prog{libunwind} needs to iterate over the program headers of the application.
This is normally done by calling \Func{dl\_iterate\_phdr}, but this function is not signal safe.
With the help of a custom implementation caching and iterating over the program headers is also possible in an signal-safe manner.
Though the burden lies on the user of \Prog{libunwind}.

\section{Thread and Signal Safety}

\Func{unw\_set\_iterate\_phdr\_function}() is thread safe.  If the local address space
is passed in argument \Var{as}, this routine is also safe to use from
a signal handler.


\section{See Also}

\SeeAlso{libunwind}(3libunwind),
\SeeAlso{unw\_create\_addr\_space}(3libunwind),
\SeeAlso{dl\_iterate\_phdr}(3libunwind),

\section{Author}

\noindent
Bert Wesarg\\
Email: \Email{bert.wesarg@googlemail.com}\\
WWW: \URL{http://www.nongnu.org/libunwind/}.
\LatexManEnd

\end{document}