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