getcallerpc man page on Plan9

Man page or keyword search:  
man Server   549 pages
apropos Keyword Search (all sections)
Output format
Plan9 logo
[printable version]

GETCALLERPC(2)							GETCALLERPC(2)

NAME
       getcallerpc - fetch return PC of current function

SYNOPSIS
       #include <u.h>
       #include <libc.h>

       uintptr getcallerpc(void *firstarg)

DESCRIPTION
       Getcallerpc  is	a portable way to discover the PC to which the current
       function will return.  Firstarg should be a pointer to the first	 argu‐
       ment to the function in question.

EXAMPLE
	      void
	      printpc(int arg)
	      {
		   print("Called from %p\n", getcallerpc(&arg));
	      }

	      void
	      main(int argc, char *argv[])
	      {
		   printpc(0);
		   printpc(0);
		   printpc(0);
	      }

SOURCE
       /sys/src/libc/$objtype/getcallerpc.[cs]

BUGS
       The firstarg parameter should not be necessary.

								GETCALLERPC(2)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Plan9

List of man pages available for Plan9

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net