users.c revision f22acdfff536d452df49dd85c5ecd42092b8fcad
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* users
*/
#include <stdio.h>
#include <stdlib.h>
#include <utmpx.h>
#include <string.h>
static char **names;
static char **namp;
static char *strndup(char *p, int n);
static int scmp(const void *p, const void *q);
static void summary(void);
int
{
int nusers = 0;
if (argc == 2)
exit(1);
}
setutxent();
continue;
continue;
continue;
bufflen *= 2;
bufflen * sizeof (char *));
}
nusers++;
}
endutxent();
summary();
return (0);
}
static char *
strndup(char *p, int n)
{
register char *x;
x = malloc(n + 1);
(void) strlcpy(x, p, n + 1);
return (x);
}
static int
scmp(const void *p, const void *q)
{
return (strcmp((char *)p, (char *)q));
}
static void
summary(void)
{
register char **p;
if (p != names)
(void) putchar(' ');
}
(void) putchar('\n');
}