1
0
Fork 0

makinf a foo.dat fake file

Esse commit está contido em:
phyto 2019-01-18 15:39:07 +01:00
commit 22fdf52ccb
2 arquivos alterados com 8 adições e 1 exclusões

1
.gitignore externo
Ver arquivo

@ -2,6 +2,7 @@ a.out
*.o
fake-values
essai
foo.dat
serial/t
core/t

Ver arquivo

@ -6,6 +6,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "core/utils.h"
@ -40,6 +41,7 @@ int main(int argc, char *argv[])
{
int opt, foo;
double loads[3];
int il[3];
while ((opt = getopt(argc, argv, "v")) != -1) {
switch (opt) {
@ -50,8 +52,12 @@ while ((opt = getopt(argc, argv, "v")) != -1) {
foo = get_loadavg(loads);
if (foo) fprintf(stderr, "get loadavg -> %d\n", foo);
for (foo=0; foo<3; foo++) {
il[foo] = ((int)(loads[foo] * 900.0)) & 0x3ff;
fprintf(stderr, "%f -> %d\n", loads[foo], il[foo]);
}
printf("%f %f %f %f\n", dtime(), loads[0], loads[1], loads[2]);
printf("T %ld %d %d %d %d\n", time(NULL), getpid()%1024, il[0], il[1], il[2]);
return 0;
}