linux中pid gid tgid tid的区别和联系
来源:互联网 发布:telnet 80端口不通 编辑:程序博客网 时间:2024/06/08 17:06
getpid : 取得process id,对于thread,就是取得线程对应进程的id;
对应的system call:
asmlinkage long sys_getpid(void)
1614 {
1615 return current->tgid;
1616 }
tgid = thread group id
/////////////////////////////////////////////////////////////////////////
gettid:取得线程id,如果是process,其实就等于getpid:
#define gettid() syscall(__NR_gettid)
对应的system call:
/* Thread ID - the internal kernel "pid" */
1761 asmlinkage long sys_gettid(void)
1762 {
1763 return current->pid;
1764 }
getgid:取得group id,就是user的group id
和用id命令得到的group id是一回事:
bash-3.1$ id
uid=3013(xxx) gid=300(xxxx) groups=300(xxxx),301(platform),505(fpgadrv),9022(gsm)
对于一个thread来说,在kenerl中可以看到他的process id(tgid),还可以看到他的thread id(pid
0 0
- linux中pid gid tgid tid的区别和联系
- Linux pid,tgid关系
- linux中pid,tid, 以及 真实pid的关系
- linux中pid,tid, 以及 真实pid的关系
- Linux下线程pid和tid
- Linux下线程pid和tid
- Linux pid tid说明
- Linux C++中获取指定pid、tid的CPU与内存占用信息
- Linux C++中获取指定pid、tid的CPU与内存占用信息
- Linux C++中获取指定pid、tid的CPU与内存占用信息
- current->pid && current->tgid
- linux中的pid与tid
- Linux 用户管理中UID和GID的研究
- linux 概念之pid tid区分
- Linux中profile、bashrc、bash_profile之间的区别和联系
- Linux中profile、bashrc、bash_profile之间的区别和联系
- Linux中profile、bashrc、bash_profile之间的区别和联系 .
- Linux中profile、bashrc、bash_profile之间的区别和联系
- 把二元查找树转变成排序的双向链表
- kmp算法的实现
- hdu2023求品均成绩
- CodeBlock 快捷键大全
- strcpy和memcpy的区别
- linux中pid gid tgid tid的区别和联系
- leetcode 之 Jump Game
- 常见编程题
- Linux下使用socket传输文件的C语言简单实现
- Eclipse+Spark 开发
- leetcode AC rates over 40%按从高到低
- 静态编译FFMPEG的指令并在工程引用.a文件
- 设置View渐变颜色
- Android WebView 因重定向无法正常goBack()解决方案