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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

struct task_struct 结构分析 \linux-1.0\linux\include\linux\sched.h

發(fā)布時間:2023/12/20 linux 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 struct task_struct 结构分析 \linux-1.0\linux\include\linux\sched.h 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
//任務(wù)機構(gòu)體,大小大概1024字節(jié) struct task_struct {/* these are hardcoded - don't touch */ //硬件代碼 不可被修改volatile long state; //狀態(tài)標志 /* -1 unrunnable, 0 runnable, >0 stopped */ long counter; //計數(shù)long priority; //優(yōu)先權(quán)unsigned long signal; //信號unsigned long blocked; //信號標志的bit映射 /* bitmap of masked signals */ unsigned long flags; //上個進程標志/* per process flags, defined below */ int errno; //出錯代碼int debugreg[8]; //硬件編譯寄存器。/* Hardware debugging registers */ /* various fields */ //可變區(qū)域struct task_struct *next_task, *prev_task; //本結(jié)構(gòu)的鏈表雙向指針struct sigaction sigaction1[32]; //信號活動數(shù)組unsigned long saved_kernel_stack; //內(nèi)核中保存的堆棧點 unsigned long kernel_stack_page; //內(nèi)核堆棧頁int exit_code, exit_signal; //結(jié)束代碼,結(jié)束信號int elf_executable:1; //是否自己可以執(zhí)行標志int dumpable:1; //是否可以拆卸標志int swappable:1; //是否可以交換標志int did_exec:1; //是否為執(zhí)行文件標志//啟動代碼點,結(jié)束代碼點,結(jié)束數(shù)據(jù)點,斷點開始點,斷點,堆棧開始點,虛擬映射頁開始點!unsigned long start_code,end_code,end_data,start_brk,brk,start_stack,start_mmap;//變量開始點,變量結(jié)束點,環(huán)境開始點,環(huán)境結(jié)束點unsigned long arg_start, arg_end, env_start, env_end;//進程id,組,會話,引入點int pid,pgrp,session,leader;//分組數(shù)組int groups[NGROUPS];/* * pointers to (original) parent process, youngest child, younger sibling,* older sibling, respectively. (p->father can be replaced with * p->p_pptr->pid)*///指向最原始的進程任務(wù)指針,父進程任務(wù)指針,子進程任務(wù)指針,新兄弟進程任務(wù)指針,舊兄弟進程任務(wù)指針。struct task_struct *p_opptr,*p_pptr, *p_cptr, *p_ysptr, *p_osptr;//任務(wù)隊列指針struct wait_queue *wait_chldexit; /* for wait4() *//** For ease of programming... Normal sleeps don't need to* keep track of a wait-queue: every task has an entry of its own*///real user ID (uid): 實際用戶ID,指的是進程執(zhí)行者是誰//effective user ID (euid): 有效用戶ID,指進程執(zhí)行時對文件的訪問權(quán)限//saved set-user-ID (saved uid): 保存設(shè)置用戶ID。是進程剛開始執(zhí)行時,euid的副本。在執(zhí)行exec調(diào)用之后能重新恢復(fù)原來的effectiv user ID.unsigned short uid,euid,suid; //用戶ID,有效用戶ID,保存設(shè)置用戶IDunsigned short gid,egid,sgid; //組ID,有效組ID,保存設(shè)置組ID;unsigned long timeout; //超時時間unsigned long it_real_value, it_prof_value, it_virt_value; //真實間隔定時器計數(shù)器的當前值,PROF間隔定時器計數(shù)器的當前值,虛擬間隔定時器計數(shù)器的當前值unsigned long it_real_incr, it_prof_incr, it_virt_incr; //真實間隔定時器計數(shù)器的初始值,PROF間隔定時器計數(shù)器的初始值,虛擬間隔定時器計數(shù)器的初始值long utime,stime,cutime,cstime,start_time; //用戶時間,系統(tǒng)時間,累計用戶時間,進程啟動時間unsigned long min_flt, maj_flt; //次要頁錯誤的數(shù)量,主要頁錯誤的數(shù)量unsigned long cmin_flt, cmaj_flt; //累計次要頁錯誤,累計主要頁錯誤struct rlimit rlim[RLIM_NLIMITS]; //右限制值數(shù)組unsigned short used_math; //被使用的數(shù)字unsigned short rss; /* number of resident pages */ //寄存頁號char comm[16]; //comm口struct vm86_struct * vm86_info; //86虛擬機結(jié)構(gòu)unsigned long screen_bitmap; //屏幕位映射 /* file system info */ //文件系統(tǒng)信息int link_count; //鏈接數(shù)int tty; //終端類型 /* -1 if no tty, so it must be signed */unsigned short umask; //權(quán)限掩碼struct inode * pwd; //密碼節(jié)點指針struct inode * root; //root節(jié)點指針struct inode * executable; //執(zhí)行表節(jié)點指針struct vm_area_struct * mmap; //虛擬區(qū)域映射指針struct shm_desc *shm; //struct sem_undo *semun; //信號量操作標志struct file * filp[NR_OPEN]; //已經(jīng)打開的文件描述字數(shù)組fd_set close_on_exec; //進程所有文件描述符(文件句柄)的位圖標 /* ldt for this task - used by Wine. If NULL, default_ldt is used */struct desc_struct *ldt; //局部描述符表 /* tss for this task */struct tss_struct tss; //任務(wù)狀態(tài)段信息結(jié)構(gòu) #ifdef NEW_SWAPunsigned long old_maj_flt; /* old value of maj_flt */unsigned long dec_flt; /* page fault count of the last time */unsigned long swap_cnt; /* number of pages to swap on next pass */short swap_table; /* current page table */short swap_page; /* current page */ #endif NEW_SWAPstruct vm_area_struct *stk_vma; //虛擬區(qū)域映射指針 };
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎

總結(jié)

以上是生活随笔為你收集整理的struct task_struct 结构分析 \linux-1.0\linux\include\linux\sched.h的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

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