return n;
}
+# if ENABLE_FEATURE_FAST_TOP
static long fast_strtol_10(char **endptr)
{
if (**endptr != '-')
(*endptr)++;
return - (long)fast_strtoul_10(endptr);
}
+# endif
static char *skip_fields(char *str, int count)
{
goto got_entry;
closedir(sp->task_dir);
sp->task_dir = NULL;
+ sp->main_thread_pid = 0;
}
#endif
entry = readdir(sp->dir);
char task_dir[sizeof("/proc/%u/task") + sizeof(int)*3];
sprintf(task_dir, "/proc/%u/task", pid);
sp->task_dir = xopendir(task_dir);
+ sp->main_thread_pid = pid;
continue;
}
#endif
//FIXME: is it safe to assume this field exists?
sp->last_seen_on_cpu = fast_strtoul_10(&cp);
# endif
-#endif /* end of !ENABLE_FEATURE_TOP_SMP_PROCESS */
+#endif /* FEATURE_FAST_TOP */
#if ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS
sp->niceness = tasknice;