Blob
1 .TH GETCALLERPC 32 .SH NAME3 getcallerpc \- fetch return PC of current function4 .SH SYNOPSIS5 .br6 .B #include <u.h>7 .br8 .B #include <libc.h>9 .PP10 .B ulong getcallerpc(void *firstarg)11 .SH DESCRIPTION12 .I Getcallerpc13 is a portable way to discover the PC to which the current function will return.14 .I Firstarg15 should be a pointer to the first argument to the function in question.16 .SH EXAMPLE17 .IP18 .EX19 void20 printpc(ulong arg)21 {22 print("Called from %.8lux\en", getcallerpc(&arg));23 }25 void26 main(int argc, char *argv[])27 {28 printpc(0);29 printpc(0);30 printpc(0);31 }32 .EE33 .SH SOURCE34 .B /usr/local/plan9/src/lib9/35 .SH BUGS36 The37 .I firstarg38 parameter should not be necessary.