Index: trunk/src/kern_head.c
===================================================================
--- trunk/src/kern_head.c	(revision 8)
+++ trunk/src/kern_head.c	(revision 9)
@@ -713,8 +713,15 @@
     }
 
+#ifdef __OpenBSD__
+  if      (utbuf.release[0] == '3')
+    which = 38;
+#else
   if      (utbuf.release[0] == '4')
     which = 4;
   else if (utbuf.release[0] == '5')
     which = 5;
+  else if (utbuf.release[0] == '6')
+    which = 5;
+#endif
   else
     {
@@ -757,11 +764,25 @@
       exit(EXIT_FAILURE);
     }
+  else if (i == 1)
+    {
+      fprintf(stderr, "check_sysent: kvm_nlist: _sysent not found\n");
+      exit(EXIT_FAILURE);
+    }
+  else if (list[0].n_value == 0)
+    {
+      fprintf(stderr, "check_sysent: kvm_nlist: zero address for _sysent\n");
+      exit(EXIT_FAILURE);
+    }
 
   if (which == 4)
     printf("\n/* Kernel %s, machine %s -- use table %s */\n\n", 
         	 utbuf.release, utbuf.machine, "callz_fbsd");
-  if (which == 5)
+  else if (which == 5 || which == 6)
     printf("\n/* Kernel %s, machine %s -- use table %s */\n\n",
                  utbuf.release, utbuf.machine, "callz_fbsd5");
+  else if (which == 38)
+    printf("\n/* Kernel %s, machine %s -- use table %s */\n\n",
+                 utbuf.release, utbuf.machine, "callz_obsd");
+      
       
   i = 0;
@@ -776,7 +797,7 @@
 	(utbuf.release[3] == '0'))
       {
-	sys_list[336].n_name = callz_fbsd[290]; /* sendfile -> nosys */
+	sys_list[336].n_name = callz_fbsd[151]; /* sendfile -> nosys */
       }
-  } else {
+  } else if (which == 5 || which == 6) {
     while ((callz_fbsd5[i] != NULL) && (i < SYS_MAXSYSCALL))
       {
@@ -786,4 +807,13 @@
       }
   }
+  else if (which == 38) {
+    while ((callz_obsd[i] != NULL) && (i < SYS_MAXSYSCALL))
+      {
+	sys_list[i].n_name = callz_obsd[i];
+	/* fprintf(stderr, "sys_list[%d] = %s\n", i, sys_list[i].n_name); */
+	++i;
+      }
+  }
+  
   count = i;
   sys_list[i].n_name = NULL;
@@ -799,5 +829,5 @@
 	fprintf(stderr, "check_sysent: kvm_nlist: %d out of %d invalid.\n",
 		i, count);
-	fprintf(stderr, "              Probably callz_fbsd in kern_head.c\n");
+	fprintf(stderr, "              Probably the table in kern_head.h\n");
 	fprintf(stderr, "              is not for your kernel version.\n");
 	fprintf(stderr, "              (No reason to worry, kcheck will "\
@@ -832,5 +862,5 @@
 	 sys_list[i].n_value != 0 &&
 	 0 != strcmp(sys_list[i].n_name, "_nosys") &&
-	 (unsigned long)sy.sy_call != sys_list[290].n_value)  
+	 (unsigned long)sy.sy_call != sys_list[151].n_value)  
 	{
           fprintf(stderr,
