makinf a foo.dat fake file
This commit is contained in:
parent
7c8067fc5a
commit
22fdf52ccb
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@ a.out
|
||||
*.o
|
||||
fake-values
|
||||
essai
|
||||
foo.dat
|
||||
serial/t
|
||||
core/t
|
||||
|
||||
|
8
essai.c
8
essai.c
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user