/* Program to print out the current system load averages. * * Author: Eric Carlson, carl0240@tc.umn.edu * * This software is supplied 'as is', with no warranty. * You are free to use and/or redistribute this source, modified or unmodified, * in any form. */ #include #include int main(int argc, char* argv[]) { double averages[3]; if( getloadavg(averages, 3) == -1) { printf("0.0 0.0 0.0\n"); } else { printf("%.2f %.2f %.2f\n", averages[0], averages[1], averages[2]); } exit(0); }