blob: 1d3998ad8b4d4a9e320e2c48cb99c3c7b5962b01 [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 /usr/src/sys/compat/linprocfs/linprocfs.c freebsd-11.1/usr/src/sys/compat/linprocfs/linprocfs.c
--- /usr/src/sys/compat/linprocfs/linprocfs.c 2017-07-21 07:42:01.000000000 +0800
+++ freebsd-11.1/usr/src/sys/compat/linprocfs/linprocfs.c 2019-03-22 17:29:35.928552000 +0800
@@ -631,7 +637,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));