Open JunioCalu opened 4 years ago
What does the context of /proc/loadavg look like on Arch ? Does it have three lines instead of one ?
are six values:
~ >>> cat /proc/loadavg
1.53 2.11 1.65 2/828 17652
What does the context of /proc/loadavg look like on Arch ? Does it have three lines instead of one ?
one line
I did a simple test on another file named proc.cpp to test the output with decimal places and the values were displayed correctly, but in the dde-istate-menus they are simply not displayed.
#include <cstdio>
#include <stdlib.h>
#include <string.h>
int main(){
float a, b, c;
char buf[128];
FILE *fp;
int i;
double load[3];
double loadAvg1, loadAvg5, loadAvg15;
if ((fp = fopen("/proc/loadavg", "r")) != NULL) {
if((fgets(buf, sizeof(buf), fp)) != NULL) {
load[0] = strtod(strtok(buf, " \n"), NULL);
for(i=1;i<3;i++){
load[i] = strtod(strtok(NULL, " \n"), NULL);
}
loadAvg1 = load[0];
loadAvg5 = load[1];
loadAvg15 = load[2];
printf("%.2f %.2f %.2f", loadAvg1, loadAvg5, loadAvg15);
}
}
}
output: g++ proc.cpp -o procbin
~ >>> ./procbin
0.94 1.80 1.75
comparison with the output of the cat:
~ >>> cat /proc/loadavg
0.94 1.80 1.75 1/815 37376
What's your OS ? I think I need to debug by installing the os in virtual machine.
Qual é o seu sistema operacional? Eu acho que preciso depurar instalando o sistema operacional na máquina virtual.
I'm using Manjaro an Archlinux distribution, but both systems are the same, the packages are in the same version
patch: