Re: fork ???

Sri Ramkrishna <> writes: 
> You probably don't want to do a full fork as it takes a lot of system
> resources most of which you don't need.  Use a vfork and then have teh
> child execute a execve system call.  The parent will suspend until you
> issue the execve.
> Caveats are that vfork doesn't make your code very portable from what I
> glean from the linux kernel mailing list.

Just use fork(), it's cheap on Linux, certainly cheap enough for most

One example of using it is the gnome_execute_async() function in
libgnome, you could look at that code.

Also a UNIX programming book will have examples; try Linux Application
Development, Advanced Programming in the UNIX Environment, or
Beginning Linux Programming, those three are all worth owning.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]