ports/sysutils/read-edid/files/patch-get-edid_classic.c
Alexey Dokuchaev 73966541c1 Add a port of read-edid utility, a pair of tools for reading the EDID from
a monitor.  It is mostly useful to read LCD matrix manufacturer and model.

WWW: http://www.polypux.org/projects/read-edid/

NB: TIMESTAMP line in distinfo should read as follows, but has to stay in
its current form due to a bug in the hook script:
TIMESTAMP (read-edid-3.0.2.tar.gz) = 1430271430
2016-08-20 18:43:29 +00:00

34 lines
773 B
C

--- get-edid/classic.c.orig 2015-04-29 01:08:34 UTC
+++ get-edid/classic.c
@@ -1,12 +1,12 @@
/* (c) 2000,2001,2002 John Fremlin */
/* (c) 2010,2011 Matthew Kern */
#ifdef CLASSICBUILD
+#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <sys/types.h>
-#include <sys/io.h>
#include <unistd.h>
#include <libx86.h>
@@ -135,8 +135,17 @@ classicmain( unsigned contr, int qit )
return 10;
}
+#if defined(__linux__)
ioperm(0, 0x400 , 1);
iopl(3);
+#elif defined(__FreeBSD__)
+#define DEV_IO_PATH "/dev/io"
+ if (open(DEV_IO_PATH, O_RDONLY) < 0) {
+ display("%s(): failed to open %s\n", __func__, DEV_IO_PATH);
+ return 11;
+ }
+#undef DEV_IO_PATH
+#endif
/*if ( argc == 1 )