questions on kern.ps_showallthreads
Devon H. O'Dell
dodell at sitetronics.com
Sat Jul 17 04:44:10 PDT 2004
rmkml wrote:
Hi,
In DragonFly-Bsd (v1.0)
sysctl permit threads view or not,
but, if disable threads view,
root not view threads with ps,
possible change this :
If user is root {uid=0} then always view threads ?
Regards
Rmkml at xxxxxxxxxx
This probably isn't the most clean fix for this problem (it'd be nice to
put it in the comparison section of the for (;;) loop), but the
following diff should fix this problem.
--Devon
ÿþI n d e x : k e r n _ p r o c . c
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
R C S f i l e : / h o m e / p f 4 d f / p f 4 d f / s y s / k e r n / k e r n _ p r o c . c , v
r e t r i e v i n g r e v i s i o n 1 . 1 . 1 . 1
d i f f - u - u - r 1 . 1 . 1 . 1 k e r n _ p r o c . c
- - - k e r n _ p r o c . c 1 5 J u l 2 0 0 4 1 9 : 5 0 : 1 1 - 0 0 0 0 1 . 1 . 1 . 1
+ + + k e r n _ p r o c . c 1 7 J u l 2 0 0 4 1 1 : 4 0 : 0 4 - 0 0 0 0
@ @ - 6 0 1 , 1 0 + 6 0 1 , 1 2 @ @
* c p u .
* /
o r i g c p u = m y c p u - > g d _ c p u i d ;
- f o r ( n = 1 ; p s _ s h o w a l l t h r e a d s & & n < = n c p u s ; + + n ) {
+ f o r ( n = 1 ; n < = n c p u s ; + + n ) {
g l o b a l d a t a _ t r g d ;
i n t n i d ;
+ i f ( 0 = = p s _ s h o w a l l t h r e a d s & & 0 ! = p - > p _ u c r e d - > c r _ u i d )
+ r e t u r n ( 0 ) ;
n i d = ( o r i g c p u + n ) % n c p u s ;
i f ( ( s m p _ a c t i v e _ m a s k & ( 1 < < n i d ) ) = = 0 )
c o n t i n u e ;
More information about the Kernel
mailing list