Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!bionet!ames!sgi!shinobu!odin!elysium!archer From: archer@elysium.sgi.com (Archer Sully) Newsgroups: comp.lang.c Subject: Re: Child processes redefined Message-ID: <10185@odin.corp.sgi.com> Date: 10 Jul 90 21:47:49 GMT References: <12473@june.cs.washington.edu> <1990Jul6.145122.14785@usenet@kadsma> Sender: news@odin.corp.sgi.com Distribution: na Lines: 25 In article <1990Jul6.145122.14785@usenet@kadsma> pajerek@usenet@kadsma (Don Pajerek) writes: >In article <12473@june.cs.washington.edu> ojpotter@fred.cs.washington.edu () writes: >> I want to use these external >>executables as runtime functions. I want to pass them parameters and get a >>calculated return value back. >> >Am I missing something, or won't fork/exec do the job? It may. Then again, it may not. If the dynamic function needs to access data and text from the main program, then using a fork/exec scheme will be either insufficient or inefficient, because the data would have to be passed through some arcane means (encoding in strings for parameters, shared memory, etc...). Return values suffer similar problems. If all that is needed is an int return, then it shouldn't be too tough, but if floating point or a structure of some sort is required, it gets more difficult. The C language does not define dynamic loading. That is a feature of the operating system, and many do not have it. Archer Sully | Ask not what you can do for you country, (archer@esd.sgi.com) | But what your country's been doing to you. | -- The Avengers