more powerful. In addition to the basic notification function, it can also transmit additional information.
There are two sources for the occurrence of signal events: hardware sources (for example, we press the keyboard or other hardware faults); software sources, the most common system function for sending signals is kill, raise,Alarm, setimer, and sigqueue functions. The software source also includes some illegal operations.
2. Category
In earlier Unix systems, only 32 types of signals are
Basics of Linux Learning
1, what is Linux?
To be exact, the Linux kernel (the core program of the system), whose kernel copyright belongs to Linus Torvalds, is issued under the GPL (GNU general public License) Copyright Agreement, and anyone can copy (copy) and modify ( Change), package distribution (distribute), sales, but can not add any restrictions at the tim
In Unix programming, learning to use fork and signal is quite basic.
Fork () and signal are often used in daemon resident programs, such as a4c. tty, yact, and chdrv are also useful for most large programs, such as Mozilla, Apache, and squid.
Although programming in UNIX does not require much thread functionality, almost all threads already exist in modern job systems. Pthread is a thread function library in Linux. If you want to write a multi-threade
Linux Process ManagementProcess is: Running the programAllocation units for resources: memory resources, CPU resources, I/O resourcesKernel Features: Process managementThe kernel manages processes through resource allocation.How is the CPU resource allocated?Cutting time slice, time slice rotationInter-process switching: Save the scene, especially the instruction pointer, the address where the next instruction is locatedSave site:Save the metadata for
TerminalSIGXGPU terminating process CPU time-outSIGXFSZ termination process file length too longSigwinch ignoring signal window size changesSIGPROF terminating process statistics distribution graph with timer to timeSIGUSR1 terminating a process user-defined signal 1SIGUSR2 terminating a process user-defined signal 2SIGVTALRM terminating process virtual timer to time1) SIGHUP this signal at the end of the user terminal connection (normal or abnormal) issued, usually in the terminal controlAt th
. Execute code directly down3) The return value of the sleep function, which is the remaining number of secondsRaiseRaiseSend a signal to yourself. Raise (SIG) is equivalent to Kill (Getpid (), SIG);KillpgSends a signal to the process group. KILLPG (Pgrp, SIG) is equivalent to Kill (-pgrp, SIG);SigqueueSends a signal to the process, supports queuing, and can be accompanied by information.Pause () functionSet the process to an interruptible sleep state. It then calls the kernel function schedule
command's return result is obtained using the wifexited related macro; failure returns-1, We can use the Perro () function or the strerror () function to get useful error information.This article deals only with the simple use of the system () function, and does not talk about the effects of SIGCHLD, SIGINT, and Sigquit on system () functions, and in fact, this article was written today because the system was used by someone in the project () The fun
in printf ("Recv a sig=%d\n", SIG); Sleep (5);} int main (int argc, char *argv[]) { struct sigaction act; Set the response function Act.sa_handler = handler; Set the shield character member Sigemptyset (act.sa_mask); Sigaddset (act.sa_mask, sigquit); act.sa_flags = 0; Register the response signal SIGINT function sigaction (SIGINT, act, NULL); Pause (); return 0;}Sigqu
TerminalSIGXGPU terminating process CPU time-outSIGXFSZ termination process file length too longSigwinch ignoring signal window size changesSIGPROF terminating process statistics distribution graph with timer to timeSIGUSR1 terminating a process user-defined signal 1SIGUSR2 terminating a process user-defined signal 2SIGVTALRM terminating process virtual timer to time1) SIGHUP this signal at the end of the user terminal connection (normal or abnormal) issued, usually in the terminal controlAt th
Linux provides a mechanism for signaling process messages, what is a signal? It is a very short message, short to just one number. It is worth emphasizing that the signal and semaphore are only one word short, but they are completely different concepts, the semaphore is only used to synchronize the code snippet, and the signal is used to pass the message.First, the signal number: through the kill-l command can be seenSecond, the signal mechanism can b
the Solaris Thread Library and is not typically used
Sigchld
When a process terminate or stops, SIGCHLD sends it to its parent process. The signal is ignored by default
Sigcont
When the stop process resumes running, it automatically sends
Sigemt
and implementation-related hardware exceptions
Sigfpe
Math-related exceptions, such as being removed by 0, floating point overflow, etc.
Sigfreeze
Solaris dedicated, hiberate or suspended time to send
Sighup
Sent to the controlling Process w
After this period of time to learn, I also have a certain understanding of Linux, today this blog on the previous knowledge of a summary it.The previous Linux learning blog, from the top down is learning in-depth process, my blog link is as follows:First: Analysis of the Linux operating system how the computer starts and how it operatesChapter Two: Analysis of
Linux UsersLinux is a multi-user task system. Each user account can belong to one or more groups. In the/etc/passwd. Store user account information[Email protected] ~]# HEAD/ETC/PASSWDRoot:x:0:0:root:/root:/bin/bashBin:x:1:1:bin:/bin:/sbin/nologinDaemon:x:2:2:daemon:/sbin:/sbin/nologinAdm:x:3:4:adm:/var/adm:/sbin/nologinLp:x:4:7:lp:/var/spool/lpd:/sbin/nologinSync:x:5:0:sync:/sbin:/bin/syncShutdown:x:6:0:shutdown:/sbin:/sbin/shutdownHalt:x:7:0:halt:/s
Pipes and famous pipes
In this series, the author outlines several key means of communication between Linux processes. Among them, pipelines and well-known pipelines are one of the earliest interprocess communication mechanisms, pipelines can be used for communication between relational processes, and a well-known pipeline overcomes the limitations of a pipe without a name, so it allows communication between unrelated processes in addition to the fun
20 most common Linux commands to explain
People who have played Linux will know that there are many commands in Linux, but people who have played Linux never bother because Linux commands are so much, because we only need to master the commands we use most often. Of course,
Using SSH to transfer files between Linux and Linux,linux and WindowsTransferring files between Linux and Linux:SCP file [email protected]: Document Address Example:SCP Abc.txt [Email protected]:/home/endall/abc.txtTransferring files between Windows and Linux:The author uses Putty's built-in PSCP. Other such as SSH Sec
Linux knowledge point Review: single-user mode, rescue mode, clone Virtual Machine and Linux machine logon explanation, linux knowledge point1.13 single-user mode
In linux, when the password is forgotten, the password is changed (prerequisite: the password must be manually operated on a physical machine or server)
At t
1.The number of files in/usr/include/Linux and/usr/src/Linux/include/Linux is notThe number of folders varies. For example, the/usr/include/Linux does not have the mosules folder, while the/usr/src/Linux/include/LinuxThis folder is available.
/Usr/src/
Linux entry record: 16. Multi-command collaboration in Linux: pipelines and redirection, linux redirectionI. Multi-command collaboration
In Linux, most commands are very simple, and there are few complex functional commands. Each command often only implements one or more simple functions. By combining commands of diffe
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.