commit 02cee5b29a0c28a1fd6574a180972bd0de5aefe7 Author: Robert Story Date: Tue Mar 13 17:06:11 2012 -0400 use 64bit versions of statfs/statvfs if available diff --git a/agent/mibgroup/hardware/fsys/fsys_mntent.c b/agent/mibgroup/hardware/fsys/fsys_mntent.c index 6d39fa4..aae4ef1 100644 --- a/agent/mibgroup/hardware/fsys/fsys_mntent.c +++ b/agent/mibgroup/hardware/fsys/fsys_mntent.c @@ -42,7 +42,11 @@ #define NSFS_DEV mnt_special #define NSFS_TYPE mnt_fstype +#ifdef HAVE_STATVFS64 +#define NSFS_STATFS statvfs64 +#else #define NSFS_STATFS statvfs +#endif #define NSFS_SIZE f_frsize #else @@ -52,7 +56,11 @@ #define NSFS_DEV mnt_fsname #define NSFS_TYPE mnt_type +#ifdef HAVE_STATFS64 +#define NSFS_STATFS statfs64 +#else #define NSFS_STATFS statfs +#endif #define NSFS_SIZE f_bsize #endif @@ -188,6 +196,7 @@ netsnmp_fsys_arch_load( void ) ((m = getmntent(fp)) != NULL ) #endif { + DEBUGMSGTL(("fsys:load", "Loading %s\n", m->NSFS_PATH)); entry = netsnmp_fsys_by_path( m->NSFS_PATH, NETSNMP_FS_FIND_CREATE ); if (!entry) { continue; @@ -224,10 +233,11 @@ netsnmp_fsys_arch_load( void ) */ if ( (entry->flags & NETSNMP_FS_FLAG_REMOTE) && netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, - NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES)) + NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES)) { + DEBUGMSGTL(("fsys:load", "skipping nfs file system\n")); continue; + } - DEBUGMSTCTL(("rstory", "statfs on %s\n", entry->path)); #ifdef irix6 if ( NSFS_STATFS( entry->path, &stat_buf, sizeof(struct statfs), 0) < 0 ) #else diff --git a/configure b/configure index 5269d2c..cd75c92 100755 --- a/configure +++ b/configure @@ -25263,7 +25263,7 @@ fi # Agent: -for ac_func in cgetnext chown execv gai_strerror getgrnam gethostname getloadavg getpid getpwnam hasmntopt initgroups if_nameindex if_indextoname if_nametoindex localtime_r mkstemp mktime poll regcomp setgid setgroups setmntent setuid sigaction sigblock sighold sigprocmask statfs statvfs statvfs64 stime strncasecmp system uname usleep +for ac_func in cgetnext chown execv gai_strerror getgrnam gethostname getloadavg getpid getpwnam hasmntopt initgroups if_nameindex if_indextoname if_nametoindex localtime_r mkstemp mktime poll regcomp setgid setgroups setmntent setuid sigaction sigblock sighold sigprocmask statfs statfs64 statvfs statvfs64 stime strncasecmp system uname usleep do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/configure.d/config_os_functions b/configure.d/config_os_functions index fec4583..942b829 100644 --- a/configure.d/config_os_functions +++ b/configure.d/config_os_functions @@ -99,7 +99,7 @@ AC_CHECK_FUNCS([cgetnext chown execv ] dnl [setmntent setuid ] dnl [sigaction sigblock sighold ] dnl [sigprocmask ] dnl - [statfs statvfs statvfs64 stime ] dnl + [statfs statfs64 statvfs statvfs64 stime ] dnl [strncasecmp system ] dnl [uname usleep ] ) diff --git a/include/net-snmp/net-snmp-config.h.in b/include/net-snmp/net-snmp-config.h.in index dfc9cc1..9e2c0a0 100644 --- a/include/net-snmp/net-snmp-config.h.in +++ b/include/net-snmp/net-snmp-config.h.in @@ -737,6 +737,9 @@ /* Define to 1 if you have the `statfs' function. */ #undef HAVE_STATFS +/* Define to 1 if you have the `statfs64' function. */ +#undef HAVE_STATFS64 + /* Define to 1 if you have the `statvfs' function. */ #undef HAVE_STATVFS