exit.2

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 2 代码 · 共 79 行

2
79
字号
.\" SCCSID: @(#)exit.2	2.1	3/10/87.TH exit 2.SH Name_exit \- terminate a process.SH Syntax.nf#include <stdlib.h>void _exit(\fIstatus\fP)int \fIstatus\fP;.fi.SH Description.NXR "_exit system call".NXR "process" "terminating"The function,.PN _exit ,terminates a calling process with the following consequences:.IP \(bu 5All of the file descriptors open in the calling process are closed..IP \(bu 5If the parent process of the calling process is executing a.PN wait ,it is notified of the calling process's termination andthe low-order eight bits of \fIstatus\fP are made available to it.For further information, see.MS wait 2 ..IP \(bu 5The parent process ID of all of the calling process's existing childprocesses and zombie processes are also set to 1.   This means that the initialization processinherits each of these processes as well.For further information, see.MS intro 2 ,.IP \(bu 5Each attached shared memory segment is detachedand the value of \fIshm_nattach\fP in the data structureassociated with its shared memory identifier is decremented by 1..IP \(bu 5For each semaphore for which the calling process has seta semadj value, (see .MS semop 2 , ) that semadj value is added to the semval of the specified semaphore..IP \(bu 5If the process has a process, text, or data lock, anunlock is performed..IP \(bu 5An accounting record is written on the accounting fileif the system's accounting routine is enabled. For more information, see.MS acct 2 ..PP Calling.PN _exitdirectly circumvents all cleanup.Most C programs call the library routine.MS exit 3 ,which performs cleanup actions in the standard I/O library beforecalling .PN _exit ..PP.SH Environment.SS POSIX, System VThe .PN _exitfunction differs from the System V as well as POSIX definition in that even ifthe calling process is a process group leader, the SIGHUP signal is not sent to each process that has aprocess group ID equal to that of the calling process..PPThe.PN _exitfunction also differs in that the  .PN exitroutine is declared as type .I intinstead of type .I void..SH See Alsofork(2), wait(2), exit(3), signal(3).

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?