Need help in getting the process name based on the pid in aix
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I need to write a C program in AIX environment which will give me the process name. I can get the pid but not the process name based on the pid. Any specific system calls available in aix environment?? Thanks 回答1: getprocs is likely what you want. I created this under AIX 5.x. I have a little routine that cycles thru all processes and dumps their information. while (( numproc = getprocs ( pinfo , sizeof ( struct procsinfo ), NULL , 0 , & index , MAXPROCS )) > 0 ) { for ( i = 0 ; i < numproc ; i ++) { /* skip zombie processes */ if