c - In a process using lots of memory, how can I spawn a shell without a memory-hungry fork()? -


on embedded platform (with no swap partition), have application main process occupies of available physical memory. problem want launch external shell script application, using fork() requires there enough memory 2x original process before child process (which execl smaller) can created.

so there way invoke shell script c program without incurring memory overhead of fork()?

i've considered workarounds such having secondary smaller process responsible creating shells, or having "watcher" script signal touching file or somesuch, i'd rather have simpler.

some unix implementations give vfork (part of single unix spec) fork except shares stuff parent.

with vfork, there limited number of things can in child before calling exec overwrite address space process - that's vfork built for, minimal copy version of fork fork/exec sequence.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -