父進程退出之後,子進程會發生什麼?

在linux中,所有進程都有一個共同的父進程systemd,如果父進程退出了,子進程還沒運行結束,子進程會被stsremd收養 下面用一個小程序來驗證一下: #include <cstdio> #include <sys/types.h> #include <unistd.h> #include <errno.h> #include <string.h> int func(int x); in
相關文章
相關標籤/搜索