"Linux Advanced Programming" (tenth) Linux asynchronous signal processing mechanism

Source: Internet
Author: User

Send Signal

Kill the current terminal with the KILL command at the terminal

R

As above, when using kill-sigcont 2563 , the terminal ignores the signal

When using kill-sigabrt 2563 , the terminal exits. Need to re-enter user name password login.

int Kill (__pid_t __pid, int __sig) : Sends a signal to the specified process . The first parameter is the process number to pass the signal, and the second parameter is the signal value to send.

int raise (int __sig) : Sends a signal to the current process that wakes up a process. Returns 0 successfully, otherwise returns-1.

Equivalent to

if int __sig) = =-1)    perror ("raise");

Using the Raise function

if 0 )    perror ("Failed to raise SIGUSR1");

unsigned int alarm (unsigned int __seconds) : Generates a SIGALRM signal to the current process within a specified time. Each time this function is called, a signal is generated, not a loop that generates a signal. The process terminates execution when the signal is received by default.

"Linux Advanced Programming" (tenth) Linux asynchronous signal processing mechanism

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.