Find the answer to your Linux question:
Results 1 to 3 of 3
hi all i am new to linux programming. actually i need to start a new process within a process.i dont want to use fork(). can any one tell me is ...
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    8

    creating process

    hi all

    i am new to linux programming.
    actually i need to start a new process within a process.i dont want to use fork().
    can any one tell me is there any system call that creates a new process and returns pid of the created process. i can start a process by system() but the calling process will be blocked untill that process completes . i dont want my calling process to get blocked but has to start a new process.

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Exclamation

    can start a process by system()
    Have you tried exec functions family Fork, Exec and Process control

    i dont want to use fork().
    I believe fork() will be invoked internally by all system calls
    to creat a new process.
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  3. #3
    Just Joined!
    Join Date
    Feb 2009
    Posts
    45
    Answer:
    Quote Originally Posted by maggi
    i need to start a new process within a process.i dont want to use fork().
    can any one tell me is there any system call that creates a new process and returns pid of the created process.
    The only calls I know of that start new processes are:

    While the first two are both library function and syscalls, I believe the third is implementation dependent (as to which syscall it uses).

    Quote Originally Posted by Lakshmipathi
    I believe fork() will be invoked internally by all system calls
    to creat a new process.
    Syscalls are a kernel-userspace-gate interface. While a syscall is invoked, the process runs in kernel mode and can do whatever it wants (within the parameters of the syscall, of course). Thereʼs no need to invoke another syscall.

    Question:
    maggi: Care to explain why you donʼt want to use «fork()»?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...