namespaces.7: ffix
[man-pages.git] / man2 / getunwind.2
blob0935497c61d1e816ca420cd95fece683f42dead9
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 2021-03-22 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 <linux/unwind.h>
33 .BR "#include <sys/syscall.h>" "      /* Definition of " SYS_* " constants */"
34 .B #include <unistd.h>
35 .PP
36 .BI "long syscall(SYS_getunwind, void " *buf ", size_t " buf_size );
37 .fi
38 .PP
39 .IR Note :
40 glibc provides no wrapper for
41 .BR getunwind (),
42 necessitating the use of
43 .BR syscall (2).
44 .SH DESCRIPTION
45 .I Note: this system call is obsolete.
46 .PP
47 The
48 IA-64-specific
49 .BR getunwind ()
50 system call copies the kernel's call frame
51 unwind data into the buffer pointed to by
52 .I buf
53 and returns the size of the unwind data;
54 this data describes the gate page (kernel code that
55 is mapped into user space).
56 .PP
57 The size of the buffer
58 .I buf
59 is specified in
60 .IR buf_size .
61 The data is copied only if
62 .I buf_size
63 is greater than or equal to the size of the unwind data and
64 .I buf
65 is not NULL;
66 otherwise, no data is copied, and the call succeeds,
67 returning the size that would be needed to store the unwind data.
68 .PP
69 The first part of the unwind data contains an unwind table.
70 The rest contains the associated unwind information, in no particular order.
71 The unwind table contains entries of the following form:
72 .PP
73 .in +4n
74 .EX
75 u64 start;      (64\-bit address of start of function)
76 u64 end;        (64\-bit address of end of function)
77 u64 info;       (BUF\-relative offset to unwind info)
78 .EE
79 .in
80 .PP
81 An entry whose
82 .I start
83 value is zero indicates the end of the table.
84 For more information about the format, see the
85 .I IA-64 Software Conventions and Runtime Architecture
86 manual.
87 .SH RETURN VALUE
88 On success,
89 .BR getunwind ()
90 returns the size of the unwind data.
91 On error, \-1 is returned and
92 .I errno
93 is set to indicate the error.
94 .SH ERRORS
95 .BR getunwind ()
96 fails with the error
97 .B EFAULT
98 if the unwind info can't be stored in the space specified by
99 .IR buf .
100 .SH VERSIONS
101 This system call is available since Linux 2.4.
102 .SH CONFORMING TO
103 This system call is Linux-specific,
104 and is available only on the IA-64 architecture.
105 .SH NOTES
106 This system call has been deprecated.
107 The modern way to obtain the kernel's unwind data is via the
108 .BR vdso (7).
109 .SH SEE ALSO
110 .BR getauxval (3)