Results 1 to 3 of 3

Thread: How to start a new process in linux

  1. #1

    Thread Starter
    Frenzied Member aewarnick's Avatar
    Join Date
    Dec 2002
    Posts
    1,037

    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?

  2. #2
    Fanatic Member twanvl's Avatar
    Join Date
    Dec 2001
    Posts
    771

    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(...);
    }

  3. #3

    Thread Starter
    Frenzied Member aewarnick's Avatar
    Join Date
    Dec 2002
    Posts
    1,037

    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
  •  



Click Here to Expand Forum to Full Width