[Learning notes] orphan process zombie process

Source: Internet
Author: User

#include <stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<errno.h>#include<signal.h>/*Orphan process int main (void) {pid_t pid;    PID = fork ();        if ( -1 = = pid) {perror ("fork err");    return 0;    } if (pid > 0) {;    } if (0 = = pid) {sleep (199); } return 0;}*///Zombie Process//Avoid the method: Create a child process can not pipe process, let the Linux kernel to pipe//Signals: Handling events asynchronously is a mechanism.//The implication is that our program can support asynchronous invocation of signal processing functions while sequentially executing.//stand on the Linux kernel's point of view.intMainvoid) {pid_t pid; //Ignore child process dead signal by signal registration functionsignal (SIGCHLD, sig_ign); PID=Fork (); if(-1==pid) {Perror ("Fork Err"); return 0; }    if(PID >0) {Sleep ( -); }    if(0==pid)    {        ; }            return 0;}

Copy to Google TranslateTranslation Results

[Learning notes] orphan process zombie process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.