一、进程与信号之概念与结构

认识进程

ps -ef |more

UID         PID   PPID  C STIME TTY          TIME CMD
root          1      0  0 19:06 ?        00:00:04 /sbin/init auto noprompt
root          2      0  0 19:06 ?        00:00:00 [kthreadd]
root          3      2  0 19:06 ?        00:00:00 [ksoftirqd/0]
root          4      2  0 19:06 ?        00:00:00 [kworker/0:0]
root          5      2  0 19:06 ?        00:00:00 [kworker/0:0H]

进程在内核中的结构

内核进程task_struct通过file_struct 操作文件

linux内核源码task_struct

cd /usr/src/linux-headers-4.4.0-28/include/linux

ls sched.h

vim sched.h  

vi 下搜索 进程指针结构体
:/task_struct

1380 struct task_struct {
1381         volatile long state;    /* -1 unrunnable, 0 runnable, >0 stopped */
1382         void *stack;
1383         atomic_t usage;
1384         unsigned int flags;     /* per process flags, defined below */
1385         unsigned int ptrace;

vi 下搜索 文件指针结构体
:/struct file

1564 /* open file information */
1565         struct files_struct *files;

 

 

转载于:https://www.cnblogs.com/peixiguang/p/5812460.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值