comparison src/getloadavg.c @ 440:8de8e3f6228a r21-2-28

Import from CVS: tag r21-2-28
author cvs
date Mon, 13 Aug 2007 11:33:38 +0200
parents 3ecd8885ac67
children abe6d1db359e
comparison
equal deleted inserted replaced
439:357dd071b03c 440:8de8e3f6228a
766 loadavg[elem++] = load_info.five_minute; 766 loadavg[elem++] = load_info.five_minute;
767 if (nelem > 2) 767 if (nelem > 2)
768 loadavg[elem++] = load_info.fifteen_minute; 768 loadavg[elem++] = load_info.fifteen_minute;
769 #endif /* DGUX */ 769 #endif /* DGUX */
770 770
771 #if !defined (LDAV_DONE) && defined (apollo)
772 #define LDAV_DONE
773 /* Apollo code from lisch@mentorg.com (Ray Lischner).
774
775 This system call is not documented. The load average is obtained as
776 three long integers, for the load average over the past minute,
777 five minutes, and fifteen minutes. Each value is a scaled integer,
778 with 16 bits of integer part and 16 bits of fraction part.
779
780 I'm not sure which operating system first supported this system call,
781 but I know that SR10.2 supports it. */
782
783 extern void proc1_$get_loadav ();
784 unsigned long load_ave[3];
785
786 proc1_$get_loadav (load_ave);
787
788 if (nelem > 0)
789 loadavg[elem++] = load_ave[0] / 65536.0;
790 if (nelem > 1)
791 loadavg[elem++] = load_ave[1] / 65536.0;
792 if (nelem > 2)
793 loadavg[elem++] = load_ave[2] / 65536.0;
794 #endif /* apollo */
795
796 #if !defined (LDAV_DONE) && defined (OSF_MIPS) 771 #if !defined (LDAV_DONE) && defined (OSF_MIPS)
797 #define LDAV_DONE 772 #define LDAV_DONE
798 773
799 struct tbl_loadavg load_ave; 774 struct tbl_loadavg load_ave;
800 table (TBL_LOADAVG, 0, &load_ave, 1, sizeof (load_ave)); 775 table (TBL_LOADAVG, 0, &load_ave, 1, sizeof (load_ave));