成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

exit 中文man頁面

系統
函數 exit() 使得程序正常中止,status & 0377 的值被返回給父進程 (參見 wait(2)) 。所有用 atexit() 和 on_exit() 注冊的函數都以與注冊時相反的順序被依次執行。使用 tmpfile() 創建的文件被刪除。

NAME

exit - 使程序正常中止  

SYNOPSIS 總覽

#include <stdlib.h>

void exit(int status);

DESCRIPTION 描述

函數 exit() 使得程序正常中止,status & 0377 的值被返回給父進程 (參見 wait(2)) 。所有用 atexit()on_exit() 注冊的函數都以與注冊時相反的順序被依次執行。使用 tmpfile() 創建的文件被刪除。

C 標準定義了兩個值 EXIT_SUCCESSEXIT_FAILURE,可以作為 exit() 的參數,來分別指示是否為成功退出。  

RETURN VALUE 返回值

函數 exit() 不會返回。  

CONFORMING TO 標準參考

SVID 3, POSIX, BSD 4.3, ISO 9899 (``ANSI C'')  

NOTES 要點

在 exit 處理過程中,可能會使用 atexit()on_exit() 注冊其他的函數。通常,***注冊的函數被從已注冊函數鏈中摘下來,然后執行。如果在處理過程中,又調用了 exit()longjmp(),那么發生的行為是未定義的。

相對于使用 0 和非零值 1 或 -1,使用 EXIT_SUCCESS 和 EXIT_FAILURE 可以稍微增加一些可移植性 (對非 Unix 環境)。特別的,VMS 使用一種不同的約定。

BSD 試圖標準化退出代碼 - 參見文件 <sysexits.h>

exit() 之后,退出狀態必須傳遞給父進程。這里有三種情況。如果父進程已設置了 SA_NOCLDWAIT,或者已將 SIGCHLD 的處理句柄設置成了 SIG_IGN,這個狀態將被忽略。這時要退出的進程立即消亡。如果父進程沒有表示它對退出狀態不感興趣,僅僅是不再等待,那么要退出的程序變成一個僵尸進程 (``zombie'',除了包含一個字節的退出狀態外,什么也不是)。這樣在父進程后來調用 wait() 函數族之一時,可以得到退出狀態。

如果所用實現支持 SIGCHLD 信號,信號將被發送到父進程。如果父進程已設置了 SA_NOCLDWAIT,它被取消定義。(?)

如果進程是一個 session leader,它的控制終端是會話的控制終端,那么這個終端的前臺進程組的每個進程都將收到 SIGHUP 信號;終端將與這個會話斷開,可以再被一個新的控制進程獲得。

如果進程的退出使得一個進程組成為孤兒,并且這個新近成為孤兒的進程組中任何的進程被中止,進程組中所有的進程將依次收到 SIGHUP 和 SIGCONT 信號。  

SEE ALSO 參見

_exit(2), wait(2), atexit(3), on_exit(3), tmpfile(3)

#p#

NAME

exit - cause normal program termination  

SYNOPSIS

#include <stdlib.h>

void exit(int status);

DESCRIPTION

The exit() function causes normal program termination and the the value of status & 0377 is returned to the parent (see wait(2)). All functions registered with atexit() and on_exit() are called in the reverse order of their registration, and all open streams are flushed and closed. Files created by tmpfile() are removed.

The C standard specifies two defines EXIT_SUCCESS and EXIT_FAILURE that may be passed to exit() to indicate successful or unsuccessful termination, respectively.  

RETURN VALUE

The exit() function does not return.  

CONFORMING TO

SVID 3, POSIX, BSD 4.3, ISO 9899 (``ANSI C'')  

NOTES

During the exit processing, it is possible to register additional functions with atexit() and on_exit(). Always the last-registered function is removed from the chain of registered functions, and invoked. It is undefined what happens if during this processing either exit() or longjmp() is called.

The use of EXIT_SUCCESS and EXIT_FAILURE is slightly more portable (to non-Unix environments) than that of 0 and some nonzero value like 1 or -1. In particular, VMS uses a different convention.

BSD has attempted to standardize exit codes - see the file <sysexits.h>.

After exit(), the exit status must be transmitted to the parent process. There are three cases. If the parent has set SA_NOCLDWAIT, or has set the SIGCHLD handler to SIG_IGN, the status is discarded. If the parent was waiting on the child it is notified of the exit status. In both cases the exiting process dies immediately. If the parent has not indicated that it is not interested in the exit status, but is not waiting, the exiting process turns into a "zombie" process (which is nothing but a container for the single byte representing the exit status) so that the parent can learn the exit status when it later calls one of the wait() functions.

If the implementation supports the SIGCHLD signal, this signal is sent to the parent. If the parent has set SA_NOCLDWAIT, it is undefined whether a SIGCHLD signal is sent.

If the process is a session leader and its controlling terminal the controlling terminal of the session, then each process in the foreground process group of this controlling terminal is sent a SIGHUP signal, and the terminal is disassociated from this session, allowing it to be acquired by a new controlling process.

If the exit of the process causes a process group to become orphaned, and if any member of the newly-orphaned process group is stopped, then a SIGHUP signal followed by a SIGCONT signal will be sent to each process in this process group.  

SEE ALSO

_exit(2), wait(2), atexit(3), on_exit(3), tmpfile(3)

責任編輯:韓亞珊 來源: CMPP.net
相關推薦

2011-08-15 10:21:09

man中文man

2011-08-24 16:48:36

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-11 15:03:21

ACCESS中文man

2011-08-11 15:28:43

ali中文man

2011-08-11 16:31:49

biff中文man

2011-08-11 17:16:43

cce中文man

2011-08-11 18:05:04

chvt中文man

2011-08-11 18:13:07

clear中文man

2011-08-12 09:13:02

df中文man

2011-08-12 09:38:06

dircolors中文man

2011-08-12 09:44:37

dirname中文man

2011-08-12 10:20:02

echo中文man

2011-08-12 10:25:55

eject中文man

2011-08-12 11:07:19

git中文man

2011-08-12 13:18:19

head中文man

2011-08-12 13:49:23

hostid中文man

2011-08-12 13:54:46

hostname中文man

2011-08-12 14:53:56

kill中文man
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 日韩欧美手机在线 | 国产精品99久久久久久www | www.99精品 | 欧美一级欧美三级在线观看 | 精彩视频一区二区三区 | 国产亚洲一区二区三区在线观看 | 欧美网站一区二区 | 中文字幕国产 | 午夜免费精品视频 | 九九精品在线 | 国产在线精品一区二区三区 | 日韩欧美三区 | 精品久久久一区 | 国产高清免费 | 久久久久久久电影 | 日韩视频1| 中文在线日韩 | 国产精品久久久久一区二区三区 | 久久精品亚洲精品国产欧美 | 欧美大片久久久 | 91中文在线观看 | 欧美激情在线播放 | 亚洲黄色成人网 | 人人鲁人人莫人人爱精品 | 亚洲日韩第一页 | 国产高清在线精品 | 国产精品特级毛片一区二区三区 | 精品国产一区二区三区久久 | 婷婷色国产偷v国产偷v小说 | 国产高清一区二区三区 | 黄色免费在线观看 | 在线免费黄色小视频 | 日韩一区精品 | 亚洲成人免费视频 | 亚洲国产高清高潮精品美女 | 欧美一级视频在线观看 | 免费激情av | 风间由美一区二区三区在线观看 | 一区二区三区视频 | 中文字幕亚洲区 | 日韩欧美一区二区三区在线播放 |