DragonFly BSD
DragonFly kernel List (threaded) for 2004-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: questions on kern.ps_showallthreads


From: "Devon H. O'Dell" <dodell@xxxxxxxxxxxxxxx>
Date: Sat, 17 Jul 2004 13:42:52 +0200

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@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
ÿþIndex: kern_proc.c
===================================================================
RCS file: /home/pf4df/pf4df/sys/kern/kern_proc.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 kern_proc.c
--- kern_proc.c 15 Jul 2004 19:50:11 -0000      1.1.1.1
+++ kern_proc.c 17 Jul 2004 11:40:04 -0000
@@ -601,10 +601,12 @@
	 * cpu.
	 */
	origcpu = mycpu->gd_cpuid;
-	for (n = 1; ps_showallthreads && n <= ncpus; ++n) {
+	for (n = 1; n <= ncpus; ++n) {
		globaldata_t rgd;
		int nid;

+		if (0 == ps_showallthreads && 0 != p->p_ucred->cr_uid)
+			return (0);
		nid = (origcpu + n) % ncpus;
		if ((smp_active_mask & (1 << nid)) == 0)
			continue;


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]