code:proc - ikarishinjieva/unixV6-code-analyze-chs GitHub Wiki

Source

0350 /*

0351  * One structure allocated per active

0352  * process. It contains all data needed

0353  * about the process while the

0354  * process may be swapped out.

0355  * Other per process data (user.h)

0356  * is swapped with the process.

0357  */

0358 struct proc

0359 {

0360 char p_stat;

  • 进程状态,常量定义在proc.h
0361 char p_flag;
  • 进程标志,常量定义在proc.h
0362 char p_pri; /* priority, negative is high */
0363 char p_sig; /* signal number sent to this process */
  • 发送给该进程的信号
0364 char p_uid; /* user id, used to direct tty signals */
  • 进程的用户ID(UID)
0365 char p_time; /* resident time for scheduling */
  • 进程 驻留时间
0366 char p_cpu; /* cpu usage for scheduling */
  • 进程 CPU 使用程度
0367 char p_nice; /* nice for scheduling */
  • 进程优先级
0368 int p_ttyp; /* controlling tty */
  • 进程 所属的tty
0369 int p_pid; /* unique process id */
  • 进程 的进程号
0370 int p_ppid; /* process id of parent */
  • 进程父进程 的进程号
0371 int p_addr; /* address of swappable image */
0372 int p_size; /* size of swappable image (*64 bytes) */
0373 int p_wchan;/* event process is awaiting */
0374 int *p_textp;/* pointer to text structure */
  • 指向 进程的正文段的控制块
struct text
0375

0376 } proc[NPROC];

0377 /* ------------------------- */

Caller

⚠️ **GitHub.com Fallback** ⚠️