简体   繁体   English

signal(7)和signal(2)有什么区别?

[英]What is the difference between signal(7) and signal(2)?

**Disclosure - I am a beginner C programmer and am not completely familiar with how to interpret the man pages nor the correct word choice in speaking about C - any editing or clarification to this question is appreciated.* **公开 -我是一位C语言初学者,不完全熟悉如何解释手册页,也不了解有关C语言的正确单词选择-请对此问题进行任何编辑或澄清。

Question: I am reading through the man pages on signal(7) and commonly see a reference to signal(2). 问题:我正在阅读signal(7)的手册页,通常会看到对signal(2)的引用。

How is the reference to signal different if I say 'signal(7)' as opposed to 'signal(2)'? 如果我说“ signal(7)”而不是“ signal(2)”,那么对信号的引用有何不同? Does this have to do with 7 being a library call and 2 being a system call? 这与7是库调用而2是系统调用有关吗?

signal(7) is the Signal handling overview. signal(7)是信号处理概述。
http://man7.org/linux/man-pages/man7/signal.7.html http://man7.org/linux/man-pages/man7/signal.7.html

signal(2) is the API-function (a system-call). signal(2)是API函数(系统调用)。
http://man7.org/linux/man-pages/man2/signal.2.html http://man7.org/linux/man-pages/man2/signal.2.html

Anyway, here a section overview for man-pages: http://linux.die.net/man 无论如何,这是手册页的部分概述: http : //linux.die.net/man

1 user commands (introduction)
2 system calls (introduction)
3 library functions (introduction)
4 special files (introduction)
5 file formats (introduction)
6 games (introduction)
7 conventions and miscellany (introduction)
8 administration and privileged commands (introduction)
L math library functions
N tcl functions 

Well, signal() is system dependent, it depends on your OS. 好吧,signal()取决于系统,它取决于您的OS。 As referenced here: 如此处所引用:

   The behavior of signal() varies across UNIX versions, and has also
   varied historically across different versions of Linux.  Avoid its
   use: use sigaction(2) instead.  See Portability below.

Src SRC

signal(2) on linux access the manual, however linux上的signal(2) 访问该手册,但是

Overview of signal 信号概述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM