pkgsrc/sysutils/mesure/patches/patch-ab
kamil 72d2cf9ea2 Correct mesure build on NetBSD 8.99.1
Address <sys/user.h> removal fallout.
2017-06-23 19:13:15 +00:00

37 lines
880 B
Text

$NetBSD: patch-ab,v 1.2 2017/06/23 19:13:15 kamil Exp $
--- src/mem.c.orig 2005-08-10 07:06:16.000000000 +0000
+++ src/mem.c
@@ -7,10 +7,12 @@
#include <sys/fcntl.h>
#include <stdio.h>
#include <unistd.h>
-#if !__linux__
+#if !defined(__linux__)
+#if defined(__FreeBSD__) || defined(__DragonFly__)
#include <sys/user.h>
+#endif
#include <kvm.h>
-#if __FreeBSD__ || __APPLE__
+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__DragonFly__)
#define KVM_NO_FILES O_RDONLY
#endif
#endif
@@ -26,7 +28,7 @@ mem_get_value()
{
long total=0;
-#if __linux__
+#if defined(__linux__)
FILE *fd;
char var[1024];
long val,memtotal,memfree;
@@ -56,7 +58,7 @@ mem_get_value()
total*=1024;
#else
-#if __FreeBSD__ || __APPLE__
+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__DragonFly__)
printf("Not yet supported on FreeBSD.\n");
exit(1);
#else