1: /*
2: * One structure allocated per active
3: * process. It contains all data needed
4: * about the process while the
5: * process may be swapped out.
6: * Other per process data (user.h)
7: * is swapped with the process.
8: */
9: struct proc {
10: char p_stat;
11: char p_pri; /* priority, negative is high */
12: #ifndef MENLO_JCL
13: char p_flag;
14: #else
15: short p_flag;
16: #endif
17: char p_time; /* resident time for scheduling */
18: char p_cpu; /* cpu usage for scheduling */
19: char p_nice; /* nice for cpu usage */
20: #ifdef UCB_METER
21: char p_slptime; /* secs sleeping */
22: /* there is room for a char here */
23: #endif
24: #ifdef MENLO_JCL
25: char p_cursig;
26: long p_sig; /* signals pending to this process */
27: long p_siga0; /* low bit of 2 bit signal action */
28: long p_siga1; /* high bit of 2 bit signal action */
29: #define p_ignsig p_siga0 /* ignored signal mask */
30: #else
31: short p_sig; /* signals pending to this process */
32: #endif
33: #if defined(MENLO_JCL) || defined(VIRUS_VFORK)
34: struct proc *p_pptr;/* pointer to parent's process structure */
35: #endif
36: short p_uid; /* user id, used to direct tty signals */
37: short p_pgrp; /* name of process group leader */
38: short p_pid; /* unique process id */
39: short p_ppid; /* process id of parent */
40: /*
41: * union (supercedes xproc)
42: * to replace part with times
43: * to be passed to parent process
44: * in ZOMBIE state.
45: */
46: union {
47: struct {
48: #ifdef VIRUS_VFORK
49: memaddr P_addr; /* address of u. area */
50: memaddr P_daddr; /* address of data area */
51: memaddr P_saddr; /* address of stack area */
52: size_t P_dsize; /* size of data area (clicks) */
53: size_t P_ssize; /* size of stack segment (clicks) */
54: #else
55: memaddr P_addr; /* address of swappable image */
56: size_t P_size; /* size of swappable image (clicks) */
57: #endif
58: caddr_t P_wchan; /* event process is awaiting */
59: struct text *P_textp;/* pointer to text structure */
60: struct proc *P_link;/* linked list of running processes */
61: short P_clktim; /* time to alarm clock signal */
62: } p_p;
63: #define p_addr p_un.p_p.P_addr
64: #ifdef VIRUS_VFORK
65: #define p_daddr p_un.p_p.P_daddr
66: #define p_saddr p_un.p_p.P_saddr
67: #define p_dsize p_un.p_p.P_dsize
68: #define p_ssize p_un.p_p.P_ssize
69: #else
70: #define p_size p_un.p_p.P_size
71: #endif
72: #define p_wchan p_un.p_p.P_wchan
73: #define p_textp p_un.p_p.P_textp
74: #define p_link p_un.p_p.P_link
75: #define p_clktim p_un.p_p.P_clktim
76: struct {
77: short Xp_xstat; /* Exit status for wait */
78: time_t Xp_utime; /* user time, this proc */
79: time_t Xp_stime; /* system time, this proc */
80: #ifdef UCB_LOGIN
81: short Xp_login; /* login flag */
82: #endif
83: } p_xp;
84: #define xp_xstat p_xp.Xp_xstat
85: #define xp_utime p_xp.Xp_utime
86: #define xp_stime p_xp.Xp_stime
87: #ifdef UCB_LOGIN
88: #define xp_login p_xp.Xp_login
89: #endif
90: } p_un;
91: };
92:
93: #ifdef KERNEL
94: extern struct proc proc[]; /* the proc table itself */
95: #endif
96:
97: /* stat codes */
98: #define SSLEEP 1 /* awaiting an event */
99: #define SWAIT 2 /* (abandoned state) */
100: #define SRUN 3 /* running */
101: #define SIDL 4 /* intermediate state in process creation */
102: #define SZOMB 5 /* intermediate state in process termination */
103: #define SSTOP 6 /* process being traced */
104:
105: /* flag codes */
106: #define SLOAD 01 /* in core */
107: #define SSYS 02 /* scheduling process */
108: #define SLOCK 04 /* process cannot be swapped */
109: #define SSWAP 010 /* process is being swapped out */
110: #define STRC 020 /* process is being traced */
111: #define SWTED 040 /* another tracing flag */
112: #define SULOCK 0100 /* user settable lock in core */
113: #ifdef MENLO_JCL
114: #define SDETACH 0200 /* detached inherited by init */
115: #define SNUSIG 0400 /* using new signal mechanism */
116: #endif
117: #ifdef VIRUS_VFORK
118: #define SVFORK 01000 /* child in vfork, using parent's data */
119: #define SVFPARENT 02000 /* parent in vfork, waiting for child */
120: #define SVFDONE 04000 /* parent has relesed child in vfork */
121: #endif
122: #ifdef UCB_NET
123: #define SSEL 010000 /* selecting, cleared if rescan needed */
124: #define STIMO 020000 /* timing out during sleep */
125: #endif
126:
127: #ifdef VIRUS_VFORK
128: /* arguments to expand() to expand specified segment */
129: #define S_DATA 0
130: #define S_STACK 1
131: #endif
Defined struct's
proc
defined in line
9; used 194 times
- in line 34(2),
60(2),
94(2)
- in /usr/src/cmd/ps/ps.c line
44(2),
128(2),
232(2),
238(2),
338(2)
- in /usr/src/cmd/pstat.c line
160(2),
267-268(4),
285(4),
291(2)
- in /usr/src/sys/GENERIC/param.c line
106(2),
132(2)
- in /usr/src/sys/conf/param.c line
106(2),
132(2)
- in /usr/src/sys/dev/Others/du.c line
62(2)
- in /usr/src/sys/dev/Others/ft.c line
27(2),
54(2),
80(2),
183(2),
190(2)
- in /usr/src/sys/dev/Others/mx1.c line
420(2)
- in /usr/src/sys/dev/tty.c line
70(2)
- in /usr/src/sys/sys/clock.c line
163(2),
173(2),
320(2)
- in /usr/src/sys/sys/endcore.c line
20(2)
- in /usr/src/sys/sys/machdep.c line
727(2)
- in /usr/src/sys/sys/sigjcl.c line
50(2),
73(2),
291(2),
425(2),
449(2),
605(2),
651(2)
- in /usr/src/sys/sys/signojcl.c line
50(2),
64(2),
92(2),
112(2),
139(2),
217(2),
315(2),
360(2)
- in /usr/src/sys/sys/slp.c line
37(2),
53-58(6),
160-162(4),
185-186(4),
229-231(4),
258-260(4),
285(2),
347(2),
378(2),
511(2),
622-623(4),
742(2),
1016(2),
1058(2),
1211(2)
- in /usr/src/sys/sys/sys1.c line
603(2),
742(2),
843-847(6)
- in /usr/src/sys/sys/sys4.c line
312(2),
388(2),
454(2),
523(2),
597(2),
630(2),
661-663(4),
699(2)
- in /usr/src/sys/sys/syslocal.c line
253(2),
289(2),
345(2),
431(2),
725(2),
796(2)
- in /usr/src/sys/sys/text.c line
30(2),
37(2),
108(2)
- in /usr/src/ucb/sysline.c line
118(2),
457-458(6),
474(2)
- in /usr/src/ucb/w.c line
94(2)
Defined macros
SIDL
defined in line
101; used 3 times
SLOAD
defined in line
106; used 26 times
- in /usr/src/cmd/ps/ps.c line
343
- in /usr/src/sys/sys/clock.c line
352-356(2),
367,
383,
390-394(2)
- in /usr/src/sys/sys/main.c line
57
- in /usr/src/sys/sys/slp.c line
305,
334,
393-397(2),
439(2),
479-484(2),
592,
671,
692,
776-779(2),
921,
1215
- in /usr/src/sys/sys/text.c line
70,
91
- in /usr/src/ucb/w.c line
472
SLOCK
defined in line
108; used 15 times
SRUN
defined in line
100; used 21 times
- in /usr/src/sys/sys/main.c line
56
- in /usr/src/sys/sys/slp.c line
65,
101,
111,
304,
321,
393-397(2),
455,
480,
589,
671,
692,
775,
865-868(2),
894,
959-962(2),
989,
1215
SSEL
defined in line
123; used 6 times
SSLEEP
defined in line
98; used 10 times
SSTOP
defined in line
103; used 10 times
SSYS
defined in line
107; used 2 times
STRC
defined in line
110; used 23 times
- in /usr/src/sys/sys/sigjcl.c line
89-94(2),
150,
211,
298,
314,
329,
363,
394,
434,
661
- in /usr/src/sys/sys/signojcl.c line
97,
122,
147-152(2),
370
- in /usr/src/sys/sys/sys1.c line
476,
607,
698-699(2),
784
- in /usr/src/sys/sys/trap.c line
266,
274
SWAIT
defined in line
99;
never used
p_addr
defined in line
63; used 41 times
- in /usr/src/cmd/ps/ps.c line
344,
351,
394
- in /usr/src/cmd/pstat.c line
323
- in /usr/src/sys/sys/main.c line
52
- in /usr/src/sys/sys/sigjcl.c line
633
- in /usr/src/sys/sys/signojcl.c line
342
- in /usr/src/sys/sys/slp.c line
150,
554-558(3),
583-585(3),
644,
727,
843,
863,
874,
881-883(2),
941,
957,
970,
1157,
1193-1195(2)
- in /usr/src/sys/sys/sys1.c line
450,
657-660(2),
970,
977
- in /usr/src/sys/sys/text.c line
64-69(3),
87-90(3)
- in /usr/src/sys/sys/ureg.c line
33
- in /usr/src/ucb/w.c line
473,
480
p_daddr
defined in line
65; used 25 times
- in /usr/src/cmd/ps/ps.c line
346,
353
- in /usr/src/cmd/pstat.c line
325
- in /usr/src/sys/sys/slp.c line
547-548(2),
556,
841(2),
887-888(3),
911,
924(2),
1066,
1147
- in /usr/src/sys/sys/sys1.c line
443,
654,
959
- in /usr/src/sys/sys/text.c line
55-57(2),
67
- in /usr/src/sys/sys/ureg.c line
30
- in /usr/src/ucb/w.c line
475,
482
p_dsize
defined in line
67; used 27 times
- in /usr/src/cmd/ps/ps.c line
396
- in /usr/src/cmd/pstat.c line
328
- in /usr/src/sys/sys/clock.c line
355-357(2),
393-396(2)
- in /usr/src/sys/sys/slp.c line
445-447(2),
530,
546-548(3),
839(2),
854,
888,
911-914(2),
923-925(3),
1028,
1064-1065(2)
- in /usr/src/sys/sys/sys1.c line
654
- in /usr/src/sys/sys/text.c line
46-49(2)
p_link
defined in line
74; used 21 times
- in /usr/src/cmd/pstat.c line
334
- in /usr/src/sys/sys/slp.c line
79,
87-92(2),
112,
169-170(2),
205,
214,
236,
242,
265-269(5),
673,
691,
717-719(3)
p_saddr
defined in line
66; used 28 times
- in /usr/src/cmd/ps/ps.c line
347,
354
- in /usr/src/cmd/pstat.c line
326
- in /usr/src/sys/sys/sigjcl.c line
629
- in /usr/src/sys/sys/signojcl.c line
338
- in /usr/src/sys/sys/slp.c line
551-557(3),
842(2),
889-890(3),
912,
927(2),
1075-1078(2),
1093,
1141
- in /usr/src/sys/sys/sys1.c line
445,
655
- in /usr/src/sys/sys/text.c line
60-62(2),
68
- in /usr/src/sys/sys/ureg.c line
31
- in /usr/src/ucb/w.c line
476,
483
p_size
defined in line
70; used 27 times
p_ssize
defined in line
68; used 29 times
- in /usr/src/cmd/ps/ps.c line
396,
898
- in /usr/src/cmd/pstat.c line
329
- in /usr/src/sys/sys/clock.c line
355-357(2),
393-396(2)
- in /usr/src/sys/sys/slp.c line
445-447(2),
530,
550-552(3),
840(2),
854,
890,
912-915(2),
926-928(3),
1029,
1073-1074(2)
- in /usr/src/sys/sys/sys1.c line
655
- in /usr/src/sys/sys/text.c line
48-49(2)
- in /usr/src/ucb/w.c line
515
p_textp
defined in line
73; used 30 times
- in /usr/src/cmd/pstat.c line
335
- in /usr/src/sys/sys/clock.c line
398-405(5)
- in /usr/src/sys/sys/sigjcl.c line
739
- in /usr/src/sys/sys/signojcl.c line
448
- in /usr/src/sys/sys/slp.c line
441(2),
521,
567,
792(2),
812-818(4),
916,
929-930(3)
- in /usr/src/sys/sys/text.c line
53,
86,
110,
132,
175,
208
- in /usr/src/sys/sys/ureg.c line
35,
253
Usage of this include