30 #if defined (NEW_PROC_API)
31 #define _STRUCTURED_PROC 1
34 #include <sys/types.h>
35 #include <sys/procfs.h>
53 static struct trans pr_flag_table[] =
55 #if defined (PR_STOPPED)
63 { PR_STOPPED,
"PR_STOPPED",
"Process (LWP) is stopped" },
65 #if defined (PR_ISTOP)
73 { PR_ISTOP,
"PR_ISTOP",
"Stopped on an event of interest" },
75 #if defined (PR_DSTOP)
83 { PR_DSTOP,
"PR_DSTOP",
"A stop directive is in effect" },
91 { PR_STEP,
"PR_STEP",
"A single step directive is in effect" },
93 #if defined (PR_ASLEEP)
101 { PR_ASLEEP,
"PR_ASLEEP",
"Sleeping in an (interruptible) system call" },
103 #if defined (PR_PCINVAL)
111 { PR_PCINVAL,
"PR_PCINVAL",
"PC (pr_instr) is invalid" },
113 #if defined (PR_ASLWP)
118 { PR_ASLWP,
"PR_ASLWP",
"This is the asynchronous signal LWP" },
120 #if defined (PR_AGENT)
124 { PR_AGENT,
"PR_AGENT",
"This is the /proc agent LWP" },
126 #if defined (PR_ISSYS)
134 { PR_ISSYS,
"PR_ISSYS",
"Is a system process/thread" },
136 #if defined (PR_VFORKP)
140 { PR_VFORKP,
"PR_VFORKP",
"Process is the parent of a vforked child" },
146 { PR_ORPHAN,
"PR_ORPHAN",
"Process's process group is orphaned" },
148 #if defined (PR_FORK)
156 { PR_FORK,
"PR_FORK",
"Inherit-on-fork is in effect" },
166 { PR_RLC,
"PR_RLC",
"Run-on-last-close is in effect" },
176 { PR_KLC,
"PR_KLC",
"Kill-on-last-close is in effect" },
178 #if defined (PR_ASYNC)
185 { PR_ASYNC,
"PR_ASYNC",
"Asynchronous stop is in effect" },
187 #if defined (PR_MSACCT)
192 { PR_MSACCT,
"PR_MSACCT",
"Microstate accounting enabled" },
194 #if defined (PR_BPTADJ)
199 { PR_BPTADJ,
"PR_BPTADJ",
"Breakpoint PC adjustment in effect" },
201 #if defined (PR_PTRACE)
210 { PR_PTRACE,
"PR_PTRACE",
"Process is being controlled by ptrace" },
212 #if defined (PR_PCOMPAT)
216 { PR_PCOMPAT,
"PR_PCOMPAT",
"Ptrace compatibility mode in effect" },
222 { PR_MSFORK,
"PR_PCOMPAT",
"Micro-state accounting inherited on fork" },
227 { PR_ISKTHREAD,
"PR_KTHREAD",
"Process is a kernel thread" },
232 { PR_ABORT,
"PR_ABORT",
"Abort the current stop condition" },
237 { PR_TRACING,
"PR_TRACING",
"Task is traced" },
242 { PR_STOPFORK,
"PR_STOPFORK",
"Stop child on fork" },
247 { PR_STOPEXEC,
"PR_STOPEXEC",
"Stop on exec" },
252 { PR_STOPTERM,
"PR_STOPTERM",
"Stop on task exit" },
257 { PR_STOPTCR,
"PR_STOPTCR",
"Stop on thread creation" },
262 { PR_STOPTTERM,
"PR_STOPTTERM",
"Stop on thread exit" },
267 { PR_USCHED,
"PR_USCHED",
"User level scheduling is in effect" },
276 for (i = 0; i <
sizeof (
pr_flag_table) /
sizeof (pr_flag_table[0]); i++)
277 if (flags & pr_flag_table[i].
value)
279 fprintf (file,
"%s ", pr_flag_table[i].
name);
281 fprintf (file,
"%s\n", pr_flag_table[i].
desc);
284 fprintf (file,
"\n");
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
static struct trans pr_flag_table[]
void proc_prettyprint_flags(unsigned long flags, int verbose)
void proc_prettyfprint_flags(FILE *file, unsigned long flags, int verbose)