1234567891011121314151617181920212223242526272829303132 |
- .TH GETCALLERPC 2
- .SH NAME
- getcallerpc \- fetch return PC of current function
- .SH SYNOPSIS
- .br
- .B #include <u.h>
- .br
- .B #include <libc.h>
- .PP
- .B uintptr getcallerpc(void)
- .SH DESCRIPTION
- .I Getcallerpc
- is a portable way to discover the PC to which the current function will return.
- .SH EXAMPLE
- .IP
- .EX
- void
- printpc(void)
- {
- print("Called from %p\en", getcallerpc());
- }
- void
- main(int argc, char *argv[])
- {
- printpc();
- printpc();
- printpc();
- }
- .EE
- .SH SOURCE
- .B /$arch/include/u.h
|