Index: Configure
--- Configure.orig	2010-01-18 20:01:14 +0100
+++ Configure	2010-01-19 20:14:11 +0100
@@ -443,7 +443,7 @@
       fi	# }
     fi	# }
     LSOF_TGT="aix"
-    echo $LSOF_CC | grep gcc > /dev/null
+    $LSOF_CC --version | grep GCC > /dev/null
     if test $? -eq 0	# {
     then
 
@@ -597,7 +597,7 @@
 
 	    rm -f dialects/aix/aix5/j2/j2_snapshot.h
 	  fi	# }
-	  echo $LSOF_CC | grep gcc > /dev/null
+	  $LSOF_CC --version | grep GCC > /dev/null
 	  if test $? -eq 0	# {
 	  then
 
@@ -635,7 +635,7 @@
       # This is AIX >= 5 on ia64.
 
 	LSOF_TSTK64=1
-	echo $LSOF_CC | grep gcc > /dev/null
+	$LSOF_CC --version | grep GCC > /dev/null
 	if test $? -eq 0	# {
 	then
 
@@ -712,7 +712,7 @@
 	  fi	# }
 	  LSOF_TSTK64=1
 	  LSOF_TMP1=1
-	  echo $LSOF_CC | grep gcc > /dev/null
+	  $LSOF_CC --version | grep GCC > /dev/null
 	  if test $? -eq 0	# {
 	  then
 	    LSOF_CFGF="$LSOF_CFGF -maix64"
@@ -759,7 +759,7 @@
     fi	#}
     LSOF_CFGF="$LSOF_CFGF -DAIXV=$LSOF_VERS"
     LSOF_DIALECT_DIR=aix
-    echo $LSOF_CC | grep gcc > /dev/null
+    $LSOF_CC --version | grep GCC > /dev/null
     if test $? -eq 0 	# {
     then
 
@@ -2239,7 +2239,7 @@
 	fi	# }
       fi	# }
     fi	# }
-    echo $LSOF_CC | grep gcc > /dev/null
+    $LSOF_CC --version | grep GCC > /dev/null
     if test $? -eq 0	# {
     then
       LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'`
@@ -2293,7 +2293,7 @@
       then
 	LSOF_CFGF="$LSOF_CFGF -Ae +DD32"
       else
-	echo $LSOF_CC | grep -q gcc
+	$LSOF_CC --version | grep -q GCC
 	if test $? -ne 0	# {
 	then
 	  LSOF_CFGF="$LSOF_CFGF +DD32"
@@ -2377,7 +2377,7 @@
 	    echo "* NOTICE!  Configuring for 64 bit HP-UX *"
 	    echo "*                                       *"
 	    echo "*****************************************"
-	    echo $LSOF_CC | grep gcc > /dev/null
+	    $LSOF_CC --version | grep GCC > /dev/null
 	    if test $? -eq 0	# {
 	    then
 
@@ -2446,7 +2446,7 @@
 	  else
 	    LSOF_CFGF="$LSOF_CFGF -D_FILE_OFFSET_BITS=64"
 	    LSOF_CINFO="${LSOF_CINFO}, 32 bit HP-UX"
-	    echo $LSOF_CC | grep gcc > /dev/null
+	    $LSOF_CC --version | grep GCC > /dev/null
 	    if test $? -ne 0	# {
 	    then
 	      LSOF_CFGF="$LSOF_CFGF +DAportable"
@@ -3655,7 +3655,7 @@
 	LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'`
       fi	# }
     fi	# }
-    echo $LSOF_CC | grep gcc > /dev/null
+    $LSOF_CC --version | grep GCC > /dev/null
     if test $? -eq 0	# {
     then
       LSOF_CFGL="$LSOF_CFGL -w"
@@ -4300,6 +4300,9 @@
 	LSOF_TSTBIGF=" "
 	LSOF_TSTLFLG="-lsocket -lnsl"
 	LSOF_VERS="100000"
+ 	if [ ".`isainfo -k`" = .amd64 ]; then
+ 	    LSOF_CFGL="$LSOF_CFGL -lmp -lmd5 -lscf -ldoor -luutil"
+ 	fi
 	;;
       5.11*)
 	LSOF_TSTBIGF=" "
@@ -4391,7 +4394,7 @@
 	echo "main(){" >> ${LSOF_TMPC}.c
 	echo "enum prnodetype p=PR_GWINDOWS;}" >> ${LSOF_TMPC}.c
 	echo "Testing prdata.h for PR_GWINDOWS, using $LSOF_CC"
-	echo $LSOF_CC | grep gcc > /dev/null
+	$LSOF_CC --version | grep GCC > /dev/null
 	if test $? -eq 0	# {
 	then
 	  $LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x  > /dev/null 2>&1
@@ -4416,7 +4419,7 @@
 	echo "main(){" >> ${LSOF_TMPC}.c
 	echo "enum prnodetype p=PR_LDT;}" >> ${LSOF_TMPC}.c
 	echo "Testing prdata.h for PR_LDT, using $LSOF_CC"
-	echo $LSOF_CC | grep gcc > /dev/null
+	$LSOF_CC --version | grep GCC > /dev/null
 	if test $? -eq 0	# {
 	then
 	  $LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x > /dev/null 2>&1
@@ -4450,7 +4453,7 @@
 	echo $SOLARIS_KERNBITS | grep 64 > /dev/null
 	if test $? -eq 0	# {
 	then
-	  echo $LSOF_CC | grep gcc > /dev/null
+	  $LSOF_CC --version | grep GCC > /dev/null
 	  if test $? -eq 0	# {
 	  then
 
@@ -4669,7 +4672,7 @@
       then
 	LSOF_CTFH=1
       fi	# }
-      if test -r ${LSOF_INCLUDE}/sys/fs/zfs.h	# {
+      if false	# {
       then
 	if test $LSOF_CTFH -eq 1	# {
 	then
@@ -4729,7 +4732,7 @@
       echo "main(){" >> ${LSOF_TMPC}.c
       echo "enum vtype p=VSOCK;}" >> ${LSOF_TMPC}.c
       echo "Testing vnode.h for VSOCK, using $LSOF_CC"
-      echo $LSOF_CC | grep gcc > /dev/null
+      $LSOF_CC --version | grep GCC > /dev/null
       if test $? -eq 0	# {
       then
 	$LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x > /dev/null 2>&1
@@ -5418,7 +5421,7 @@
     echo "$i" >> $LSOF_TSTCFLG
   done	# }
 fi	# }
-echo $LSOF_CC | grep gcc > /dev/null 2>&1
+$LSOF_CC --version | grep GCC > /dev/null 2>&1
 if test $? -eq 0	# {
 then
   echo "-DLT_GCC" >> $LSOF_TSTCFLG
Index: dialects/freebsd/machine.h
--- dialects/freebsd/machine.h.orig	2008-10-21 18:16:15 +0200
+++ dialects/freebsd/machine.h	2010-01-19 19:16:39 +0100
@@ -441,6 +441,11 @@
  */
 
 /* #define	HASSECURITY	1 */
+#if    FREEBSDV>=6000
+#define        HASSECURITY     1
+#define        HAS_SI_PRIV     1
+#endif /* FREEBSDV>=6000 */
+
 
 
 /*
Index: dialects/sun/machine.h
--- dialects/sun/machine.h.orig	2009-03-25 20:22:23 +0100
+++ dialects/sun/machine.h	2010-01-19 19:16:39 +0100
@@ -84,6 +84,7 @@
 #include <sys/poll.h>
 
 # if	solaris>=80000
+#include <sys/types32.h>
 #include <sys/wait.h>
 #include <sys/types32.h>
 #define	_KERNEL	1
--- Configure.orig	2019-05-22 14:43:59 UTC
+++ Configure
@@ -1639,7 +1639,7 @@ kernel generation process.
     # Clear LSOF_UNSUP message for supported versions of FreeBSD.
     
     case $LSOF_VERS in  # {
-    4090|8020|8030|8040|9000|10000|11000|12000)
+    4090|8020|8030|8040|9000|10000|11000|12000|13000)
       LSOF_UNSUP=""
       ;;
     esac	# }
--- dialects/freebsd/dlsof.h.orig	2019-05-08 07:32:25 UTC
+++ dialects/freebsd/dlsof.h
@@ -38,6 +38,7 @@
 #if	!defined(FREEBSD_LSOF_H)
 #define	FREEBSD_LSOF_H	1
 
+#include <stddef.h>
 #include <stdlib.h>
 #include <dirent.h>
 #include <nlist.h>
@@ -45,6 +46,12 @@
 #include <signal.h>
 #include <unistd.h>
 
+#if    FREEBSDV>=13000
+/* This header is a huge mess.  Please don't support EOL FreeBSD releases. */
+#define        _KERNEL 1
+#include <sys/_lock.h>
+#undef _KERNEL
+#endif         /* FREEBSDV>=13000 */
 # if	FREEBSDV>=4000
 #  if	FREEBSDV>=5000
 #   if	FREEBSDV<6020
@@ -104,6 +111,12 @@ typedef	struct device	*device_t;
 
 
 #include <sys/conf.h>
+
+/* 
+ * include <stdbool.h> for refcount(9)
+ */
+#include <stdbool.h>
+ 
 
 #  if	defined(HAS_VM_MEMATTR_T)
 #undef	vm_memattr_t
--- dialects/freebsd/dnode.c.orig	2019-12-19 21:29:42 UTC
+++ dialects/freebsd/dnode.c
@@ -58,9 +58,7 @@ _PROTOTYPE(static int lkup_dev_tty,(dev_t *dr, INODETY
 
 
 #if	defined(HAS_TMPFS)
-#define	_KERNEL
 #include <fs/tmpfs/tmpfs.h>
-#undef	_KERNEL
 #endif	/* defined(HAS_TMPFS) */
 
 _PROTOTYPE(static void get_lock_state,(KA_T f));
--- dialects/freebsd/dproc.c.orig	2019-05-08 07:32:25 UTC
+++ dialects/freebsd/dproc.c
@@ -655,7 +655,29 @@ kread(addr, buf, len)
 	return((br == len) ? 0 : 1);
 }
 
+static int
+vm_map_reader(void *token, vm_map_entry_t addr, vm_map_entry_t dest)
+{
+	return (kread((KA_T)addr, (char *)dest, sizeof(*dest)));
+}
 
+#if	__FreeBSD_version < 1300060
+typedef int vm_map_entry_reader(void *token, vm_map_entry_t addr,
+    vm_map_entry_t dest);
+
+static inline vm_map_entry_t
+vm_map_entry_read_succ(void *token, struct vm_map_entry *const clone,
+     vm_map_entry_reader reader)
+{
+	vm_map_entry_t next;
+
+	next = clone->next;
+	if (!reader(token, next, clone))
+		return (NULL);
+	return (next);
+}
+#endif	/*  __FreeBSD_version < 1300060 */
+
 /*
  * process_text() - process text information
  */
@@ -682,20 +704,15 @@ process_text(vm)
 /*
  * Read the vm_map structure.  Search its vm_map_entry structure list.
  */
+	vmme = vmsp.vm_map.header;
+	e = &vmme;
 	for (i = 0; i < vmsp.vm_map.nentries; i++) {
 
 	/*
 	 * Read the next vm_map_entry.
 	 */
-	    if (i == 0)
-		e = &vmsp.vm_map.header;
-	    else {
-		if (!(ka = (KA_T)e->next))
-		    return;
-		e = &vmme;
-		if (kread(ka, (char *)e, sizeof(vmme)))
-		    return;
-	    }
+	    if (!vm_map_entry_read_succ(NULL, e, vm_map_reader))
+		return;
 
 #if	defined(MAP_ENTRY_IS_A_MAP)
 	    if (e->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP))
--- dialects/freebsd/dsock.c.orig	2019-05-08 07:32:25 UTC
+++ dialects/freebsd/dsock.c
@@ -182,7 +182,7 @@ process_socket(sa)
 #endif	/* FREEBSDV<4050 */
 
 #if	defined(HASIPv6) && !defined(HASINRIAIPv6)
-	struct in6pcb in6p;
+	struct inpcb in6p;
 #endif	/* defined(HASIPv6) && !defined(HASINRIAIPv6) */
 
 	(void) snpf(Lf->type, sizeof(Lf->type), "sock");
