首先,从 Activity Monitor 中查看进程 PID,然后使用以下命令查看。

ps xuwww -p PID

另一个办法是,使用系统调用 proc_pidpath 。

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <libproc.h> int main (int argc, char* argv[])
{
pid_t pid; int ret;
char pathbuf[PROC_PIDPATHINFO_MAXSIZE]; if ( argc > ) {
pid = (pid_t) atoi(argv[]);
ret = proc_pidpath (pid, pathbuf, sizeof(pathbuf));
if ( ret <= ) {
fprintf(stderr, "PID %d: proc_pidpath ();\n", pid);
fprintf(stderr, " %s\n", strerror(errno));
} else {
printf("proc %d: %s\n", pid, pathbuf);
}
} return ;
}

最新文章

  1. 学习IT资源分享,欢迎各位知道的学习IT资源前来分享
  2. 在Fedora 20下使用TexturePacker
  3. Windows phone 中一些实用的控件
  4. 添加数据时候获取自增的ID
  5. scaleform mobile sdk for android 多点触摸 修正
  6. linux网络编程:select()函数以及FD_ZERO、FD_SET、FD_CLR、FD_ISSET(转)
  7. c# 字符串切割 split
  8. 谈谈字符集编码及gb2312、utf-8编码原理
  9. C# TreeGridView 实现进程列表
  10. SpringCloud(1)---基于RestTemplate微服务项目案例
  11. Linux-负载均衡LVS
  12. atmega16功耗实测
  13. django用MySQL数据库链接
  14. html,css学习实践总结
  15. python之旅第八篇--异常
  16. ubuntu下chrome浏览器安装flash插件(pepperflashplugin-nonfree)
  17. android中通过intent传递复杂数据
  18. web api 跨域访问
  19. Linux基础命令---显示登录用户logname
  20. Task Parallel Library02,更进一步

热门文章

  1. CVE-2018-10933 LibSSH auth bypass
  2. UVa1048 Low Cost Air Travel——最短路
  3. mysql_config_editor设置
  4. 第一份c语言作业
  5. BZOJ 4009: [HNOI2015]接水果 (整体二分+扫描线 树状数组)
  6. ORM高阶补充:only, defer,select_related
  7. SQL Server 基础之《学生表-教师表-课程表-选课表》(一)
  8. luogu P4194 矩阵
  9. Codevs 1298 凸包周长
  10. Solr6.0创建新的core