zoukankan      html  css  js  c++  java
  • Linux中进程结构描述符

    include/linux/sched.h
    384   struct task_struct {
    385     volatile long state;
    386     struct thread_info *thread_info;
    387     atomic_t usage;
    388     unsigned long flags; 
    389     unsigned long ptrace;
    390
    391     int lock_depth;
    392
    393     int prio, static_prio;
    394     struct list_head run_list;
    395     prio_array_t *array;
    396
    397     unsigned long sleep_avg;
    398     long interactive_credit;
    399     unsigned long long timestamp;
    400     int activated;
    401
    302     unsigned long policy;
    403     cpumask_t cpus_allowed;
    404     unsigned int time_slice, first_time_slice;
    405
    406     struct list_head tasks;
    407     struct list_head ptrace_children;
    408     struct list_head ptrace_list;
    409
    410     struct mm_struct *mm, *active_mm;
    ...
    413     struct linux_binfmt *binfmt;
    414     int exit_code, exit_signal;
    415     int pdeath_signal;
    ...
    419     pid_t pid;
    420     pid_t tgid;
    ...
    426     struct task_struct *real_parent;
    427     struct task_struct *parent;
    428     struct list_head children;
    429     struct list_head sibling;
    430     struct task_struct *group_leader;
    ...
    433     struct pid_link pids[PIDTYPE_MAX];
    434
    435     wait_queue_head_t wait_chldexit;
    436     struct completion *vfork_done;
    437     int __user *set_child_tid;
    438     int __user *clear_child_tid;
    439
    440     unsigned long rt_priority;
    441     unsigned long it_real_value, it_prof_value, it_virt_value;
    442     unsigned long it_real_incr, it_prof_incr, it_virt_incr;
    443     struct timer_list real_timer;
    444     unsigned long utime, stime, cutime, cstime;
    445     unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
    446     u64 start_time;
    ...
    450     uid_t uid,euid,suid,fsuid;
    451     gid_t gid,egid,sgid,fsgid;
    452     struct group_info *group_info;
    453     kernel_cap_t cap_effective, cap_inheritable, cap_permitted;
    454     int keep_capabilities:1;
    455     struct user_struct *user;
    ...
    457     struct rlimit rlim[RLIM_NLIMITS];
    458     unsigned short used_math;
    459     char comm[16];
    ...
    461     int link_count, total_link_count;
    ...
    467     struct fs_struct *fs;
    ...
    469     struct files_struct *files;
    ...
    509     unsigned long ptrace_message;
    510     siginfo_t *last_siginfo;
    ...
    516   };

    The following categories describe some of the types of things a process descriptor must keep track of during a process' lifespan: 进程运行中必须保存的一些信息类别

    • Process attributes进程属性

    • Process relationships进程间关系

    • Process memory space进程内存空间

    • File management文件管理

    • Signal management信号管理

    • Process credentials进程信任状态

    • Resource limits资源限制

    • Scheduling related fields调度相关的字段

    current宏指向当前进程数据结构描述符!可以自己写一个小程序,将这些信息都打出来!

    ================================
      /\_/\                        
     (=^o^=)  Wu.Country@侠缘      
     (~)@(~)  一辈子,用心做一件事!
    --------------------------------
      学而不思则罔,思而不学则怠!  
    ================================
  • 相关阅读:
    Bootstrap 网页乱码
    西游记人物
    球从100米高度自由落下,每次落地后反跳回原高度的一半;再落下,求它在第10次落地时,共经过多少米?第10次反弹多高?
    利用条件运算符的嵌套来完成此题:学习成绩> =90分的同学用A表示,60-89分之间的用B表示,60分以下的用C表示。
    s=a+aa+aaa+aaaa+aa...a的值,其中a是一个数字。例如2+22+222+2222+22222(此时共有5个数相加),几个数相加由用户控制。
    实现判断字符串的开头和结尾
    值类型和引用类型
    随机生成4位验证码
    实现 从1-36中随机产生6个不重复的中奖号码
    冒泡排序
  • 原文地址:https://www.cnblogs.com/WuCountry/p/1406067.html
Copyright © 2011-2022 走看看