Solaris 10 has a 4-byte pr_filler field in the psinfo structure and its not double-aligned,
so using the percent_cpu macro to store a double in there actually overwrites the
first 8 bytes of pr_lwp, the latter 4 bytes containing the pr_lwpid!
I enclose a patch that works around this for Solaris 10 by using the larger (20 byte)
pr_filler field in the lwpsinfo struct, but this is will probably break
in a future Solaris release; something better should be done here
to store "extra" data properly and portably.
This patch also includes the patch from
bug id #2965027 top-3.8beta1 improper use of free() on Solaris
and possibly renders the patch in
2815842 top-3.8beta1 will segfault with high thread ids
unecessary, unless thread-id's can have the top-bit set
(thread-id's without my patch would have as they
were garbage on Solaris 10)
free() and LWP fix for Solaris
forgot to set category/group
fix group