/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <dirent.h>
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
#include <fcntl.h>
static int nhosts;
struct hs {
int hs_nusers;
};
static char *interval();
static int aflg;
/* ARGSUSED */
int
{
int f, i;
int cc;
char *name;
int maxloadav = 0;
while (*++argv)
while (**argv)
switch (*(*argv)++) {
case 'a':
aflg++;
break;
case 'l':
break;
case 'u':
break;
case 't':
break;
case 'r':
break;
case '-':
break;
default:
" (choose at most one of l, t, or u)\n",
name);
exit(1);
}
exit(1);
}
exit(1);
}
exit(1);
}
exit(1);
}
continue;
continue;
/*
* We trust that the file system's limit on the number
* of files in a directory will kick in long before
* integer overflow.
*/
/*
* hsp points into an area about to be moved,
* so we first remember its offset into hs[],
* then restore it after realloc() has moved
* the data.
*/
exit(1);
}
}
if (f > 0) {
whdrsize);
for (i = 0; i < 2; i++)
/* LINTED: pointer alignment */
}
}
(void) close(f);
}
if (nhosts == 0) {
(void) printf("no hosts!?!\n");
exit(1);
}
for (i = 0; i < nhosts; i++) {
"down"));
continue;
}
(void) printf("%-12s%s, %4d user%s load %*.2f,"
" %*.2f, %*.2f\n",
}
return (0);
}
static char *
{
return (resbuf);
}
if (days)
else
return (resbuf);
}
static int
{
}
/*
* Compare according to load average.
*/
static int
{
else
return (rflg);
return (-rflg);
else
return (rflg *
}
/*
* Compare according to number of users.
*/
static int
{
else
return (rflg);
return (-rflg);
else
}
/*
* Compare according to uptime.
*/
static int
{
return (rflg * (
-
}