The #ifdeffed code may be needed on other platforms as well as Solaris.
That was why I recommended that particular line of code. I only have
access to Windows and Linux, but I would suggest testing on other
platforms only excluding Linux from the ifdef.
Andy
Mike Slifcak wrote:
The attached patch was added to patch 956272 which has the desired effect.
#if defined(STRUCT_STATVFS_HAS_F_FRSIZE) && !defined(linux)
Andy Smith wrote:
Try
#if defined(STRUCT_STATVFS_HAS_F_FRSIZE) && !defined(linux)
That worked for me.
Andy
Bruce Shaw wrote:
ARGG!!
Stupid newbie question.
How do I do a logical AND inside an ifdef? Something like..
#ifdef solaris2 AND STRUCT_STATVFS_HAS_F_FRSIZE
?
which reminds me...
where is the value of STRUCT_STATVFS_HAS_F_FRSIZE set anyway? It's
undef'd
in acconfig.h but i can't find where it gets assigned its value.
It looks like one of the recent patches broke the host resource mib on
Linux. I have tried compiling on a Mandrake 9.1 system and recieved the
following:
host/hr_filesys.c: In function `Get_FSSize':
host/hr_filesys.c:798: structure has no member named `f_frsize'
I'm wondering if I should be using #if instead of #ifdef.
------------------------------------------------------------------------
19-Jun-2004 Mike Slifcak
Modified from original patch "hr_filesys.FRSIZE.diff"
to be Solaris2 specific.
since Linux compiles failed
There may be other combinations that are more universal,
and those are left for another time.
--- net-snmp-5.1.2.pre2/agent/mibgroup/host/hr_filesys.c 2004-06-15
05:29:04.000000000 -0600
+++ agent/mibgroup/host/hr_filesys.c 2004-06-16 15:01:35.725565000 -0600
@@ -804,10 +804,14 @@
* in case of 512 (f_blocks/2) is returned
* otherwise (f_blocks*(f_bsize/1024)) is returned
*/
- if (statfs_buf.f_bsize == 512)
- return (statfs_buf.f_blocks/2);
+#if defined(solaris2) && defined(STRUCT_STATVFS_HAS_F_FRSIZE)
+ return (statfs_buf.f_blocks*(statfs_buf.f_frsize/1024));
+#else
+ if (statfs_buf.f_bsize == 512)
+ return (statfs_buf.f_blocks/2);
else
- return (statfs_buf.f_blocks*(statfs_buf.f_bsize/1024));
+ return (statfs_buf.f_blocks*(statfs_buf.f_bsize/1024));
+#endif
else
return -1;
}
--
--------------------------
Andy Smith, MCP
[EMAIL PROTECTED]
--------------------------
-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders