Xref: utzoo comp.lang.c:27208 comp.unix.questions:20827 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mailrus!purdue!bouma From: bouma@cs.purdue.EDU (William J. Bouma) Newsgroups: comp.lang.c,comp.unix.questions Subject: making executables do tricks Message-ID: <10126@medusa.cs.purdue.edu> Date: 25 Mar 90 22:16:27 GMT Followup-To: comp.lang.c Organization: Department of Computer Science, Purdue University Lines: 34 Please provide the unix calls to do the following: 1. State saving executable. main() { INTITIALIZATIONS; ...; savecore(filename); X; ...; } 'savecore' should create an executable file which begins execution at statement X and retains the state information from the INTITIALIZATIONS. I realize that some state info could not be saved, (eg open file pointers), but I am mainly interested in 'malloc'ed memory. Is it possible to save the dynamically allocated memory in a binary? 2. Dynamic loading of functions. main() { ...; loadfile("func.o"); exec_named_function("func", arg1, arg2); ...; } 'loadfile' should make the functions in "func.o" accessible to the currently running binary. 'exec_named_function' should find the function named "func" and execute it like func(arg1, arg2). -- Bill | And don't forget my dog... "Astronomy" -- BOC