函數(shù)說(shuō)明
The? kill()? system? call can be used to send any signal to any process
group or process.-------------------------------向進(jìn)程發(fā)送一個(gè)信號(hào)
kill()可以用來(lái)傳送參數(shù)sig指定的信號(hào)給參數(shù)pid指定的進(jìn)程。參數(shù)
pid有幾種情況:
pid>0 將信號(hào)傳給進(jìn)程識(shí)別碼為pid 的進(jìn)程。
pid=0 將信號(hào)傳給和目前進(jìn)程相同進(jìn)程組的所有進(jìn)程
pid=-1 將信號(hào)廣播傳送給系統(tǒng)內(nèi)所有的進(jìn)程
pid<0 將信號(hào)傳給進(jìn)程組識(shí)別碼為pid絕對(duì)值的所有進(jìn)程



可以在兩個(gè)終端上運(yùn)行,ps -A查看進(jìn)程號(hào),可以看到已殺死!