swap: fix the build on FreeBSD
This commit is contained in:
parent
8ee080b414
commit
68e4c8bd31
|
@ -19,13 +19,15 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#if defined(__APPLE__) || defined(__FreeBSD__)
|
#if defined(__APPLE__)
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <sys/sysctl.h>
|
# include <sys/sysctl.h>
|
||||||
# include <sys/vmmeter.h>
|
# include <sys/vmmeter.h>
|
||||||
# if defined(__FreeBSD__)
|
#elif defined(__FreeBSD__)
|
||||||
# include <vm/vm_param.h>
|
# include <sys/types.h>
|
||||||
# endif
|
# include <sys/sysctl.h>
|
||||||
|
# include <sys/vmmeter.h>
|
||||||
|
# include <vm/vm_param.h>
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
# include <sys/sysinfo.h>
|
# include <sys/sysinfo.h>
|
||||||
#elif defined(__NetBSD__)
|
#elif defined(__NetBSD__)
|
||||||
|
@ -190,7 +192,7 @@ static gboolean _swap_on_timeout(gpointer data)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__)
|
||||||
int mib[] = { CTL_VM, VM_TOTAL };
|
int mib[] = { CTL_VM, VM_TOTAL };
|
||||||
struct vmmeter vm;
|
struct vmtotal vm;
|
||||||
size_t size = sizeof(vm);
|
size_t size = sizeof(vm);
|
||||||
gdouble value;
|
gdouble value;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user