simple frontend program problem

This is a discussion on simple frontend program problem within the Linux Programming forums, part of the Platform Specific Boards category; Well yes, if you dont do an exec, then the child process is going to go on running as another ...

  1. #16
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    Well yes, if you dont do an exec, then the child process is going to go on running as another copy of your parent process, at whatever point the if()else around the fork() call merges back into being one execution path.

    exec() calls should be followed by an _exit() call, just to catch the case if an exec() should fail.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  2. #17
    Registered User gandalf_bar's Avatar
    Join Date
    Oct 2003
    Posts
    92
    Quote Originally Posted by Salem
    Well yes, if you dont do an exec, then the child process is going to go on running as another copy of your parent process, at whatever point the if()else around the fork() call merges back into being one execution path.

    exec() calls should be followed by an _exit() call, just to catch the case if an exec() should fail.
    Why _exit() not return? I think their effects for parent program are same.
    A man asked, "Who are you?"
    Buddha answered, "I am awaked."

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Running Program Problem
    By warfang in forum C++ Programming
    Replies: 10
    Last Post: 03-28-2007, 02:02 PM
  2. simple login program problem
    By suckss in forum C Programming
    Replies: 11
    Last Post: 11-11-2006, 04:02 PM
  3. Problem with a simple program
    By Salgat in forum C Programming
    Replies: 10
    Last Post: 06-15-2006, 05:57 PM
  4. Replies: 3
    Last Post: 03-04-2005, 01:46 PM
  5. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 11:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21