- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
(gdb) info symbol exit
exit in section .text of /lib64/libc.so.6
(gdb) info symbol _exit
_exit in section .text of /lib64/libc.so.6
有人知道吗?
最佳答案
简单地说,exit
是一个高级函数,您应该调用它来退出进程,它会调用退出处理程序和一些其他高级清理内容。 _exit
是一个低级清理函数,它被称为 exit
的最后一步。 exit
将真正终止进程(通过 exit 系统调用)。
来自 glibc 手册在http://www.gnu.org/software/libc/manual/html_mono/libc.html (详情请查看 glibc 的源代码):
25.6.1 Normal Termination
A process terminates normally when its program signals it is done by calling exit. Returning from main is equivalent to calling exit, and the value that main returns is used as the argument to exit.
— Function: void exit (int status)
The exit function tells the system that the program is done, which causes it to terminate the process.
status is the program's exit status, which becomes part of the process' termination status. This function does not return.
Normal termination causes the following actions:
Functions that were registered with the atexit or on_exit functions are called in the reverse order of their registration. This mechanism allows your application to specify its own “cleanup” actions to be performed at program termination. Typically, this is used to do things like saving program state information in a file, or unlocking locks in shared data bases.
All open streams are closed, writing out any buffered output data. See Closing Streams. In addition, temporary files opened with the tmpfile function are removed; see Temporary Files.
_exit is called, terminating the program. See Termination Internals.
在“终止内部”部分:
25.6.5 Termination Internals
The _exit function is the primitive used for process termination by exit. It is declared in the header file unistd.h.
— Function: void _exit (int status)
The _exit function is the primitive for causing a process to terminate with status status. Calling this function does not execute cleanup functions registered with atexit or on_exit.
关于exit - libc.so 中的 exit 和 _exit 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5576549/
回答this question , 有人说要用 _Exit()和其他人说使用 _exit() .有人可以解释两者之间的区别(如果有的话),以及两者的起源吗? 最佳答案 直接来自手册页 here : T
多时候我们需要在程序退出的时候做一些诸如释放资源的操作,但程序退出的方式有很多种,比如main()函数运行结束、在程序的某个地方用exit() 结束程序、用户通过Ctrl+C或Ctrl+break操
我想在 delphi xe3 中使用 c obj 文件。 链接 obj 文件时,显示此错误: `[dcc32 Error] Unit1.pas(149): E2065 Unsatisfied forw
我可以使用 atexit 或析构函数来确定我的应用程序上次终止是否是由于调用 exit() 所致。有什么方法可以确定我的应用程序上次终止是否是由于 _exit() 导致的? 最佳答案 来自man pa
我感兴趣的是我是否可以在 _exit(2) 调用中调用任意函数,这会绕过其他 Hook 架构,所以这对我来说似乎并不容易。 如果这是一个普通的 exit(3) 或 return 语句,显然可以通过 a
很抱歉重复一个已反复提出的问题,但我找不到具体提及内存问题的内容。如果一个进程以 _exit(0) 或 _Exit(0) 终止,它的内存块会丢失给操作系统吗?谢谢,-nuun 最佳答案 对于几乎所有不
我是C和Linux的新手,只是系统调用方面的一个问题: 那么,为什么_exit有一个下划线前缀而其他人没有? 最佳答案 系统调用_exit如此命名,以区别于库函数exit。 在大多数情况下,程序应使用
我一直在尝试使用 ARM mbed 库创建一个组织有序的 makefile 项目模板。我已经解决了一些问题(与头文件路径相关的 see this post)。但是,现在我遇到了链接器的问题。我的目标是
为什么它显示不同的输出???任何人都可以深入解释我。 1. #include #include int main (void) { printf ("Using exit ... \ n");
import os os.exit(0) 有没有办法在操作系统中导入特定模块,而不是导入整个模块? (这可以使我的程序在使用时更有效率。) 最佳答案 from os import _exit 此代码应
所以简短的总结是-我有一个程序递归搜索具有特定扩展名的文件。每次找到一个,它都会制作一个副本,对副本进行一些更改,创建一个补丁(通过使用 diff 和 execvp())并删除原始文件。 我遇到的问题
我想测试一个函数是否在失败时执行 os._exit(2)。我见过许多使用 SystemExit 的 sys.exit() 解决方案。我已经阅读了 Python3和 Python2文档,似乎 os._e
考虑这个代码片段: pid_t cpid = fork(); if (cpid == -1) { perror("fork"); exit(EXIT_FAILURE); } if (c
请看一下这个示例代码,它使用非常成熟的编程模式将 stdout 重定向到管道。 #include #include int main(int argc, char **argv) { in
我在看论文Size Is EverythingSize Is Everything使用内核 3.8.4 x64 nasm gcc-4.7.2 fedora 在 moretiny.asm 中输入 BIT
C99 提供了 _Exit 函数,它“立即”退出,尽管它确实 可能会关闭文件描述符。 Unix/POSIX 通过强制关闭所有 fd 而不刷新(并提供同义词 _exit)来扩展此行为。 当从 C++ 程
所以,我将从子线程退出回到父线程。我正在使用 _exit() 系统调用。我想知道一些事情。其中之一是我的 child 的 _exit 参数是什么。这是我的子进程正在执行的代码: printf("\n*
关于 fork() 有很多问题,但我对这段代码有点困惑。我正在用 c++ 分析一段代码,因为我得到了这个函数。 int daemon(int nochdir, int noclose) { swi
我有一个 AttributeError: '_MainProcess' object has no attribute '_exiting' 来自 Python 应用程序。不幸的是,这段代码必须运行
我有一个 Linux x86-32 GAS 汇编程序这样终止: movl $1, %eax movl $0, %ebx # argument for _exit int $0x80 当我这样退出时,程
我是一名优秀的程序员,十分优秀!