Using mpin

alan dare alan at hal.larc.nasa.gov
Sat Jun 29 06:13:35 AEST 1991




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 at hal.larc.nasa.gov
NASA Langley Research Center  | 



More information about the Comp.unix.programmer mailing list