diff options
-rw-r--r-- | sys/kern/sched_4bsd.c | 8 |
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); } |