blob: 5c88054fcccaebd7c157081a0bf4a2e93a0d4d21 [file] [log] [blame] [raw]
Add 'numthreads' field in proc/<pid>/stat that available since Linux
2.6.0-test8.
diff -ru --exclude-from freebsd-src-diff-exclude-names /var/archive3/public/freebsd-releng-10.4-src/sys/compat/linprocfs/linprocfs.c freebsd-10.4/sys/compat/linprocfs/linprocfs.c
--- /var/archive3/public/freebsd-releng-10.4-src/sys/compat/linprocfs/linprocfs.c 2017-09-29 08:19:56.000000000 +0800
+++ freebsd-10.4/sys/compat/linprocfs/linprocfs.c 2019-08-18 00:21:10.309142173 +0800
@@ -662,7 +662,7 @@
PS_ADD("cstime", "%ld", TV2J(&kp.ki_rusage_ch.ru_stime));
PS_ADD("priority", "%d", kp.ki_pri.pri_user);
PS_ADD("nice", "%d", kp.ki_nice); /* 19 (nicest) to -19 */
- PS_ADD("0", "%d", 0); /* removed field */
+ PS_ADD("numthreads", "%d", kp.ki_numthreads); /* >= 2.6 */
PS_ADD("itrealvalue", "%d", 0); /* XXX */
PS_ADD("starttime", "%lu", TV2J(&kp.ki_start) - TV2J(&boottime));
PS_ADD("vsize", "%ju", P2K((uintmax_t)kp.ki_size));