summaryrefslogtreecommitdiff
path: root/util/ectool/ectool.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/ectool/ectool.c')
-rw-r--r--util/ectool/ectool.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/util/ectool/ectool.c b/util/ectool/ectool.c
index c93eb256e7..50ac30b5e5 100644
--- a/util/ectool/ectool.c
+++ b/util/ectool/ectool.c
@@ -18,10 +18,17 @@
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
+#ifndef __NetBSD__
#include <sys/io.h>
+#endif
#include <ec.h>
#include <stdlib.h>
+#ifdef __NetBSD__
+#include <machine/sysarch.h>
+#endif
+
+
#define ECTOOL_VERSION "0.1"
void print_version(void)
@@ -106,7 +113,15 @@ int main(int argc, char *argv[])
}
}
+#ifdef __NetBSD__
+# ifdef __i386__
+ if (i386_iopl(3)) {
+# else
+ if (x86_64_iopl(3)) {
+# endif
+#else
if (iopl(3)) {
+#endif
printf("You need to be root.\n");
exit(1);
}