Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

system() ignoring SIGINT

Status
Not open for further replies.

carrick1

Programmer
Sep 15, 2005
2
0
0
GB
Hi
I have a C++ program that uses the system() function to execute a script.

The function is called like.
system(m_internal_cmd.c_str());

The problem is that the SIGINT signals are being ignored so when a user types CTRL-C on the command line the script does not quit.

Is there any way of using the system call but not suppressing the SIGINT.
 
> Is there any way of using the system call but not suppressing the SIGINT.
Nothing springs to mind.

Given than system() comes with a bunch of health warnings to start with, it may be best avoided for serious use (especially if you can't trust everything).

Using fork() and execl() is fairly easy and you have complete control over what goes on.

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top