$NetBSD: patch-ab,v 1.2 2010/12/30 08:20:42 obache Exp $

--- randread.c.orig	2002-06-21 07:11:29.000000000 +0000
+++ randread.c
@@ -3,7 +3,11 @@
  * by the author, Curt Sampson <cjs@cynic.net>.
  */
 
+#include <sys/types.h>
 #include <sys/disklabel.h>
+#ifdef __DragonFly__
+#include <sys/disklabel32.h>
+#endif
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/time.h>
@@ -100,9 +104,17 @@ int run_test()
  */
 int get_char_device_blocks(int filedes)
 {
+#ifdef __DragonFly__
+    struct disklabel32 label;
+#else
     struct disklabel label;
+#endif
 
+#ifdef __DragonFly__
+    if (ioctl(filedes, DIOCGDINFO32, &label) == -1)
+#else
     if (ioctl(filedes, DIOCGDINFO, &label) == -1)
+#endif
 	return -1;
 
     /* Hack to make it ignore what this returns. */
