Issue with system()

This is a discussion on Issue with system() within the C Programming forums, part of the General Programming Boards category; Hi all, In my code i am using system() function to execute the command which puts the job in background.the ...

  1. #1
    Registered User
    Join Date
    Nov 2008
    Location
    INDIA
    Posts
    64

    Question Issue with system()

    Hi all,
    In my code i am using system() function to execute the command which puts the job in background.the system() function executes the command and also it gets executed successfully .But there after none of the further statements get executed .I don't know the issue.Can any one help .

    thanks in advance.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    The rest of your C program won't run until the system() call finishes. The system() call won't finish until it gets a return value from the process you started. If you background that call.......

    Depending on why exactly you wanted to background the process, there are better alternatives.

  3. #3
    Registered User
    Join Date
    Nov 2008
    Location
    INDIA
    Posts
    64
    Thanks for your reply . The command is a start up of an application.It self it gets backgrounding and it is not taking too much time to execute.the thing which I want is to execute the command and come out for the further execution.Why it is blocking.
    Last edited by karthigayan; 01-12-2011 at 09:50 PM.

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    The system() call will block until it receives a return value from the process that it spawned. So whatever you're doing to that spawned process, make sure it terminates normally.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using system icons
    By @nthony in forum Windows Programming
    Replies: 1
    Last Post: 01-13-2007, 06:56 PM
  2. Linux database system needed
    By BobS0327 in forum Tech Board
    Replies: 7
    Last Post: 06-11-2006, 03:56 PM
  3. measuring system resources used by a function
    By Aran in forum C Programming
    Replies: 1
    Last Post: 03-13-2006, 04:35 PM
  4. Small issue with system()
    By Metal Man in forum C++ Programming
    Replies: 8
    Last Post: 10-21-2003, 01:33 PM
  5. Problem Reporting System. Need Advide!
    By brunomiranda in forum Tech Board
    Replies: 9
    Last Post: 09-25-2003, 09:21 PM

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