作者florenceL (佛羅倫斯)
看板C_and_CPP
標題Fw: [問題] exit沒有執行?
時間Sat Oct 31 16:41:22 2015
※ [本文轉錄自 Programming 看板 #1MD6VSJH ]
作者: florenceL (佛羅倫斯) 看板: Programming
標題: [問題] exit沒有執行?
時間: Sat Oct 31 15:03:52 2015
各位版友好
想請問一下
我在server程式中fork出一個child執行execlp("/bin/exit","exit");
但是跑起來server沒有被關掉
但是我自己在server的shell手打上exit卻會關掉server端,
想請問是甚麼原因?
以及 execlp是哪裡寫錯了?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.115.53.27
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Programming/M.1446275036.A.4D1.html
※ florenceL:轉錄至看板 Linux 10/31 16:25
※ 發信站: 批踢踢實業坊(ptt.cc)
※ 轉錄者: florenceL (140.115.53.27), 10/31/2015 16:41:22
1F:→ fatrabitree: 你那樣寫的意思不是你fork的Child執行exit而已嗎? 10/31 17:34
2F:→ fatrabitree: parent沒有執行Exit 10/31 17:35
3F:→ fatrabitree: 不過也沒有/bin/exit這個東東我記得 10/31 17:35
4F:→ florenceL: 那想請問大大 要怎麼在CHILD的程式範圍關掉PARENT 10/31 17:59
5F:推 mars90226: 你fork出來的child已經跟parent無關啦,要從parent關 10/31 18:05
6F:推 s25g5d4: 送 signal 給 parent process 10/31 22:43