Index: sysutils/lsof/files/patch-dialects_freebsd_dproc.c =================================================================== --- sysutils/lsof/files/patch-dialects_freebsd_dproc.c (revision 559460) +++ sysutils/lsof/files/patch-dialects_freebsd_dproc.c (working copy) @@ -15,7 +15,17 @@ _PROTOTYPE(static void enter_vn_text,(KA_T va, int *n)); _PROTOTYPE(static void get_kernel_access,(void)); -@@ -132,6 +140,15 @@ gather_proc_info() +@@ -118,6 +126,9 @@ gather_proc_info() + * streams with eXPORT data, + * where supported */ + struct filedesc fd; ++#if defined(PWDDESC_KVM_LOAD_PWD) ++ struct pwddesc pd; ++#endif /* defined(PWDDESC_KVM_LOAD_PWD) */ + int i, nf; + MALLOC_S nb; + +@@ -132,6 +143,15 @@ gather_proc_info() KA_T fa; #endif /* defined(HAS_FDESCENTTBL) */ @@ -31,7 +41,7 @@ static ofb_t *ofb = NULL; static int ofbb = 0; int pgid, pid; -@@ -305,13 +322,29 @@ gather_proc_info() +@@ -305,13 +325,34 @@ gather_proc_info() if (!fd.fd_files || kread((KA_T)fd.fd_files, (char *)&fdt, sizeof(fdt))) continue; @@ -45,7 +55,12 @@ +#if defined(HAS_PWD) + cdir = rdir = jdir = NULL; ++#if defined(PWDDESC_KVM_LOAD_PWD) ++ pwd_addr = (KA_T)PWDDESC_KVM_LOAD_PWD(&pd); ++#else /* !defined(PWDDESC_KVM_LOAD_PWD) */ + pwd_addr = (KA_T)FILEDESC_KVM_LOAD_PWD(&fd); ++#endif /* defined(PWDDESC_KVM_LOAD_PWD) */ ++ + if (pwd_addr != 0) { + if (!kread(pwd_addr, (char *)&pwd, sizeof(pwd))) { + cdir = pwd.pwd_cdir; @@ -62,7 +77,7 @@ /* * Allocate a local process structure. */ -@@ -347,20 +380,20 @@ gather_proc_info() +@@ -347,20 +388,20 @@ gather_proc_info() /* * Save current working directory information. */ @@ -87,7 +102,7 @@ if (Lf->sf) link_lfile(); } -@@ -369,10 +402,10 @@ gather_proc_info() +@@ -369,10 +410,10 @@ gather_proc_info() /* * Save jail directory information. */ @@ -100,7 +115,7 @@ if (Lf->sf) link_lfile(); } -@@ -655,7 +688,29 @@ kread(addr, buf, len) +@@ -655,7 +696,29 @@ kread(addr, buf, len) return((br == len) ? 0 : 1); } @@ -130,7 +145,7 @@ /* * process_text() - process text information */ -@@ -682,20 +737,15 @@ process_text(vm) +@@ -682,20 +745,15 @@ process_text(vm) /* * Read the vm_map structure. Search its vm_map_entry structure list. */