Many pages: Document fixed-width types with ISO C naming
[man-pages.git] / man2 / getunwind.2
blobfb64a1185fb8f234782033d94006f6fe7834fbd2
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 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .TH GETUNWIND 2 2021-03-22 "Linux man-pages (unreleased)"
8 .SH NAME
9 getunwind \- copy the unwind data to caller's buffer
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ", " \-lc )
13 .SH SYNOPSIS
14 .nf
15 .B #include <linux/unwind.h>
16 .BR "#include <sys/syscall.h>" "      /* Definition of " SYS_* " constants */"
17 .B #include <unistd.h>
18 .PP
19 .BI "long syscall(SYS_getunwind, void " *buf ", size_t " buf_size );
20 .fi
21 .PP
22 .IR Note :
23 glibc provides no wrapper for
24 .BR getunwind (),
25 necessitating the use of
26 .BR syscall (2).
27 .SH DESCRIPTION
28 .I Note: this system call is obsolete.
29 .PP
30 The
31 IA-64-specific
32 .BR getunwind ()
33 system call copies the kernel's call frame
34 unwind data into the buffer pointed to by
35 .I buf
36 and returns the size of the unwind data;
37 this data describes the gate page (kernel code that
38 is mapped into user space).
39 .PP
40 The size of the buffer
41 .I buf
42 is specified in
43 .IR buf_size .
44 The data is copied only if
45 .I buf_size
46 is greater than or equal to the size of the unwind data and
47 .I buf
48 is not NULL;
49 otherwise, no data is copied, and the call succeeds,
50 returning the size that would be needed to store the unwind data.
51 .PP
52 The first part of the unwind data contains an unwind table.
53 The rest contains the associated unwind information, in no particular order.
54 The unwind table contains entries of the following form:
55 .PP
56 .in +4n
57 .EX
58 uint64_t  start;      (64\-bit address of start of function)
59 uint64_t  end;        (64\-bit address of end of function)
60 uint64_t  info;       (BUF\-relative offset to unwind info)
61 .EE
62 .in
63 .PP
64 An entry whose
65 .I start
66 value is zero indicates the end of the table.
67 For more information about the format, see the
68 .I IA-64 Software Conventions and Runtime Architecture
69 manual.
70 .SH RETURN VALUE
71 On success,
72 .BR getunwind ()
73 returns the size of the unwind data.
74 On error, \-1 is returned and
75 .I errno
76 is set to indicate the error.
77 .SH ERRORS
78 .BR getunwind ()
79 fails with the error
80 .B EFAULT
81 if the unwind info can't be stored in the space specified by
82 .IR buf .
83 .SH VERSIONS
84 This system call is available since Linux 2.4.
85 .SH STANDARDS
86 This system call is Linux-specific,
87 and is available only on the IA-64 architecture.
88 .SH NOTES
89 This system call has been deprecated.
90 The modern way to obtain the kernel's unwind data is via the
91 .BR vdso (7).
92 .SH SEE ALSO
93 .BR getauxval (3)