h/proc.h

00450 /* 00451 * One structure allocated per active 00452 * process. It contains all data needed 00453 * about the process while the 00454 * process may be swapped out. 00455 * Other per process data (user.h) 00456 * is swapped with the process. 00457 */ 00458 struct proc { 00459 char p_stat; 00460 char p_flag; 00461 char p_pri; /* priority, negative is high */ 00462 char p_time; /* resident time for scheduling */ 00463 char p_cpu; /* cpu usage for scheduling */ 00464 char p_nice; /* nice for cpu usage */ 00465 short p_sig; /* signals pending to this process */ 00466 short p_uid; /* user id, used to direct tty signals */ 00467 short p_pgrp; /* name of process group leader */ 00468 short p_pid; /* unique process id */ 00469 short p_ppid; /* process id of parent */ 00470 short p_addr; /* address of swappable image */ 00471 short p_size; /* size of swappable image (clicks) */ 00472 caddr_t p_wchan; /* event process is awaiting */ 00473 struct text *p_textp; /* pointer to text structure */ 00474 struct proc *p_link; /* linked list of running processes */ 00475 int p_clktim; /* time to alarm clock signal */ 00476 }; 00477 00478 extern struct proc proc[]; /* the proc table itself */ 00479 00480 /* stat codes */ 00481 #define SSLEEP 1 /* awaiting an event */ 00482 #define SWAIT 2 /* (abandoned state) */ 00483 #define SRUN 3 /* running */ 00484 #define SIDL 4 /* intermediate state in process creation */ 00485 #define SZOMB 5 /* intermediate state in process termination */ 00486 #define SSTOP 6 /* process being traced */ 00487 00488 /* flag codes */ 00489 #define SLOAD 01 /* in core */ 00490 #define SSYS 02 /* scheduling process */ 00491 #define SLOCK 04 /* process cannot be swapped */ 00492 #define SSWAP 010 /* process is being swapped out */ 00493 #define STRC 020 /* process is being traced */ 00494 #define SWTED 040 /* another tracing flag */ 00495 #define SULOCK 0100 /* user settable lock in core */ 00496 00497 /* 00498 * parallel proc structure 00499 * to replace part with times 00500 * to be passed to parent process 00501 * in ZOMBIE state. 00502 */ 00503 struct xproc { 00504 char xp_stat; 00505 char xp_flag; 00506 char xp_pri; /* priority, negative is high */ 00507 char xp_time; /* resident time for scheduling */ 00508 char xp_cpu; /* cpu usage for scheduling */ 00509 char xp_nice; /* nice for cpu usage */ 00510 short xp_sig; /* signals pending to this process */ 00511 short xp_uid; /* user id, used to direct tty signals */ 00512 short xp_pgrp; /* name of process group leader */ 00513 short xp_pid; /* unique process id */ 00514 short xp_ppid; /* process id of parent */ 00515 short xp_xstat; /* Exit status for wait */ 00516 time_t xp_utime; /* user time, this proc */ 00517 time_t xp_stime; /* system time, this proc */ 00518 }; 00519 00520 00521 00522 00523 00524 00525 00526 00527 00528 00529 00530 00531 00532 00533 00534 00535 00536 00537 00538 00539 00540 00541 00542 00543 00544 00545 00546 00547 00548 00549