06-09-2005
catch SIGCHLD signal in parent process
I want to catch SIGCHLD signal in parent process. I can't use wait() system call to catch SIGCHLD according to project requirment.
Operating system linux 3.1
can any one have a solution for this.
Thanking you,
ranjan
10 More Discussions You Might Find Interesting
1. Programming
Hi,
I have an c++ application which uses the function fork and execvp().
The parent does not wait until the child ends. The parents just creates children and let them do their stuff.
You can see the parent program as a batch-manager.
I have added a SIGCHLD handler to the program:
void... (3 Replies)
Discussion started by: jens
3 Replies
2. UNIX for Dummies Questions & Answers
I want to know whicj process send the signal SIGCHLD to the parent's child.
Thank you in advance, (1 Reply)
Discussion started by: Puntino
1 Replies
3. UNIX for Dummies Questions & Answers
Hi All,
I facing a problem in handling signals between parent process communication. I am trying to send a signal(SIGINT) from child to parent. I am using kill function to do so and I am trying to read the signal using sigaction(). But the program is ending abruptly and I am not able to figure out... (4 Replies)
Discussion started by: vkn_1985
4 Replies
4. Programming
catch signal SIGPIPE ,print errno but it's value equal to 2(ENOENT)
#define ENOENT 2 /* No such file or directory */
is it should be EPIPE ?
#define EPIPE 32 /* Broken pipe */
Thanks ! (7 Replies)
Discussion started by: aobai
7 Replies
5. UNIX for Advanced & Expert Users
hi,
I am in a weird situation. I have a parent tarball which contains 2 sub tarballs.
The structure is such :
Parent.tar.gz ---- > child1.tar.gz and child2.tar.gz
I need to get the size of the parent tarball without untaring it
I know that the command is gunzip -c parent.tar.gz | wc -c ... (1 Reply)
Discussion started by: mnanavati
1 Replies
6. Programming
Hello. I want to make a child do some stuff,wait,then the parent does some stuff and then child does some stuff and waits again.I have made the following but it does not work.Can anybody help me?
pid1 = fork();
if (pid1 == -1)
{
perror("Can't create child\n");
... (18 Replies)
Discussion started by: Cuervo
18 Replies
7. Programming
Hi, i want that the parent process start before the child, this code doesn't work,
if the child start before the parent it wait for signal, then the father send the signal SIGALRM and the child catch it and call printf;
else the father call printf and send the signal to the child that call its... (1 Reply)
Discussion started by: blob84
1 Replies
8. Emergency UNIX and Linux Support
Hello, everyone.
Here's a program:
pid_t pid = fork();
if (0 == pid) // child process
{
execvp ...;
}
I send a signal (such as SIGINT) to the parent process, the child process receive the signal as well as the parent process.
However I don't want to child process to receive the... (7 Replies)
Discussion started by: jackliang
7 Replies
9. AIX
Hi All,
Anyone have any shell script to capture the zombie process, as according to the support they need the real time zombie PID, they only provide the
kdb
(0) > p* |grep -i defunct
(0) > p * | grep <hex pid>
But this is doesn't seem easy to catch the zombie as it is not always... (1 Reply)
Discussion started by: ckwan
1 Replies
10. Shell Programming and Scripting
Hi everyone
i am very new to linux , working on bash shell.
I am trying to solve the given problem
1. Create a process and then create children using fork
2. Check the Status of the application for successful running.
3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies
LEARN ABOUT OPENDARWIN
_exit
EXIT(2) BSD System Calls Manual EXIT(2)
NAME
_exit -- terminate the calling process
SYNOPSIS
#include <unistd.h>
void
_exit(int status);
DESCRIPTION
The _exit() function terminates a process with the following consequences:
o All of the descriptors open in the calling process are closed. This may entail delays, for example, waiting for output to drain; a
process in this state may not be killed, as it is already dying.
o If the parent process of the calling process has an outstanding wait call or catches the SIGCHLD signal, it is notified of the calling
process's termination and the status is set as defined by wait(2).
o The parent process-ID of all of the calling process's existing child processes are set to 1; the initialization process (see the DEFINI-
TIONS section of intro(2)) inherits each of these processes.
o If the termination of the process causes any process group to become orphaned (usually because the parents of all members of the group
have now exited; see ``orphaned process group'' in intro(2)), and if any member of the orphaned group is stopped, the SIGHUP signal and
the SIGCONT signal are sent to all members of the newly-orphaned process group.
o If the process is a controlling process (see intro(2)), the SIGHUP signal is sent to the foreground process group of the controlling ter-
minal, and all current access to the controlling terminal is revoked.
Most C programs call the library routine exit(3), which flushes buffers, closes streams, unlinks temporary files, etc., before calling
_exit().
RETURN VALUE
_exit() can never return.
SEE ALSO
fork(2), sigaction(2), wait(2), exit(3)
STANDARDS
The _exit function is defined by IEEE Std 1003.1-1988 (``POSIX.1'').
4th Berkeley Distribution June 4, 1993 4th Berkeley Distribution