Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!olivea!orc!inews!iwarp.intel.com!gargoyle!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.unix.questions Subject: Re: Passing parameters to signal()? Message-ID: <1990Sep19.144208.4518@chinet.chi.il.us> Date: 19 Sep 90 14:42:08 GMT References: <122@wookie.dbaccess.com> Organization: Chinet - Chicago Public Access UNIX Lines: 19 In article <122@wookie.dbaccess.com> ivan@dbaccess.com (Ivan Covdy) writes: >My limitation is that I cannot have external/global variables for >functions Action() and WaitSignal(), because these functions can be >linked to several mains() by different ways on different systems >(...well, common code can be called from multiple tasks). As long as you don't allow recursion (and if WaitSignal() actually waits you obviously don't), all you have to do is declare a static variable outside of the functions to hold your pointer and copy the parameter passed to WaitSignal() there. As long as the Action() function resides in the same source file, it will be able to access the static variable, but the name will not be visible elsewhere. You may have other problems with this code, though, like signals arriving before you are ready unless WaitSignal() also notifies the other process(es) when it is prepared to receive them. Les Mikesell les@chinet.chi.il.us