日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

[Linux]进程(十二)--task_struct结构体

發(fā)布時間:2024/1/17 linux 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [Linux]进程(十二)--task_struct结构体 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
[cpp]?view plaincopy
  • struct?task_struct?{??
  • ????volatile?long?state;?/*?-1?不可運行,?0?可運行,?>0?表示停止?*/??
  • ????void?*stack;??
  • ????atomic_t?usage;??
  • ????unsigned?long?flags;?/*?每進(jìn)程標(biāo)志?*/??
  • ????unsigned?long?ptrace;??
  • ????int?lock_depth;?/*?大內(nèi)核鎖深度?*/??
  • ????int?prio,?static_prio,?normal_prio;??
  • ????struct?list_head?run_list;??
  • ????const?struct?sched_class?*sched_class;??
  • ????struct?sched_entity?se;??
  • ????unsigned?short?ioprio;??
  • ????unsigned?long?policy;??
  • ????cpumask_t?cpus_allowed;??
  • ????unsigned?int?time_slice;??
  • #if?defined(CONFIG_SCHEDSTATS)?||?defined(CONFIG_TASK_DELAY_ACCT)??
  • ????struct?sched_info?sched_info;??
  • #endif??
  • ????struct?list_head?tasks;??
  • ????/*?
  • ????*?ptrace_list/ptrace_children?forms?the?list?of?my?children?
  • ????*?that?were?stolen?by?a?ptracer.?
  • ????*/??
  • ????struct?list_head?ptrace_children;??
  • ????struct?list_head?ptrace_list;??
  • ????struct?mm_struct?*mm,?*active_mm;??
  • /*?進(jìn)程狀態(tài)?*/??
  • ????struct?linux_binfmt?*binfmt;??
  • ????long?exit_state;??
  • ????int?exit_code,?exit_signal;??
  • ????int?pdeath_signal;?/*?在父進(jìn)程終止的時候發(fā)送的信號?*/??
  • ????unsigned?int?personality;??
  • ????unsigned?did_exec:1;??
  • ????pid_t?pid;??
  • ????pid_t?tgid;??
  • ????struct?task_struct?*real_parent;?/*?真正的父進(jìn)程(被調(diào)試的情況下)?*/??
  • ????struct?task_struct?*parent;?/*?父進(jìn)程?,parent和real_parent的區(qū)別:real_parent是親爹,調(diào)fork的那個,parent呢是干爹,大部分情況下親爹干爹是一個人,ps看到的是干爹,什么時候親爹干爹不一樣的,比如有一種情況,比如親爹死了,但是呢又得有一個父進(jìn)程,比如1號進(jìn)程就會被當(dāng)成父進(jìn)程。但進(jìn)程不是1號fork出來的。*/??
  • ????struct?list_head?children;?/*?子進(jìn)程鏈表?*/??
  • ????struct?list_head?sibling;?/*?連接到父進(jìn)程的子進(jìn)程的鏈表?*/??
  • ????struct?task_struct?*group_leader;?/*?線程組組長?*/??
  • ????/*?PID與PID散列表的聯(lián)系*/??
  • ????struct?pid_link?pids[PIDTYPE_MAX];??
  • ????struct?list_head?thread_group;??
  • ????struct?completion?*vfork_done;?/*?用于vfork()?*/??
  • ????int?__user?*set_child_tid;?/*?CLONE_CHILD_SETTID?*/??
  • ????int?__user?*clear_child_tid;?/*?CLONE_CHILD_CLEARTID?*/??
  • ????unsigned?long?rt_priority;??
  • ????cputime_t?utime,?stime,?utimescaled,?stimescaled;;??
  • ????unsigned?long?nvcsw,?nivcsw;?/*?上下文切換計數(shù)?*/??
  • ????struct?timespec?start_time;?/*?單調(diào)時間?*/??
  • ????struct?timespec?real_start_time;?/*?啟動以來的時間?*/??
  • ????unsigned?long?min_flt,?maj_flt;??
  • ????cputime_t?it_prof_expires,?it_virt_expires;??
  • ????unsigned?long?long?it_sched_expires;??
  • ????struct?list_head?cpu_timers[3];??
  • /*?進(jìn)程身份憑據(jù)?*/??
  • ????uid_t?uid,euid,suid,fsuid;??
  • ????gid_t?gid,egid,sgid,fsgid;??
  • ????struct?group_info?*group_info;??
  • ????kernel_cap_t?cap_effective,?cap_inheritable,?cap_permitted;??
  • ????unsigned?keep_capabilities:1;??
  • ????struct?user_struct?*user;??
  • ????char?comm[TASK_COMM_LEN];?/*?去除路徑后的可執(zhí)行文件名稱*/??
  • /*?文件系統(tǒng)信息?*/??
  • ????int?link_count,?total_link_count;??
  • /*?ipc?stuff?*/??
  • ????struct?sysv_sem?sysvsem;??
  • /*?當(dāng)前進(jìn)程特定的cpu信息?*/??
  • ????struct?thread_struct?thread;??
  • /*?filesystem?information?*/??
  • ????struct?fs_struct?*fs;??
  • /*?open?file?information?*/??
  • ????struct?files_struct?*files;??
  • /*?namespace?*/??
  • ????struct?nsproxy?*nsproxy;??
  • /*?signal?handlers?*/??
  • ????struct?signal_struct?*signal;??
  • ????struct?sighand_struct?*sighand;??
  • ????sigset_t?blocked,?real_blocked;??
  • ????sigset_t?saved_sigmask;?/*?To?be?restored?with?TIF_RESTORE_SIGMASK?*/??
  • ????struct?sigpending?pending;??
  • ????unsigned?long?sas_ss_sp;??
  • ????size_t?sas_ss_size;??
  • ????int?(*notifier)(void?*priv);??
  • ????void?*notifier_data;??
  • ????sigset_t?*notifier_mask;??
  • #ifdef?CONFIG_SECURITY??
  • v???oid?*security;??
  • #endif??
  • /*?線程組跟蹤?*/??
  • ????u32?parent_exec_id;??
  • ????u32?self_exec_id;??
  • /*?日志文件系統(tǒng)信息?*/??
  • ????void?*journal_info;??
  • /*?虛擬內(nèi)存狀態(tài)?*/??
  • ????struct?reclaim_state?*reclaim_state;??
  • ????struct?backing_dev_info?*backing_dev_info;??
  • ????struct?io_context?*io_context;??
  • ????unsigned?long?ptrace_message;??
  • ????siginfo_t?*last_siginfo;?/*?For?ptrace?use.?*/??
  • ...??
  • };??
  • atomic_t?usage;?有幾個進(jìn)程正在使用此結(jié)構(gòu)

    轉(zhuǎn)載于:https://www.cnblogs.com/zhiliao112/p/4051378.html

    總結(jié)

    以上是生活随笔為你收集整理的[Linux]进程(十二)--task_struct结构体的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。