Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!news.larc.nasa.gov!hal.larc.nasa.gov!alan From: alan@hal.larc.nasa.gov (alan dare) Newsgroups: comp.unix.programmer Subject: Using mpin Message-ID: <1991Jun28.201335.11110@news.larc.nasa.gov> Date: 28 Jun 91 20:13:35 GMT Sender: news@news.larc.nasa.gov (USENET Network News) Organization: NASA Langley Research Center, Hampton, VA USA Lines: 28 Originator: alan@hal.larc.nasa.gov 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 |