summaryrefslogtreecommitdiff
path: root/man2/getunwind.2
blob: 560d517f14c39eb4bfd9d00fd6d1ee4dc18b31a7 (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
.\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
.\" Written by Marcela Maslanova <mmaslano@redhat.com>
.\" and Copyright 2013, Michael kerrisk <mtk.manpages@gmail.com>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\"
.TH GETUNWIND 2 2013-02-13" Linux "Linux Programmer's Manual"
.SH NAME
getunwind \- copy the unwind data to caller's buffer

.SH SYNOPSIS
.nf
.B #include <syscall.h>
.B #include <linux/unwind.h>
.sp
.BI "long getunwind(void " *buf ", size_t " buf_size );
.fi

.IR Note :
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
.I Note: this function is obsolete.

The
IA-64-specific
.BR getunwind ()
system call copies the kernel's call frame
unwind data into the buffer pointed to by
.I buf
and returns the size of the unwind data;
this data describes the gate page (kernel code that
is mapped into user space).

The size of the buffer
.I buf
is specified in
.IR buf_size .
The data is copied only if
.I buf_size
is greater than or equal to the size of the unwind data and
.I buf
is not NULL;
otherwise, no data is copied, and the call succeeds,
returning the size that would be needed to store the unwind data.

The first part of the unwind data contains an unwind table. 
The rest contains the associated unwind information, in no particular order.
The unwind table contains entries of the following form:

.nf
	u64 start;      (64-bit address of start of function)
	u64 end;        (64-bit address of start of function)
	u64 info;       (BUF-relative offset to unwind info)
.fi

An entry whose
.I sytart
value is zero indicates the end of the table.
For more information about the format, see the
.I IA-64 Software Conventions and Runtime Architecture
manual.

.SH "RETURN VALUE"
On success,
.BR getunwind ()
returns the size of unwind table.
On error, \-1 is returned and
.I errno
is set to indicate the error.

.SH ERRORS
.BR getunwind ()
fails with the error
.B EFAULT
if the unwind info can't be stored in the space specified by
.IR buf . 

.SH VERSIONS
This system call is available since Linux 2.4.

.SH CONFORMING TO
This system call is Linux specific,
and is available only on the IA-64 architecture.

.SH NOTES
This system call has been deprecated.
The modern way to obtain the kernel's unwind data is via the gate DSO.
The address of the ELF header for this DSO
is passed to user level via
.BR AT_SYSINFO_EHDR
(see
.BR getauxval (3)).

Glibc does not provide a wrapper for this system call;
in the unlikely event that you want to call it, use
.BR syscall (2).

.SH "SEE ALSO"
.BR getauxval (3)