wget can capture the sighup signal, and ignore it, so even if you quit the Linux login, wget can continue to download.In addition, for daemons with terminal disengagement, this signal is used to notify it to reread the configuration file.2) SIGINTA program termination (interrupt) signal, issued when the user types the intr character (usually ctrl-c), to inform the foreground process group that the process is terminated.3) SigquitSimilar to
Functions of the Linux sigsuspend Function2010-07-08 19:36:30
Category: Linux
UNIX provides a system call to wait for a signal, and sigsuspend is one of them. In Cu (www.chinaunix.net), we have discussed a problem about the system call. Here we will also explain it.
The core issue discussed by Cu users is whether sigsuspend returns first or signal handler returns first. In the book "Advanced Programming fo
article). In addition, in multi-threading, the signal response actions of each thread are the same, and a separate response action cannot be set on a thread.2 Signal TypeThe types of signals supported by Linux can refer to the list given below.2.1 List of signals in the posix.1-1990 standard
Signal
value
Action
Description
SIGHUP
1
Term
Terminal Control process End (terminal connection
is currently executing code for this process, the user-space code for the process pauses execution and the CPU
Switch to a kernel-state processing hardware interrupt.
4. The terminal driver interprets the ctrl-c as a SIGINT signal, which is recorded in the PCB of the process (it can also be said to send a
A SIGINT signal to the process).
5. Before the user-space code returning from the kernel to th
no signal handler is defined, and sets errno as a positive integer value.If an invalid signal is given, or the signal being tried is not captured/not negligible (for example, Sigkill), the errno will be set to Einval.Special VALUES (SIG_IGN,SIG_DFL) can also be used instead of signal processing functions;Sig_ign Ignore SignalSIG_DFL Restore the default signal-----------------------Signal Processing Example: Write a program ctrlc.c, in response to user-typed CTRL + C key combination, print an ap
The Linux-based multi-thread programming and signal processing is an example that is easy to neglect-Linux general technology-Linux programming and kernel information. The following is a detailed description. Linux multi-thread programming and signal processing is easy to neglect.
In the past few days, a network traff
background process groups, are typically part of this session. When the user exits the Linux login, the foreground process group and the background have the process to the terminal output will receive the SIGHUP signal. The default action for this signal is to terminate the process, so the foreground process group and the process with terminal output in the background will be aborted. However, this signal can be captured, such as wget can capture the
)
sighandler_t signal (int signum, sighandler_t handler);
Returns the original signal processing function, or sig_err
Signal () is the simplest function to install a signal processor to a process, the first parameter specifies the signal, and the second parameter assigns a handler function to the signal.
The following is a simple signal processing program that captures SIGUSR1, ignores SIGUSR2, defaults to System processing SIGINT,SIGUSR1 and SIGUSR
1. Representation of signals in the kernel
The processing action of the actually executed signal is called the delivery, the State between the signal generation and the delivery, and the pending ). A process can block a signal. When a blocked signal is generated, it remains in the pending state until the process unblocks the signal. Note that blocking and ignoring are different. As long as the signal is blocked, it will not be delivered. Ignoring is an optional action after delivery. The represe
blocking current process ( wait replace new SIGUSR1 signal ) (2 SIGUSR1 signal, block, program continues to hang, receive other signals, restore original mask ( sigint signal " (3 ( If you first come to SIGUSR1 signal, then come over sigint signal, the signal processing function will be called two times to print different content. First print
Signal Generation, signal processing, other signal functions, one instance
1. Signal Generation
The signals in Linux are similar to those in DOS Int or windows. A trusted signal is sent to the corresponding process when a signal occurs. There are several signals in Linux. We can use the kill-l command to obtain the following output results:
1) sighup 2) SIGINT 3
http://blog.csdn.net/ta893115871/article/details/7475095Signal () function describes Linux functions in detailSignal () function understandingIn the Signal (parameter 1, parameter 2);Parameter 1: The signal we are going to process. The signal of the system we can again terminal type Kill-l view (total 64). Actually these signals are the system-defined macros.Parameter 2: How we handle it (whether the system is default or ignored or captured).Generally
Introduction to Linux programming-Signal Processing-general Linux technology-Linux programming and kernel information. For more information, see the following. Linux signal events
In this chapter, we will discuss the signal processing functions in Linux.
Signal processing fu
Linux Signal Processing-general Linux technology-Linux programming and kernel information. The following is a detailed description. In this chapter, we will discuss the signal processing functions in Linux.
Signal processing functions in Linux:
Signal Generation
Signal Proce
sigsuspend: SIGINT
If the return is based on sig_handler, The SIGINT should not be printed, because at that time the blocked word has not been restored, and all signals are not blocked. So is it Steven s wrong? Of course not. But what did Steven do in sigsuspend's atomic operation?The entire atomic operation process of sigsuspend is:(1) set a new mask to block the current process;(2) receive the signal an
Reprinted from: http://www.cublog.cn/u2/76349/showart_2227666.html
Linux setitimer for computer players commonly used software, then I will learn and study LinuxSetitimer, here to discuss with you how to use Linux setitimer, hope to be useful to everyone. LinuxSetitimer () is a Linux API, not the standard library of C language, LinuxSetitimer () has two function
core State;
(3) The interrupt response is timely, and the signal response usually has a large time delay.
Common Linux signals and their key values:
01 SIGHUP pending (hangup)
02 SIGINT interrupted. When you press ^ c or ^ break from the keyboard
03 SIGQUIT exits. When the user presses the quit key from the keyboard
04 invalid SIGILL command
05 SIGTRAP trace trap: start the process and track Code Exe
);}
// Reasonable reason for sub-thread exit................Return 0;
}
Detected after running the programAfter pressing CTRL + C, the program immediately exits without the information of the Sub-thread exiting, which is very strange.After careful analysis, we found that the problem was that we ignored the features of the multi-threaded model in Linux.Point.
Linux threads are essentially light weightedProcess), the corresponding process control struc
Signal is a very important part in Linux programming. This article will introduce in detail the basic concepts of the signal mechanism, the general implementation of the signal mechanism in Linux, and how to use the signal, and several system calls related to signals.The signal mechanism is a method for transmitting messages between processes. All signals are called Soft Interrupt signals, or soft interrupt
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.