Alternatives to system() function in a C++ application?

From: min (
Date: 07/26/05

Date: 26 Jul 2005 07:33:57 -0700


We have a C++ application running on Linux that contains lots of
system() function calls, such as the following:

system ("./kill_autolog 2>/dev/null");
system ("/usr/bin/konsole --noclose -T RPCLOG --vt_sz 180x15 -e
./autolog 2> /dev/null &");
sprintf (command, "wc -l ./workfile1 > ./workfile2");
system (command);
system ("rm ./workfile1"); // remove the temporary workfiles
system ("rm ./workfile2");

kill_autolog is a Perl script, while rm or wc are Linux shell commands.
There are lots of similar calls like this. They work fine except that
when we tried to debug the application with KDevelop or GDB, the
debugger got totally lost after entering the system() function, meaning
it never comes back to the breakpoint even if we set up a breakpoint
immediately after the system() statement. We are thinking of replacing
the system() function with some other function(s), or find a way not to
let GDB get lost. I haven't succeeded in either. Please help. Thanks.

Relevant Pages

  • Re: Re: 1/2 dozenth request over 3-years
    ... Pure Linux command line login, ... available one and it's modem. ... assortment of 16 terminals and old XT's to hook those in. ...
  • [PATCH 19-rc2] Fix misc .c/.h comment typos
    ... Implements an interface for i2c compatible eeproms to run under linux. ... Changed struct initializer syntax to the currently preferred notation ... ** Packet is an actual packet structure to be filled in with the packet ... -** as the command processore doesn't process the command packet in any way. ...
  • Re: [opensuse] deleting
    ... during the installation of jre 1.5.0 (according to the install ... i'm learning and having fun with my new toy, the command line interface. ... understand and use linux more efficiently. ... /bin/sh is the Bourne Shell. ...
  • Re: how i will open (from Java Application) the MS word format /html documentsin repective Applicati
    ... documentsin repective Applications in Linux OS? ... What I did in the Linux version of our product was require an external ... I create a URI object around it and use that. ... array by separating the CDE command line at the spaces, ...
  • Re: VERY basic linux system
    ... "> I keep hearing that you can modify linux to your liking, ... 'user', but once you have a multi-tasking kernel, multi-user is pretty ... Command names are arbitary and virtually all command shells allow all ... supporting stuff, and stuff supporting the support stuff, etc. ...