30 |
|
#include <sys/types.h> |
31 |
|
#endif |
32 |
|
#include <utmp.h> |
33 |
+ |
|
34 |
+ |
#ifdef SOLARIS |
35 |
+ |
#define MAX_LOGIN_NAME_SIZE 8 |
36 |
+ |
#endif |
37 |
+ |
#if defined(LINUX) || defined(FREEBSD) |
38 |
+ |
#define MAX_LOGIN_NAME_SIZE UT_NAMESIZE |
39 |
+ |
#endif |
40 |
|
#ifdef NETBSD |
34 |
– |
#include <limits.h> |
35 |
– |
#undef MAX_LOGIN_NAME_SIZE |
41 |
|
#define MAX_LOGIN_NAME_SIZE _POSIX_LOGIN_NAME_MAX |
42 |
|
#endif |
43 |
+ |
#if defined(CYGWIN) |
44 |
+ |
#define MAX_LOGIN_NAME_SIZE _SC_LOGIN_NAME_MAX |
45 |
+ |
#endif |
46 |
|
|
47 |
|
#define START_VAL (5*(1+MAX_LOGIN_NAME_SIZE)) |
48 |
|
|
52 |
|
static user_stat_t user_stats; |
53 |
|
static int size_of_namelist=-1; |
54 |
|
char *tmp; |
55 |
< |
#if defined(SOLARIS) || defined(LINUX) |
55 |
> |
#if defined(SOLARIS) || defined(LINUX) || defined(CYGWIN) |
56 |
|
struct utmp *entry; |
57 |
|
#endif |
58 |
|
#ifdef ALLBSD |
72 |
|
/* Essentially blank the list, or give it a inital starting string */ |
73 |
|
strcpy(user_stats.name_list, ""); |
74 |
|
|
75 |
< |
#if defined(SOLARIS) || defined(LINUX) |
75 |
> |
#if defined(SOLARIS) || defined(LINUX) || defined(CYGWIN) |
76 |
|
setutent(); |
77 |
|
while((entry=getutent()) != NULL) { |
78 |
|
if(entry->ut_type==USER_PROCESS) { |