1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #if defined(DOSCCS) && !defined(lint)
   8: static char sccsid[] = "@(#)busy.c	5.1.2 (2.11BSD GTE) 1/16/95";
   9: #endif
  10: 
  11: /*
  12:  * busy: print an indication of how busy the system is for games.
  13:  */
  14: #ifndef MAX
  15: # define MAX 30
  16: #endif
  17: 
  18: #include <stdio.h>
  19: main(argc, argv)
  20: char **argv;
  21: {
  22:     double la[3];
  23:     double max;
  24: 
  25:     getloadavg(la, 3);
  26:     max = la[0];
  27:     if (la[1] > max) max = la[1];
  28:     if (la[2] > max) max = la[2];
  29:     if (argc > 1)
  30:         printf("1=%g, 5=%g, 15=%g, max=%g\n", la[0], la[1], la[2], max);
  31:     if (max > MAX)
  32:         printf("100\n");    /* incredibly high, no games allowed */
  33:     else
  34:         printf("0\n");
  35:     exit(0);
  36: }

Defined functions

main defined in line 19; never used

Defined variables

sccsid defined in line 8; never used

Defined macros

MAX defined in line 15; used 2 times
Last modified: 1995-01-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2449
Valid CSS Valid XHTML 1.0 Strict