1 |
|
/* |
2 |
|
* i-scream central monitoring system |
3 |
< |
* http://www.i-scream.org.uk |
4 |
< |
* Copyright (C) 2000-2002 i-scream |
3 |
> |
* http://www.i-scream.org |
4 |
> |
* Copyright (C) 2000-2003 i-scream |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or |
7 |
|
* modify it under the terms of the GNU General Public License |
26 |
|
#include <stdio.h> |
27 |
|
#include <string.h> |
28 |
|
#include "statgrab.h" |
29 |
< |
#ifdef FREEBSD |
29 |
> |
#ifdef ALLBSD |
30 |
|
#include <sys/types.h> |
31 |
|
#endif |
32 |
|
#include <utmp.h> |
33 |
+ |
#ifdef NETBSD |
34 |
+ |
#include <limits.h> |
35 |
+ |
#undef MAX_LOGIN_NAME_SIZE |
36 |
+ |
#define MAX_LOGIN_NAME_SIZE _POSIX_LOGIN_NAME_MAX |
37 |
+ |
#endif |
38 |
|
|
39 |
|
#define START_VAL (5*(1+MAX_LOGIN_NAME_SIZE)) |
40 |
|
|
47 |
|
#if defined(SOLARIS) || defined(LINUX) |
48 |
|
struct utmp *entry; |
49 |
|
#endif |
50 |
< |
#ifdef FREEBSD |
50 |
> |
#ifdef ALLBSD |
51 |
|
struct utmp entry; |
52 |
|
FILE *f; |
53 |
|
#endif |
85 |
|
} |
86 |
|
endutent(); |
87 |
|
#endif |
88 |
< |
#ifdef FREEBSD |
88 |
> |
#ifdef ALLBSD |
89 |
|
if ((f=fopen(_PATH_UTMP, "r")) == NULL){ |
90 |
|
return NULL; |
91 |
|
} |