Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

C Spawning

Posted on 1997-08-29
1
Medium Priority
?
207 Views
Last Modified: 2010-04-15
I have an application that I would like to be a child process called by a custom Cprogram that I write.  I do not know any way to terminate the child process progmatically hence I was thinking I could run it as a child process and when I was ready to shut down call a function in the parent program which would also terminate the child process along with the parent.

Is this possible?
0
Comment
Question by:larrykizziah
1 Comment
 
LVL 3

Accepted Solution

by:
msmits earned 200 total points
ID: 1253813
On UNIX you can use fork() to create a child process and system() or exec() to start your child application.
The fork() returns the child process id number. You can use this processnumber to send a kill signal to the child.

If you are using DOS, this is close to impossible as child process or processes are not supported.

If you are using WinNT and Win95, there are CreateProcess() and TerminateProcess().

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question