Den 02-09-2012 18:44, Albert Chin skrev:

> Added AC_SYS_LARGEFILE to configure.ac and ran autoconf/autoheader.

Ah, it seems to be a wellknown problem on the net, that you will get in 
trouble with swapctl and procfs ...

The following seems to fix the compilation. Could you try if it also 
fixes the running agent?


diff --git a/agent/mibgroup/hardware/memory/memory_solaris.c 
b/agent/mibgroup/ha
rdware/memory/memory_solaris.c
index 42f203e..1615b61 100644
--- a/agent/mibgroup/hardware/memory/memory_solaris.c
+++ b/agent/mibgroup/hardware/memory/memory_solaris.c
@@ -5,6 +5,13 @@

  #include <unistd.h>
  #include <kstat.h>
+
+/* avoid swap.h error "Cannot use swapctl in the large files 
compilation enviro
nment" */
+#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
+#  undef _FILE_OFFSET_BITS
+#  undef _LARGEFILE64_SOURCE
+#endif
+
  #include <sys/stat.h>
  #include <sys/swap.h>

diff --git a/agent/mibgroup/host/data_access/swrun_procfs_psinfo.c 
b/agent/mibgroup/host/data_access/swrun_procfs_psinfo.c
index ed961ee..52a252a 100644
--- a/agent/mibgroup/host/data_access/swrun_procfs_psinfo.c
+++ b/agent/mibgroup/host/data_access/swrun_procfs_psinfo.c
@@ -25,6 +25,10 @@

  #define HAVE_SYS_PROCFS_H    /* XXX - Needs a configure check! */
  #ifdef HAVE_SYS_PROCFS_H
+#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
+#  undef _FILE_OFFSET_BITS
+#  undef _LARGEFILE64_SOURCE
+#endif
  #define _KERNEL              /* For psinfo_t */
  #include <sys/procfs.h>
  #undef _KERNEL


/Niels

-- 
Niels Baggesen - @home - Ã…rhus - Denmark - n...@users.sourceforge.net
The purpose of computing is insight, not numbers   ---   R W Hamming

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to