Monitoring du Phytotron
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

essai.c 710B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * essai.c
  3. */
  4. #include <stdio.h>
  5. #include <unistd.h>
  6. #include <stdlib.h>
  7. #include "funcs.h"
  8. int verbosity;
  9. /* --------------------------------------------------------------- */
  10. int main(int argc, char *argv[])
  11. {
  12. int opt, foo;
  13. int type = 0;
  14. double loads[3];
  15. while ((opt = getopt(argc, argv, "vst:")) != -1) {
  16. switch (opt) {
  17. case 'v': verbosity++; break;
  18. case 's': srand(getpid()); break;
  19. case 't': type = atoi(optarg); break;
  20. default: break;
  21. }
  22. }
  23. foo = get_loadavg(loads);
  24. if (foo) fprintf(stderr, "get loadavg -> %d\n", foo);
  25. printf("%f %f %f %f\n", dtime(), loads[0], loads[1], loads[2]);
  26. return 0;
  27. }
  28. /* --------------------------------------------------------------- */