[comp.unix.programmer] Using mpin

alan@hal.larc.nasa.gov (alan dare) (06/29/91)

I work on an SGI box running IRIX (System V with BSD extentions) and I would
like to find a way to determine the size of a function during compile time or
run time. The manual we received on real-time features shows how to lock the 
signal handler into memory using the function call:

	int mpin (void *addr, unsigned len);

However, their example has the following line:

	mpin((char *)handler, (int)fnc_after_handler - (int)handler);


Now this works fine but if someone moves the position of 
fnc_after_handler() or I want to use an optimizing compiler I could be
in trouble. I was told to find the size of the object then hard code it
into the mpin call. That could be a time bomb for someone taking over the
code i'm writing. Does anyone have a better idea?

Thanks

-- 

*********************************************************************
Alan Dare                     |  Internet : alan@hal.larc.nasa.gov
NASA Langley Research Center  |