summaryrefslogtreecommitdiffstats
path: root/sys/kern/sched_4bsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r--sys/kern/sched_4bsd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index 542dce4..6480b49 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -723,5 +723,11 @@ sched_sizeof_thread(void)
fixpt_t
sched_pctcpu(struct thread *td)
{
- return (td->td_kse->ke_pctcpu);
+ struct kse *ke;
+
+ ke = td->td_kse;
+ if (ke)
+ return (ke->ke_pctcpu);
+
+ return (0);
}
OpenPOWER on IntegriCloud