我知道 PCB 是一个数据结构,其中包括父进程 id(pPID)、进程 id(PID)、指针等。有没有办法在不使用 getppid 函数的情况下找到父进程的 PID?
The fields of /proc/self/stat
(as documented in proc(5) ) include PPID. Take care in parsing as comm
may contain spaces and other unusual characters.
(But I second @JohnZwinck's comment. Why?)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.