Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

From the manual it seems that ps -AO wchan should tell me what everything is sleeping on, but everything comes up as -. (And nwchan as 0). Did they do away with the old sleep()/tsleep() interface in the kernel, or do I need to tweak some setting to get at the information?

And if p->p_wchan is actually always zero in Darwin 11, is there another way find out what processes are waiting for?

EDIT: Indeed, p->p_wchan isn't even defined in the internal struct proc, the sysctl interface just zeroes out the fields when exporting. There's uu_wchan and uu_wmesg members in struct uthread, set by the _sleep interface and through that by the emulated tsleep function, but I haven't found anything to make those available to userland. ps -MAO wchan doesn't, for one.

(The whole struct uthread thing seems to be a very specific to XNU, a way of retrofitting FreeBSD interfaces onto Mach, so there's little hope of finding solutions from elsewhere).

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.