SIGCHLD

From Wikipedia, the free encyclopedia

SIGCHLD
Description: Child process terminated or stopped
Default action: Ignore the signal
SA_SIGINFO macros
CLD_EXITED child has exited
CLD_KILLED child has terminated abnormally and did not create a core file
CLD_DUMPED child has terminated abnormally and created a core file
CLD_TRAPPED traced child has trapped
CLD_STOPPED child has stopped
CLD_CONTINUED stopped child has continued

On POSIX-compliant platforms, SIGCHLD is the signal thrown by computer programs when a child process terminates. The symbolic constant for SIGCHLD is defined in the header file signal.h. Symbolic signal names are used because signal numbers can vary across platforms.

On Linux, SIGCLD is a synonym for SIGCHLD.

Contents

SIG is a common prefix for signal names. CHLD and CLD are abbreviations for child.

In Unix, a process can have children, created by fork or similar system calls. The parent, if available, is notified of the termination of a child process via a SIGCHLD signal. The parent does not need to register for it via the signal system call since it gets this signal by default. This signal can be ignored by the parent if needed.

Main article: Zombie process

Ignoring the SIGCHLD signal will create "zombies": The operating system will keep status information about the terminated child (in particular, the return code) until the parent executes the wait() system call to receive this information.

In some situations this might be acceptable: Zombies use only few system resources and disappear when their parent process terminates. But careful programmers will always have programs wait for their children. In general, a program should use a SIGCHLD signal handler that executes wait in order to avoid zombies.

In Perl, setting $SIG{'CHLD'}="IGNORE" will, in fact, install such a signal handler. In Python, signal.signal(signal.SIGCHLD, signal.SIG_IGN) will do the same.


POSIX Signals
SIGABRT | SIGALRM | SIGFPE | SIGHUP | SIGILL | SIGINT | SIGKILL | SIGPIPE | SIGQUIT | SIGSEGV | SIGTERM | SIGUSR1 | SIGUSR2 | SIGCHLD | SIGCONT | SIGSTOP | SIGTSTP | SIGTTIN | SIGTTOU | SIGBUS | SIGPOLL | SIGPROF | SIGSYS | SIGTRAP | SIGURG | SIGVTALRM | SIGXCPU | SIGXFSZ | Realtime Signals are user definable—SIGRTMIN+n through SIGRTMAX.
Common non-POSIX signals and synonyms
SIGIOT | SIGEMT | SIGSTKFLT | SIGIO | SIGCLD | SIGINFO | SIGPWR (SIGINFO) | SIGLOST | SIGWINCH | SIGUNUSED
Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.