])
AC_CHECK_HEADERS(IOKit/ps/IOPSKeys.h)
-# For the `disk' plugin
-AC_CHECK_HEADERS(IOKit/IOBSD.h)
-AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDriver.h)
-
# For load module
AC_CHECK_HEADERS(sys/loadavg.h)
AC_CHECK_FUNCS(strncasecmp strcasecmp)
AC_CHECK_FUNCS(openlog syslog closelog)
+nanosleep_needs_rt="no"
+AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
+AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
+
# For cpu module
AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
if BUILD_WITH_RRDTOOL
collectd_LDFLAGS += -lm -lrrd
endif
+if BUILD_WITH_LIBRT
+collectd_LDFLAGS += -lrt
+endif
if BUILD_WITH_LIBSOCKET
collectd_LDFLAGS += -lsocket
endif
pkglib_LTLIBRARIES += disk.la
disk_la_SOURCES = disk.c
disk_la_LDFLAGS = -module -avoid-version
-if BUILD_WITH_LIBIOKIT
-disk_la_LDFLAGS += -lIOKit
-endif
collectd_LDADD += "-dlopen" disk.la
collectd_DEPENDENCIES += disk.la
endif
return (1);
}
- fprintf (fh, "%d\n", getpid());
+ fprintf (fh, "%i\n", (int) getpid ());
fclose(fh);
return (0);
/* The `%.*s' is needed because there is no null-byte behind
* the name. */
- fprintf(log, ",%.*s", (tmp - name), name);
+ fprintf(log, ",%.*s", (int) (tmp - name), name);
}
fprintf(log, "\n");
fclose(log);
if ((entry = (hddname_t *) malloc (sizeof (hddname_t))) == NULL)
{
- syslog (LOG_ERR, "hddtemp: malloc (%u) == NULL", sizeof (hddname_t));
+ syslog (LOG_ERR, "hddtemp: malloc (%u) == NULL",
+ (unsigned int) sizeof (hddname_t));
free (name);
continue;
}
#define MODULE_NAME "nfs"
-#if defined(KERNEL_LINUX) || defined(HAVE_LIBKSTAT)
+/* #if defined(KERNEL_LINUX) || defined(HAVE_LIBKSTAT) */
+#if KERNEL_LINUX
# define NFS_HAVE_READ 1
#else
# define NFS_HAVE_READ 0
};
static int nfs3_procedures_ds_num = 22;
-#ifdef HAVE_LIBKSTAT
+#if HAVE_LIBKSTAT && 0
extern kstat_ctl_t *kc;
static kstat_t *nfs2_ksp_client;
static kstat_t *nfs2_ksp_server;
static void nfs_init (void)
{
-#ifdef HAVE_LIBKSTAT
+#if HAVE_LIBKSTAT && 0
kstat_t *ksp_chain;
nfs2_ksp_client = NULL;
}
#endif /* NFS_HAVE_READ */
-#if defined(KERNEL_LINUX)
+#if KERNEL_LINUX
static void nfs_read_stats_file (FILE *fh, char *inst)
{
char buffer[BUFSIZE];
#endif /* defined(KERNEL_LINUX) */
#undef BUFSIZE
-#ifdef HAVE_LIBKSTAT
+#if HAVE_LIBKSTAT && 0
static void nfs2_read_kstat (kstat_t *ksp, char *inst)
{
unsigned long long values[18];
#if NFS_HAVE_READ
static void nfs_read (void)
{
-#if defined(KERNEL_LINUX)
+#if KERNEL_LINUX
FILE *fh;
if ((fh = fopen ("/proc/net/rpc/nfs", "r")) != NULL)
/* #endif defined(KERNEL_LINUX) */
-#elif defined(HAVE_LIBKSTAT)
+#elif HAVE_LIBKSTAT && 0
if (nfs2_ksp_client != NULL)
nfs2_read_kstat (nfs2_ksp_client, "client");
if (nfs2_ksp_server != NULL)