C ++如何获取父进程标识 [英] C++ How to fetch Parent Process Id
本文介绍了C ++如何获取父进程标识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在C ++(或STL)中是否有一个API来获取父进程标识?如果不是那么可以是可移植代码这样做呢?
我理解有linux api例如getppid可以在unix平台上做这个工作,但是什么在Windows上等同?
Is there an API in the C++ (or STL) to fetch the parent process id? if not then what could be the portable code to do so? I understand there linux api such as getppid can do the job on unix platforms but what is equivalent of the same on windows?
谢谢!
推荐答案
以下链接将引导您
http://www.codeproject.com/Articles/9893/Get-Parent-Process-PID
https://gist.github.com/253013 / d47b90159cf8ffa4d92448614b748aa1d235ebe4
这篇关于C ++如何获取父进程标识的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文