|
-
Jan 16th, 2006, 09:52 AM
#1
Thread Starter
Frenzied Member
How to start a new process in linux
I am using execl to replace a process and that isn't working for me because when I start it, the file browser (KDE) doesn't respond until my program closes.
Is that a better function to use other than execl?
-
Jan 16th, 2006, 11:19 AM
#2
Re: How to start a new process in linux
If you are lucky there is a family of functions, spawn, just like exec that creates a new process. Otherwise you can use fork() to create a copy of the current process, and call execl only in the copy:
Code:
if (fork() == 0) { // we are the copy
exec(...);
}
-
Jan 16th, 2006, 05:01 PM
#3
Thread Starter
Frenzied Member
Re: How to start a new process in linux
That does the trick. Thanks twanvl.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|