OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man2 / getunwind.2
1 .\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
2 .\" Written by Marcela Maslanova <mmaslano@redhat.com>
3 .\" and Copyright 2013, Michael kerrisk <mtk.manpages@gmail.com>
4 .\"
5 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .TH GETUNWIND 2 2014-09-21 Linux "Linux Programmer's Manual"
28 .SH NAME
29 getunwind \- copy the unwind data to caller's buffer
30 .SH SYNOPSIS
31 .nf
32 .B #include <syscall.h>
33 .B #include <linux/unwind.h>
34 .sp
35 .BI "long getunwind(void " *buf ", size_t " buf_size );
36 .fi
37
38 .IR Note :
39 There is no glibc wrapper for this system call; see NOTES.
40 .SH DESCRIPTION
41 .I Note: this function is obsolete.
42
43 The
44 IA-64-specific
45 .BR getunwind ()
46 system call copies the kernel's call frame
47 unwind data into the buffer pointed to by
48 .I buf
49 and returns the size of the unwind data;
50 this data describes the gate page (kernel code that
51 is mapped into user space).
52
53 The size of the buffer
54 .I buf
55 is specified in
56 .IR buf_size .
57 The data is copied only if
58 .I buf_size
59 is greater than or equal to the size of the unwind data and
60 .I buf
61 is not NULL;
62 otherwise, no data is copied, and the call succeeds,
63 returning the size that would be needed to store the unwind data.
64
65 The first part of the unwind data contains an unwind table.
66 The rest contains the associated unwind information, in no particular order.
67 The unwind table contains entries of the following form:
68
69 .nf
70     u64 start;      (64-bit address of start of function)
71     u64 end;        (64-bit address of end of function)
72     u64 info;       (BUF-relative offset to unwind info)
73 .fi
74
75 An entry whose
76 .I start
77 value is zero indicates the end of the table.
78 For more information about the format, see the
79 .I IA-64 Software Conventions and Runtime Architecture
80 manual.
81 .SH RETURN VALUE
82 On success,
83 .BR getunwind ()
84 returns the size of the unwind data.
85 On error, \-1 is returned and
86 .I errno
87 is set to indicate the error.
88 .SH ERRORS
89 .BR getunwind ()
90 fails with the error
91 .B EFAULT
92 if the unwind info can't be stored in the space specified by
93 .IR buf .
94 .SH VERSIONS
95 This system call is available since Linux 2.4.
96 .SH CONFORMING TO
97 This system call is Linux-specific,
98 and is available only on the IA-64 architecture.
99 .SH NOTES
100 This system call has been deprecated.
101 The modern way to obtain the kernel's unwind data is via the gate DSO.
102 The address of the ELF header for this DSO
103 is passed to user level via
104 .BR AT_SYSINFO_EHDR
105 (see
106 .BR getauxval (3)).
107
108 Glibc does not provide a wrapper for this system call;
109 in the unlikely event that you want to call it, use
110 .BR syscall (2).
111 .SH SEE ALSO
112 .BR getauxval (3)
113 .SH COLOPHON
114 This page is part of release 3.79 of the Linux
115 .I man-pages
116 project.
117 A description of the project,
118 information about reporting bugs,
119 and the latest version of this page,
120 can be found at
121 \%http://www.kernel.org/doc/man\-pages/.