Question:
Why sysinfo
return more processes ( procs
) than ps aux
Function example:
static void
print_sysinfo()
{
struct sysinfo info;
sysinfo(&info);
printf("Number of current processes - %d\n", info.procs); # На моей системе это 452
}
But when I ask for the output of a line-counting command in Linux it looks like this:
ps aux | wc -l # 179
What's the catch? The manual says Number of current processes
. Why is it not the same as aux
? Now I'm a little confused about how many actually running processes are on my system …
Answer:
As andreymal pointed out, this is because threads count as processes, and ps aux
does not display threads.