Hi,

I'm having a problem creating two child and manipulating signals.

My problem with forking is that when I do:

int main() {
pid = fork();
pid2 = fork();
}

This create more than two forks, so how do i create exactly two forks?

And for each child to do the following:
- execl
- have pid catch ctrl-c and totally ignore ctrl-\ after ctrl-c is pressed
- have pid2 catch ctrl-\ and totally ignore ctrl-c after ctrl-\ is pressed

Recommended Answers

All 3 Replies

Try using an if statement

Try using an if statement

Hi, thanks for the replay

But, how do I check if I'm execling a grandchild or a actual child?

fork system call returns the process id of the child and parent. You could use this information

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.