Notes for the distribution of lsof version 4 ******************************************************************** | The latest release of lsof is always available from | https://github.com/lsof-org/lsof/releases | | From 4.92.1, git is introduced to manage changes. | You can consult the details of changes with git. ******************************************************************** Contents Dialects Supported How Lsof Works Lsof Output Getting Started Quickly Limiting, Filtering, and Selecting Lsof Output Parsing Lsof Output with Another Program Repeat Mode Distribution Restrictions Cautions Distribution Contents Warranty Bug Reports The lsof-l Mailing List Version 3 Release Notes 3.0, May 24, 1994 ... 3.88, February 17, 1997 What's New in Version 4 Version 4 Release Notes 4.0, February 24, 1997 4.01, March 3, 1997 4.02, March 21, 1997 4.03, April 7, 1997 4.04, April 17, 1997 4.04 supplement, April 18, 1997 4.05, April 24, 1997 4.06, April 30, 1997 4.07, May 12, 1997 4.08, May 23, 1997 4.09, June 1, 1997 4.10, June 8, 1997 4.11, June 12, 1997 4.12, June 24, 1997 4.13, July 9, 1997 4.14, July 22, 1997 4.15, August 15, 1997 4.16, September 25, 1997 4.17, October 14, 1997 4.18, October 25, 1997 4.19, October 30, 1997 4.20, November 11, 1997 4.21, December 1, 1997 4.22, December 15, 1997 4.23, January 16, 1998 4.24, January 28, 1998 4.25, February 7, 1998 4.26, February 17, 1998 4.27, March 6, 1998 4.28, March 10, 1998 4.29, March 26, 1998 4.30, April 9, 1998 4.31, April 21, 1998 4.32, May 13, 1998 4.33, May 22, 1998 4.34, June 26, 1998 4.35, July 17, 1998 4.36, August 4, 1998 4.37, September 15, 1998 4.38, November 25, 1998 4.39, December 29, 1998 4.40, January 25, 1999 4.41, February 27, 1999 4.42, March 30, 1999 4.43, May 11, 1999 4.44, June 24, 1999 4.45, July 30, 1999 4.46, October 23, 1999 4.47, November 29, 1999 4.48, January 14, 2000 4.49, April 3, 2000 4.50, June 29, 2000 4.51, August 21, 2000 4.52, November 8, 2000 4.53, December 6, 2000 4.54, January 19, 2001 4.55, February 15, 2001 4.56, May 3, 2001 4.57, July 19, 2001 4.58, September 13, 2001 4.59, October 20, 2001 4.60, November 9, 2001 4.61, January 22, 2002 4.62, March 7, 2002 4.63, April 23, 2002 4.64, June 26, 2002 4.65, October 10, 2002 4.66, December 22, 2002 4.67, March 27, 2003 4.68, June 18, 2003 4.69, October 16, 2003 4.70, January 16, 2004 4.71, March 11, 2004 4.72, July 13, 2004 4.73, October 21, 2004 4.74, January 17, 2005 4.75, May 16, 2005 4.76, August 30, 2005 4.77, April 10, 2006 4.78, April 24, 2007 4.79, April 15, 2008 4.80, May 12, 2008 4.81, October 21, 2008 4.82, March 25, 2009 4.83, January 18, 2010 4.84, July 29, 2010 4.85, September 27, 2011 4.86, April 10, 2012 4.87, January 2, 2013 4.88, October 13, 2014 4.89, July 7, 2015 4.90, February 14, 2018 4.91, March 26, 2018 4.92, May 5, 2018 4.93.0 May 7, 2019 4.93.1 May 7, 2019 4.93.2 May 8, 2019 4.94.0 November 11, 2020 4.95.0 April 28, 2022 4.96.0 September 16, 2022 4.96.1 September 16, 2022 4.96.2 September 16, 2022 4.96.3 September 16, 2022 4.96.4 October 18, 2022 4.96.5 December 26, 2022 4.97.0 January 17, 2023 4.98.0 January 22, 2023 4.99.0 November 10, 2023 Dialects Supported ================== Lsof (for LiSt Open Files) lists files opened by processes on selected Unix systems. Version 4 is a source reorganization of version 3, itself a major revision of version 2. Version 4 has been tested on: Apple Darwin 9 and Mac OS X 10.[567] FreeBSD 10.3, 11.0, 12.0 and 13.0 for AMD64-based systems Solaris 9 (The pub/tools/unix/lsof/contrib directory on lsof.itap.purdue.edu contains information on other ports.) If your favorite Unix dialect is not in the list, or if your version of it is more recent than the ones listed, please file a new issue at https://github.com/lsof-org/lsof. Version 3 of lsof was tested on: AIX 3.2.5, 4.1[.[1234]], and 4.2 BSDI BSD/OS 2.0, 2.0.1, and 2.1 for x86-based systems DC/OSx 1.1 for Pyramid systems Digital UNIX (DEC OSF/1) 2.0, 3.0, 3.2, and 4.0 EP/IX 2.1.1 for the CDC 4680 FreeBSD 1.1.5.1, 2.0, 2.0.5, 2.1, 2.1.5 for x86-based systems HP-UX 8.x, 9.x, 10.01, 10.10, and 10.20 IRIX 5.2, 5.3, 6.0, 6.0.1, and 6.[124] Linux through 2.0.27 for x86-based systems NetBSD 1.0, 1.1, and 1.2 for x86 and SPARC-based systems NEXTSTEP 2.1 and 3.[0123] OpenBSD 1.2 and 2.0 for x86-based systems Reliant UNIX 5.43 for Pyramid systems RISC/os 4.52 for MIPS R2000-based systems SCO OpenServer Release 1.1, 3.0, and 5.0.x for x86-based systems SCO UnixWare 2.1 and 2.1.1 for x86-based systems Sequent PTX 2.1.[1569], 4.0.[23], 4.1.[024], 4.2[.1], and 4.3 Solaris 2.[12345], 2.5.1, and 2.6-Beta SunOS 4.1.x Ultrix 4.2, 4.3, 4.4, and 4.5 Version 3 and its predecessor, version 2, may be found at: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/OLD How Lsof Works ============== Using available kernel data access methods -- getproc(), getuser(), kvm_*(), nlist(), pstat(), read(), readx(), /proc -- lsof reads process table entries, task table entries, user areas and file pointers to reach the underlying structures that describe files opened by processes. Lsof interprets most file node structures -- advfsnodes, autonodes, cnodes, cdrnodes, devnodes, fifonodes, gnodes, hsnodes, inodes, mfsnodes, pcnodes, procnodes, rnodes, snodes, specnodes, s5inodes, tmpnodes. It understands NFS connections. It recognizes FIFOs, multiplexed files, Unix and Internet sockets. It knows about streams. It understands /proc file systems for some dialects. On many dialects it recognizes execution text and library references. It knows about AFS on some Unix dialects. Lsof Output =========== The lsof output describes: * the identification number of the process (PID) that has opened the file; * the process group identification number (PGID) of the process (optional); * the process identification number of the parent process (PPID) (optional); * the command the process is executing; * the owner of the process; * for all files in use by the process, including the executing text file and the shared libraries it is using: * the file descriptor number of the file, if applicable; * the file's access mode; * the file's lock status; * the file's device numbers; * the file's inode number; * the file's size or offset; * the name of the file system containing the file; * any available components of the file's path name; * the names of the file's stream components; * the file's local and remote network addresses; * the TLI network (typically UDP) state of the file; * the TCP state, read queue length, and write queue length of the file; * the file's TCP window read and write lengths (Solaris only); * other file or dialect-specific values. Getting Started Quickly ======================= If you want to get started using lsof quickly, or see some examples of how lsof can be used, consult the 00QUICKSTART file of the lsof distribution. The 00QUICKSTART file won't help you build or install lsof, but it will cut through the density of the lsof man page, giving you more readily an idea of what you can do with lsof. For information on building and installing lsof, consult the 00README file of the lsof distribution. Limiting, Filtering, and Selecting Lsof Output ============================================== Lsof accepts options to limit, filter, and select its output. These are the possible criteria: * Process ID (PID) number -- to list the open files for a given process; * Process Group ID (PGID) -- to list the open files for all the processes of a given process group; * User ID number or login name -- to list the open files for all the processes of a given user; * Internet address -- to list the open files using a given Internet address (host name), protocol, or port (number or name); or to list all open Internet files; * command name; * file descriptor name or number; * list all open NFS files; * list all open Unix domain socket files; * list all uses of a specific file; * list all open files on a file system. Selection options are normally ORed -- i.e., an open file meeting any of the criteria is listed. The selection options may be ANDed so that an open file will be listed only if it meets all the criteria. In the absence of any selection criteria, lsof lists files open to all processes. Parsing Lsof Output with Another Program ======================================== The lsof -F option directs it to produce "field" output that can easily be parsed by another program. The lsof distribution contains sample awk, perl 4, and perl 5 scripts in its scripts subdirectory that show how to post-process field output. Repeat Mode =========== Lsof can be directed to produce output, delay for a specified time, then repeat the output, cycling until stopped by an interrupt or quit signal. This mode is useful for monitoring the status of some file operation -- e.g., an ftp transfer or a tape backup operation. Repeat mode is more efficient when combined with lsof's selection options, since they limit lsof overhead. It's possible to use lsof's field output options to supply repeat mode output to another process for its manipulation. The scripts subdirectory of the lsof distribution has sample Perl scripts showing how to consume lsof repeat mode output from a pipe. Distribution Restrictions ========================= Lsof may be used and distributed freely, subject to these limitations: 1. Neither the author nor Purdue University is responsible for any consequences of the use of this software. 2. The origin of this software must not be misrepresented, either by explicit claim or by omission. Credit to the author and Purdue University must appear in documentation and sources. 3. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. This notice may not be removed from or altered in the lsof source files. Cautions ======== Lsof is a tool that is closely tied to the Unix operating system version. It uses header files that describe kernel structures and reads kernel structures that typically change from OS version to OS version. DON'T TRY TO USE AN LSOF BINARY, COMPILED FOR ONE UNIX OS VERSION, ON ANOTHER. On some Unix dialects, notably SunOS and Solaris, lsof versions may be even more restricted by architecture type. An lsof binary, compiled for SunOS 4.1.3 on a sun4c machine, for example, won't work on a sun4m machine. AN LSOF BINARY, COMPILED FOR ONE SOLARIS 1.X ARCHITECTURE, ISN'T GUARANTEED TO WORK ON A DIFFERENT SOLARIS 1.X ARCHITECTURE. Distribution Contents ===================== The lsof distribution is checked for completeness when it is constructed and by the Inventory script when you run the Configure script. (See The Inventory Script section of the 00README file of this distribution.) Lsof is organized in these parts: * The main lsof directory, containing common sources, configuration and setup scripts and three subdirectories: dialects/, lib/, and scripts/. Lsof is compiled in the main lsof directory after configuration. The selected dialect sources are copied or linked from the specified subdirectory. (Symbolic linking is the standard method.) Common lsof definitions may be found in lsof.h; common function prototypes, proto.h; and common storage, store.c. * The dialects/ subdirectory contains subdirectories with sources specific to UNIX dialect implementations -- e.g., the dialects/sun/ subdirectory contains sources for the SunOS (Solaris 1.x) and Solaris (2.x) implementations of lsof. The dialects subdirectories also contain Makefiles and scripts for assisting dialect source configuration. Dialect configuration definitions may be found in dlsof.h; other dialect definitions, dlsof.h; dialect prototypes, dproto.h; and dialect storage, dstore.c. * The lib/ subdirectory contains sources for common lsof functions. Not all dialects use the functions -- some have their own versions of them. The lib/ functions are enabled and customized with #define's in the dialect machine.h header files. * The scripts/ subdirectory contains sample scripts for processing lsof field (-F) output. The scripts are written in AWK, Perl 4, and Perl 5. The 00PORTING file of the lsof distribution has more information on lsof components, configuration, and construction. Warranty ======== Lsof is provided as-is without any warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of lsof is with you. Should lsof prove defective, you assume the cost of all necessary servicing, repair, or correction. Bug Reports =========== Now that the obligatory disclaimer is out of the way, let me hasten to add that I accept lsof bug reports and try hard to respond to them. I will also consider and discuss requests for new features, ports to new dialects, or ports to new OS versions. PLEASE DON'T SEND A BUG REPORT ABOUT LSOF TO THE UNIX DIALECT VENDOR. At worst such a bug report will confuse the vendor; at best, the vendor will forward the bug report to me. Please send all bug reports, requests, etc. to https://github.com/lsof-org/lsof. The lsof-l Mailing List ======================= Information about lsof, including notices about the availability of new revisions, may be found in mailings of the lsof-l listserv. For more information about it, including instructions on how to subscribe, read the 00LSOF-L file of the lsof distribution. Version 3 Release Notes ======================= See 00DIST in the last lsof 3 revision 3.88, for its complete set of release notes. Lsof revision 3.88 may be found at: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/OLD 3.0 May 24, 1994 This is the first official release of lsof 3. ... 3.88 February 17, 1997 +======================================+ | This is the last version 3 revision. | +======================================+ Added documentation files -- 00.README.FIRST[_] and 00RELEASE.SUMMARY_ -- to the distribution. What's new in Version 4 ======================= The main goal of version 4 was to eliminate the confusing common/ fragment source file technique. Changing the version number also provided an opportunity to restart the numbering, which at 3.88 had risen to a large value. The sources that appeared in the dialects/common subdirectory of version 3 in fragment files have been incorporated into the version 4 liblsof.a library as *.c files. This results in significant changes to many source files, scripts, and Makefiles of all dialect versions. It allows elimination of some source files -- ddev.c, dfile.c, dmnt.c -- for dialects now obtaining functions from liblsof.a that formerly came from making dialect source files by combining fragment files. The version 4 liblsof.a sources are stored in the lib/ subdirectory of the main lsof directory. The liblsof.a functions are activated and conditioned in their source files by values #define'd in the dialect dlsof.h and machine.h header files. Dialects that provide a private version of a library function refrain from #define'ing the symbol that would activate the library function code. Version 4 Release Notes ======================= 4.0 February 24, 1997 +====================================+ | This is the first lsof 4 revision. | +====================================+ Reorganized sources: eliminated code fragment files and created a library in their place. Modified or deleted many dialect source and header files. Changed documentation accordingly. Added a warning to sgi/Makefile and 00FAQ that advises against using the IRIX C compiler -n32 option when compiling lsof. Thanks go to Peter Ilieve for bringing this to my attention. Dropped IRIX 5.2 in mid-stream, because my 5.2 test system was upgraded to 5.3. 4.01 March 3, 1997 Added TFS support for Pyramid dialects. Added test to Configure and to the IRIX dnode.c for the different cnode struct that appears in on the 6.2 IMPACT distribution. Heddy Boubaker alerted me to the cnode change and helped test this lsof adjustment. Shut down the lsof child process before doing a -r sleep(). A comment from Dan Mercer prompted this. 4.02 March 21, 1997 Based on a report from Pasi Kaara , disabled HP-UX CCIT support in lsof for HP-UX versions 10 and above. Pasi's report also led to changes in the HP-UX machine.h to support use of gcc to compile lsof for HP-UX 10.20 and warnings against using `cc -Aa` or `gcc -ansi` to compile lsof under HP-UX 10.x. With help from Richard Allen taught HP-UX 10.x lsof to name file systems better by using the virtual file system device number. Elias Halldor Agustsson provided a test system. Changed NEXTSTEP and UNIXWARE Makefiles to use safer quoting when generating version.h. The change was suggested by Bob Farmer . Added SHELL=/bin/sh string to all Makefiles. Added support for Linux 2.1.28 on a test system, kindly provided by Jonathan Sergent . Configure tests the Linux 2.1.x's C library lseek() function for proper handling of kernel offsets. If lseek() appears suspect, Configure activates the use of a private lseek() function. Changed the private nlist() function to nlist_private() and taught it to use the query_module() syscall in place of the deprecated get_kernel_syms() one. Added rudimentary AX.25 support for Pierfrancesco Caci who helped test it. Updated the old get_kernel_syms() code to recognize and skip module name entries. Prompted by Marty Leisner , eased the requirement that service name lookup for the -i option be accompanied by a protocol name. The name is not needed if both TCP and UDP names yield the same port number. Added xusers.awk script from Dan Mercer to the distribution scripts/ subdirectory. Changed Configure script to use LSOF_VERS for all UNIX dialect version numbers and to pass LSOF_VERS to the dialect Mksrc functions. Also added the ability for a dialect stanza to declare a different dialect Makefile source. Modified dialect Mksrc files -- e.g., linux and sun -- accordingly. Added support for BSD/OS 3.0 with help from Jim Reid . Terry Kennedy kindly provided a test system. During the port corrected a bug that prevented proper handling of revoked files. 4.03 April 7, 1997 At the suggestion of Dan Mercer , made HP-UX building of lsof aware of differences between the HP-UX bundled and unbundled C compilers. Added the ability for the lsof builder to define the default warning message issuance state. By default the issuance of warning messages is disabled; defining WARNINGSTATE in machine.h disables it. The Customize script was updated to handle WARNINGSTATE. Dan Mercer suggested this. Eliminated compiler complaint about improperly cast get_Nl_value() argument in ncache_load() in lib/rnch.c. Corrected zeromem() argument error in SCO dproc.c. Sped up parent directory cache lookup slightly. Updated for PTX 4.4, including additional VxFS (EFS) file system support. 4.04 April 17, 1997 At the suggestion of Bela Lubkin changed device cache handling to be more tolerant of a device cache file whose [cm]times are older than the ones on /dev or /devices. The change required adding information to Solaris device cache file clone lines, so the first time lsof 4.04 is run under Solaris it will complain about a bad cached clone device in a previous device cache file, then regenerate it. Added boot file path detection for SCO OSR 5 and above, based on information supplied by Bela. Fixed two bugs in DEC OSF/1 lsof -- an error in reporting locks and a missing continue statement in readdev() after a failure to open a directory. Jan Ole Suhr reported the second bug and supplied a fix. Fixed XFS problems with IRIX 6.2 by abandoning the idea that SGI will distribute XFS header files and defining an lsof-private xfs_inode structure. John Paul Morrison helped develop and test the 5.3 definition. John R. Vanderpool helped develop and test the 6.2 definition. Remove obsolete comments about common/*.frag files. Updated Linux lsof for Linux version 2.1.35. 4.04 April 18, 1997 Supplement Regenerated the 4.04 distribution to correct a non- device-cache #define misplacement in the Solaris and SunOS dlsof.h. Alexandre Oliva reported the problem. 4.05 April 24, 1997 Corrected an error in 00DCACHE. Made sure SCO /etc/ps/booted.systems is closed. Based on an observation by Bela Lubkin that the lsof child had needless file descriptors open, closed all but the open pipes between the lsof parent and child. Decommissioned CDC EP/IX support; I no longer have a test system. Based on a suggestion from Patrick Connor , added -xansi to CFLAGS for IRIX 5.3 and 6.[234]. Also at Patrick's suggestion changed Configure to propagate exact SunOS 4.1.x version to the main and library Makefiles. This allowed the sunos413 and sunos413cc Configure abbreviations to be shortened to sunos and sunoscc. Updated obsolete argument uses (-H changed to -n) in count_pf.perl* and watch_a_file.perl scripts. Adjusted Solaris 2.6 lsof for Beta_Update with tips from Casper Dik . Fixed a Solaris 2.4 TCP address reporting bug. 4.06 April 30, 1997 Added a step to the Makefile clean rules that does a make clean in the lib subdirectory; suggested by Casper Dik . (Configure's -clean argument already did this.) Fixed an incorrect awk argument in the sunos*) Configure stanza, reported by Alexandre Oliva . Added CD9660 (aka ISO) file system support to FreeBSD, NetBSD, and OpenBSD with mods and help from Kenneth Stailey . (BSDI already had CD9660 support.) While at it, added file descriptor system support to BSDI and FreeBSD. Added /kern file system support to OpenBSD. The support wasn't extended to BSDI, FreeBSD, or NetBSD, because it requires Kenneth Stailey's changes to /sys/miscfs/kernfs/kernfs.h. Updated IRIX 6.3 support after getting access to a test system, provided by John Paul Morrison . Improved the handling of IRIX 5.1 and greater FIFOs. 4.07 May 12, 1997 Based on AIX problem reports from David Capshaw , changed the aix* Configure script stanza to avoid -bnolibpath for gcc (which the GNU loader doesn't grok) and AIX below 4.1.4 (where -bnolibpath hasn't been tested or is known to be unimplemented), and to refuse to use gcc for compiling lsof in AIX versions below 4.1 (because of possible structure alignment problems). Updated 00FAQ appropriately. Added OpenBSD support for EXT2FS. This support has yet to be tested. Tested lsof under OpenBSD 2.1. Activated /kern file system support for NetBSD when Configure senses that /sys/miscfs/kernfs/kernfs.h defines the kern_target structure. This support has not been tested under NetBSD, although it has been tested under OpenBSD. Made some simple changes to the BSDI machine.h, suggested by Jeffrey C. Honig . Improved handling of alternate dialect Configure abbreviations -- aix and aixgcc, hpux and hpuxgcc, solaris and solariscc, and sunos and sunoscc. 4.08 May 23, 1997 Cleaned up dialect Makefile's, staring with a suggestion from Christopher Schanzle . Improved Configure's -clean processing. Corrected bugs in Solaris lock reporting. Changed NetBSD Configure stanza to put -I/usr/include before -I/sys. 4.09 June 1, 1997 Adjusted for latest FreeBSD 3.0 release. This required adding a new kernel name cache module for reading BSD-form hashed kernel name cache entries, rnmh.c, to the lsof library, and adding a #define to each machine.h to select it. Activated rnmh.c for BSDI 2.1, BSDI 3.0, NetBSD 1.2, and OpenBSD 2.1. 4.10 June 8, 1997 Adjusted for Linux 2.1.x (x > 35) kernels with hashed task structure pointers. Marty Leisner and Jonathan Sergent tested the adjustment. Replaced readdev() stat() calls with lstat() to reduce device table and cache entries with the same device number and inode values. Added code to remove all remaining duplicates. This fixes a Linux problem reported by Jonathan Sergent and makes device node name output predictable. Corrected a bug in UnixWare stream file handling that prevented searching for the stream file by its associated character device name. Added Pyramid code to determine Reliant UNIX clone major device number differently from that of DC/OSx. 4.11 June 12, 1997 Changed Configure to sense that the PTX inp_[fl]addr members of the inpcb structure of have a struct type and set HASINADDRSTR for use in PTX dnode.c and dsock.c tests. Changed PTX version 4.1.4 tests to use 4.1.3 instead. Carson Wilson reported the need to do this and tested the change. Fixed a block device table indexing bug in lib/rdev.c, reported by Carson Wilson. The same bug was squashed in pyramid/ddev.c. Added code to the Pyramid Reliant UNIX kread() function to compensate for an address boundary error in the kernel's /dev/kmem driver. Verified that lsof compiles and works under AIX 4.2.1. Added an AIX test for the presence of NFS header files, defined HAS_NFS and adjusted AIX dialect sources accordingly. Based on a suggestion from Gaylord Holder , added DEC OSF/1 code to auto-detect the booted file, whence kernel symbol addresses are obtained. 4.12 June 24, 1997 Corrected a device number sign extension problem in the reading and writing of device cache file. The problem was reported by Bela Lubkin and he suggested a fix. Fixed an SCO stream device lookup problem. The report and solution came from Bela Lubkin Enhanced the Configure script to enable cross- configuration of lsof, based on suggestions from Marty Leisner . A new documentation file, 00XCONFIG, describes the process. Made Pyramid OBJFS support conditional on the presence of supporting header files. Corrected the Pyramid MkKernOpts script so it generates the necessary -D's for the Nile/Jolt architecture. Richard Coley helped. Added another IRIX xfs_inode variant for 6.2, 32 bits, no XFS rollup patch. Tested under UnixWare 2.1.2. 4.13 July 9, 1997 Taught Pyramid lsof to grok ttyfs vnodes with help from Richard Coley . Fixed some minor bugs in Pyramid FIFO reporting. Eliminated use of the Pyramid UCB compatibility library at Richard's suggestion. Eliminated reporting of "strange" inode numbers for SCO OSR 3.2v5.0.x HPPS files with help from Bela Lubkin Modified port to service name lookup to use a small number of getservbyport() calls before reading the entire map with getservent(). Changed port reporting to represent a zero as `*' to be consistent with other prt number reporting tools like netstat. Casper Dik suggested these changes -- the getserv*() one to improve performance for large NIS service name maps. Changed all readdev() functions to make the absence of block devices a warning instead of a fatal error after Brian Redman reported his IRIX 6.4 system had no block devices. (It really did have block devices, but readdev()'s lstat() use caused it to miss them in a directory symbolically linked from /dev/dsk->/hw/disk.) Fixed Brian's real problem by changing the IRIX readdev() to use stat() on /dev nodes if a Configure test shows /hw is readable. Extended the potential to do the same to all readdev() functions. For consistency and convenience changed some Configure abbreviations and dialect subdirectory names: "decosf" abbreviation and "osf" dialect subdirectory name to "du"; "netbsd" dialect subdirectory name to "n+obsd"; "next3" abbreviation and "next" dialect subdirectory name to "ns"; "sco" abbreviation and dialect subdirectory name to "osr"; "sgi" dialect subdirectory name to "irix"; and "unixware" abbreviation and dialect subdirectory name to "uw". Added #if/#endif clauses to the AIX rmdupdev() function to avoid clone processing for AIX versions less than 4.1.4. The problem was reported by Toralf Foerster , who supplied corrective code. Added support for new style NetBSD inode with i_ffs and i_e2fs union members. Improved Configure and 00FAQ information on Digital UNIX configuration subdirectory with suggestions from Brad Krebs . 4.14 July 22, 1997 Reorganized the Solaris handling of the inode structure header file, ufs_inode.h, to eliminate VxFS structure definition conflicts for Solaris 2.4, based on information from Greg Earle . Cleaned up some typos and confusion in Configure's help output, based on comments from Bela Lubkin Added a 00DIALECTS file, containing UNIX dialect version numbers, that can be used by Configure and the man page. 4.15 August 15, 1997 Aligned `Configure -help` output better. Removed Configure's 2.6 Beta test adjustments. Added improved Solaris VxFS configuration and handling, based on information from Greg Earle . Added socket state -- TCO or TPI -- for socket files at the suggestion of Ian Fitchet . 4.16 September 25, 1997 Added reporting of TCP/TPI queue lengths and window sizes ala netstat to NAME column. Added -T option to select or de-select TCP/TPI info reporting. (Window sizes are only reported for Solaris.) Fixed anomalies along the way in SIZE/OFF processing for some dialects. Fixed service name argument processor to allow minus signs as part of the name. Consequently this disallows names with embedded minus signs from being specified as the start of a range. Added 00FAQ entries explaining why lsof won't find a file being edited with vi, why window sizes aren't reported for all dialects, and what the "no more information" message means. Forced Pyramid CC to be /usr/ccs/bin/cc to avoid accidental use of the BSD variant in /usr/ucb/cc. Added support for Linux glibc2, including a Configure test; cross-Configure support (00XCONFIG); and much unfortunate and risky sleight-of-hand in lsof Linux dialect header and source files, forced upon lsof by incompatibilities between Linux kernel and glibc2 header files. Included in scripts/identd.perl5 a Perl 5 implementation of an identd server, using lsof, provided by Kapil Chowksey . Updated IRIX 6.4 xfs_inode guess. 4.17 October 14, 1997 Added -V option for verbose search result reporting. Verbose reports are prepared for failure to locate file names, command names, Internet addresses or files, login names, NFS files, PIDs, PGIDs, and UIDs. Augmented Linux NFS file test to cope with kernels whose NFS code is in a loadable module. Need for the test was pointed out by Jonathan Sergent . The change required that Linux have private dmnt.c source, Completed a Linux 2.1.57 port on a system provided by Jonathan Sergent. 4.18 October 25, 1997 Eliminated memory leaks in alloc_lfile(), lkup_port(), and NEXTSTEP's process_text() function. Added recognition of OpenBSD 2.2 in Configure, supplied by Kenneth Stailey . Consolidated print_file() functions to use the one in lib/prtf.c. Made it configurable and changed it to size print columns dynamically. !!! WARNING !!! WITH DYNAMICALLY SIZED PRINT COLUMNS LSOF 4.18 PRODUCES OUTPUT SIGNIFICANTLY DIFFERENT FROM THAT OF PREVIOUS REVISIONS. LINES ARE GENERALLY SHORTER AND THERE IS GENERALLY LESS BLANK SPACE BETWEEN COLUMNS AND THE ITEMS IN THEM. THERE ARE NO LONGER ANY SPACES BETWEEN DEVICE NUMBER ELEMENTS, ONLY COMMAS. !!! WARNING !!! Added special types and print specification modifiers for file size and offset to handle UNIX dialects with 64 bit sizes and offsets. Paul Eggert reported the need for this addition. With Paul Eggert's help picked lint from the lsof library, the main level lsof sources, and the Sun dialect sources. Added documentation, including the file 00LSOF-L, about the lsof-l LISTSERV. Added support for Reliant UNIX on the RM600. Bob Passarella supplied the changes. Kevin Smith helped arrange test systems. While incorporating Bob's changes, modified lib/rnch.c to handle kernel ncache structs whose name is accessed via a char *, rather than in a char array. Changed #include order of for Solaris 2.x. W. Richard Stevens pointed out the need to do this. 4.19 October 30, 1997 Changed Pyramid Reliant RM600 proc scan to skip SSYS (p_flag) processes, since they don't seem to have a readable u_cdir vnode. Enabled Pyramid Reliant UNIX kread() work-around for DC/OSx, too, since its read(/dev/kmem) kernel driver seems to share the page boundary bug this work-around circumvents. Changed SzOffFtm_d and SzOffFtm_dv (new formats at 4.18 to print size and offset) from signed to unsigned. Setting them signed at 4.18 was an oversight. Plugged a memory leak that caused the loss of 130 bytes per repeat-mode pass. Fixed it with a simple work-around in main(). Lionel Cons reported the leak. 4.20 November 11, 1997 Tested under BSDI 3.1. Added support for Reliant UNIX Mesh IPC files with help from Billy Ho . Added support to Digital UNIX lsof that uses the libmsfs tag_to_path() function (when it exists) to look up AdvFS path names. The idea and sample code came from Dean Brock . Converted Dean's code into more general purpose support for private name cache lookups via the HASPRIVNMCACHE #define in the dialect machine.h file and code conditional on it in the printname() function. Taught Digital UNIX lsof to recognize NFS3 file systems. Corrected Digital UNIX lsof DEVICE column alignment. 4.21 December 1, 1997 Squashed bug, introduced at revision 4.18, that resulted in double reporting of each selected PID when terse mode (-t) was specified. Corrected minor bug, also introduced at 4.18, that might cause an extra print_proc() pass when one PID has been specified. Added -R to lsof options in scripts/idrlogin.perl*. The option should have been there -- it was supposed to be mandatory for PGID reporting -- but a bug, corrected in revision 4.18, previously made -R unnecessary. Enabled configuring for BSDI BSD/OS 4.0 per a suggestion from Jeff Honig . Enabled replacement of scoff_t with off64_t (scoff_t is used to type r_size and r_localsize in the rnode struct) for IRIX 5.3 systems that have the NFS kernel rollup patch (1477). This compensates for SGI's failure to distribute an updated with their patch. Validated under Linux 2.0.3[12], Linux 2.1.64, and NetBSD 1.3. Added FreeBSD root directory reporting, courtesy of Dan Nelson . 4.22 December 15, 1997 Made adjustments for Linux 2.1.7[02]. Improved NAME information for Linux UNIX domain sockets. Added option +|-M to control the reporting of portmapper registration information in square brackets after the TCP or UDP port or service name. Kenneth Stailey suggested the feature and provided sample code from OpenBSD. Reporting is disabled by default in the distribution and may be enabled with +M; if lsof is compiled with HASPMAPENABLED (e.g., from machine.h), reporting will be enabled by default and can be disabled with -M. Changed the -w option to +|-w to match the syntax of the +|-M option and to eliminate any options that flip meaning when a symbol is defined at compile time. For both +|-M and +|-w, specifying `-' when the default state is disabled or specifying `+' when the default state is enabled causes no problems. !!!WARNING The -w option has changed in lsof 4.22. WARNING!!! Made the +|- prefix legal for most options, but didn't document it in the man page or help panel. Most options that disable something -- e.g., -b, -C, -n, -P -- now disable when the prefix is `-' and enable when it is `+'. Since the states these options disable are enabled by default, I chose to avoid documentation complexity and confusion by not mentioning that they can be used with the `+' prefix. Condensed the help panel. Made sure Digital UNIX Configure stanza puts normal include path (e.g., /usr/include) before system include paths. Added IPX socket information reporting to Linux with help from Jonathan Sergent . 4.23 January 16, 1998 Fixed conflict arising from the quondam replacement of the Sun Solaris with a BIND/BSD version. With help from Jonathan Sergent developed a /proc file system based Linux lsof. It needs some Linux 2.1.x release to work -- I'm not sure which, but I tested under 2.1.72, 2.1.76, and 2.1.79. The Configure script selects special sources for this lsof, so the full lsof distribution now contains both /dev/kmem and /proc based sources for Linux lsof. An optional kernel mod, written by Jonathan, enhances the /proc-based lsof ability to recognize IPX socket files. Reorganized and augmented the Linux sections in 00FAQ to explain the two types of Linux lsof. Defined DOSTAT_FUNCTION for dostat() in misc.c to select the function, stat() or lstat(), it will use. DOSTAT_FUNCTION is normally undefined, defaults to lstat(), and is only defined for the /proc-based Linux lsof in its dlsof.h. Made conditional on the presence of IRIX 6.4 XFS rollup patch #6 an XFS node change introduced in revision 4.16. Identified the patch with help from John R. Vanderpool . Added NFS node compensation for NetBSD 1.3. The code and suggestion for it was supplied by Jean-Luc Richier . Added diagnostic messages to the /dev/kmem-based Linux Mksrc script to report errors during the construction of the kernel name cache header file, kncache.h. Added 00FAQ information on kncache.h. Added a new Linux test host, running 2.0.33 and GlibC, provided by Steve Logue . Ported to PTX 4.1.3 and 4.4.2. Adjusted lib/rnch.c for 4.4.2 to allow customization f additional ncache struct element names. 4.24 January 28, 1998 Changed /proc-based Linux lsof offset test to use "/" instead of "/etc/passwd". To assist Jim Mintha with the packaging of lsof for Debian Linux, added a DEBIAN_LINUX_LSOF #define to trigger the activation of special system map file location code in the /dev/kmem-based dproc.c. Applied modification to dialects/bsdi/dlsof.h from Ingimar Robertson , enabling lsof to compile for BSDI BSD/OS 2.0. Corrected a documentation error in 00DCACHE, pointed out by Thomas Anders . The error was created when the -V option was added at lsof 4.17. Made IRIX 5.3 through 6.3 lsof aware of IRIX SCSI tape devices (e.g., /dev/tape). Dave Olson of SGI and Randolph J. Herber of FNAL provided valuable advice, and Igor Schein helped test. Added a machine.h symbol (NEVER_HASDCACHE) that prevents Customize from offering to change HASDCACHE. The symbol may appear anywhere in machine.h -- e.g., in a comment. Included the symbol in a comment of the HASDCACHE section of the /proc-based Linux lsof machine.h, and accompanied it with warnings against #define'ing HASDCACHE. Did the same thing for WARNDEVACCESS (NEVER_WARNDEVACCESS is the suppressant.) 4.25 February 7, 1998 Corrected an IRIX mis-cast of file offset (position). Igor Schein reported the problem. This was offered as a patch to 4.24. Picked some lint Igor pointed out. At Igor's suggestion added an optional decimal digit size argument to the -o option. This argument specifies how many file offset decimal digits can follow "0t" before lsof switches to a "0x..." form. The argument size specification doesn't count the two characters of the "0t". A size of 0 means unlimited. The default is OFFDECDIG (8), preserving compatibility with existing lsof output; it can be changed by the lsof builder. When size is specified with -o it does not force offset display; -o without a size still must be used to do that. Added an IRIX 6.2, 32 bit system, XFS node patch, courtesy of Ulrich Bernhard . For my own convenience enabled Configure to use /usr/local/bin/gcc for NEXTSTEP. This allows circumvention of a gcc 2.8.0 ranlib problem on my test 3.1 `040 cube. Added flags recommended by the RISC/os and Ultrix compilers for the updated (and longer) main.c. Updated FreeBSD cd9660_node.h Configure test. 4.26 February 17, 1998 Added shared process group processing for IRIX 5.3, and IRIX 6.1 and above, based on investigation of a bug report from Igor Schein . Igor helped test this addition. Improved handling of file system name arguments. It's now done in a manner similar to fuser. The -f argument forces path names to be considered as simple files, rather than as file system names. The +f flag forces them to be considered as file system names. Normally path arguments are considered file system names when they match a mounted-on directory in the system's mount table, or when they match a mounted file system's block device. Igor Schein helped test this change. Igor also suggests that the proper compilation of the IRIX 6.4 proc structure after patch 2536 has been installed may need -DPIOMEMOPS. So lsof's MkKernOpts script was updated to propagate that option from CCOPTS in /var/sysgen/system/irix.sm, even though patch 2536 doesn't add -DPIOMEMOPS to it. Added a 00FAQ item on this patch. Added a fatal warning message about names forced to be file system names (with +f) that have no match in the mount table. Improved the -V message for files and file systems for which no open files were found. Added reporting of /proc file and file system search failures. Did some code reorganization to combine the multiple ck_file_arg() functions into one. Moved the new function from the library to the top level and put it in arg.c; moved the usage function from arg.c to a new top-level source file, usage.c, to balance top-level source file size. The new usage.c depends on version.h; arg.c no longer does. Added flag recommended by the DU compiler for the updated (and longer) main.c. 4.27 March 6, 1998 At the request of Igor Schein added a conditional repeat mode option, using the `+' prefix to the `r' option. +r operates as does -r with the exception that it exits the first time no open files have been listed during a cycle. The exit code will be zero when any open files have been listed; one, if none were ever listed. Ported lsof to HP-UX 11.0 with the help of Richard Allen. This port hasn't been tested on a 64 bit kernel; I'm sure it won't work there without more mods. It may not work on PA 2 architectures; I've only tested it under PA 1 and a separate, busy tester reported PA 2 problems that I've been unable to investigate. In anticipation of getting access to a 64 bit HP-UX kernel and the pending start of the Solaris 2.7 Beta test (It will have 64 bit kernel addressing.), started adding support for 64 bit kernel pointers. This includes: ubiquitous use of the KA_T cast for kernel pointers; a format to print them, KA_T_FMT_X; a function to print them, print_kptr(); and modifications to most kernel-related functions -- e.g., process_file(), process_node(), process_socket(), readvfs() -- to process kernel addresses as KA_T types. Fixed minor bug in handling path name arguments that end with a `/'. Removed support for RISC/os; its test system is no longer available. Made modifications to insure that lsof output doesn't contain non-printable characters. All such characters are now printed in the printf form "\x%02x". Several new common functions were installed in misc.c to support "safe" printing. This second major modification in 4.27 to common and dialect code could have introduced bugs not yet detected. 4.28 March 10, 1998 Refined unprintable format to use \b, \f, \r, \n, \t, and ^* (for CTRL) forms. Corrected omission of safestrprt() use for field output command name. These changes were offered as patches to 4.27. Made space an unprintable character (\x20) in the COMMAND column; printable elsewhere, including the NAME column, field output, and error messages. Made sure FD column is parseable as a single entity -- i.e., has no embedded space. Thus, if the access mode is unknown but there is a known lock mode, (a very rare case) the access mode will be printed as `-'. Picked lint with gcc 2.8.0 under Solaris 2.6. With the help of Dave Olson of SGI identified a proc struct element that should have been added to by IRIX 6.4 patch 2536. Added a work-around for it to the lsof Configure script. Igor Schein identified that the patch caused a proc structure length complaint from lsof. Removed an obsolete 00FAQ item on the patch, installed at lsof 4.26, explaining that no solution was yet available. Added a 00FAQ item on how BIND installs its own header files, including , which may cause the rpcent struct definition to vanish. Solaris has an automatic lsof work-around, but that hasn't been (and probably can't be) propagated to all dialects supported by lsof. The 00FAQ item recommends re-installation of the vendor header files that BIND has replaced. (Others include , , and .) Made AIX AFS fixes. 4.29 March 26, 1998 Corrected bug in Internet address matching. The matching formerly stopped if the foreign address matched, thus failing to check the local address for a match. That led to a possible false "Internet address not located" warning (i.e., in response to -V) about the local address, when both foreign and local addresses were specified with -i. This correction was offered as a patch to 4.28. Changed readmnt() usage in an attempt to defer mount readlink() and stat() delays until they are necessary. Corrected two bugs in the Digital UNIX readdev() function. Made the correction available as a patch to 4.28 and regenerated the 4.28 DU binaries. Added a missing argument to a print-kptr() call in the HP-UX dsock.c. The missing argument causes a fatal gcc error. The problem was reported by Eyal Shaynis . The fix was offered as a 4.28 patch. Adjusted for Digital UNIX 4.0D; the spec_node structure is now defined in . Kris Chandrasekhar identified the need for the adjustment. Incorporated a bug fix from Brian McAllister to the DU readmnt() function. This fix was offered as a patch to 4.28. Added "safe" printing to a SunOS clone device error message. Corrected bug in tabling of Linux /proc-based lock info. Corrected bug in handling of SunOS TLI streams. Dan Farmer reported the problem. Added a Solaris 2.6 work-around to keep the BIND from colliding with the Solaris . Strengthened the Configure test for /proc-based Linux lsof, based on a report from Marty Leisner . Tested on OpenBSD 2.3. Made AIX changes that allow use with 3.2.5. The changes were suggested and tested by Brett Hogden . Added Solaris 2.6 AFS support. Disabled reporting of some node numbers for Solaris 2.5 and above open AFS files. The node number computation algorithms used for SunOS 4.1.x and Solaris less than 2.5 no longer always work under Solaris 2.5 and above. 4.30 April 9, 1998 Corrected a pid structure member naming error for UnixWare < 2.1.2. The problem was reported by Richard van Meurs . He supplied the correction. This was offered as a patch to 4.29. Had a report from Igor Schein that IRIX 6.4 patch 2839 is another SGI kernel patch, along with 2536, that changes the size of the proc structure in the kernel without changing the proc structure in . Upon further investigation found that the effect of these patches on the proc structure is not consistent. Therefore, dropped the Configure patch test for IRIX 6.4 and made the code in irix/dproc.c slightly more tolerant of proc structure size differences for IRIX 6.4. Igor help test the change. Corrected Solaris >= 2.5 AFS inode number generation. Craig Everhart helped find the cause of the problem. This was offered as a patch to 4.29. Refined the Linux /dev/kmem-based glibc evasion for the timeval structure to make it work with glibc version 2.0.7. This required defining a new global symbol, TIMEVAL_LSOF, default timeval, that the /dev/kmem-based Linux lsof can set to its private glibc timeval name, distinct from the kernel timeval name. Added support for Alpha to the /dev/kmem-based Linux lsof. Alexandre Oliva provided a test system. Added an item to 00FAQ about lsof, the Alpha processor, and Linux. Added a 00FAQ item about lsof year 2000 compliance. Basically it says lsof is probably compliant, because its only date or time computations are done with time_t values, but I haven't done any specific Y2K validation. I don't have plans to do any. Added support for UnixWare 7. Chris Daniels provided a test system and Don Draper provided technical information. Added BFS and SFS file system support to lsof for UW 2.1.[12] and 7. Updated Solaris VxFS support for VxFS 3.2.1. Greg Earle reported the need for the update. Greg and Roger Klorese provided technical information. Scott McClung tested. Changed IRIX XFS patch detection in anticipation of learning there are multiple XFS patches for IRIX 6.4 that require different versions of the lsof-invented xfs_inode structure. 4.31 April 21, 1998 Added a VxFS #if/#endif wrap to a section of the HP-UX dnode.c that wasn't properly protected. The problem was reported by Peter Klosky . This was offered as a patch to 4.30. Added support for Solaris 2.7 (first Beta release). Mike Sullivan provided technical advice and helped test. Charles Stephens also helped test. Fixed bug in /proc-based Linux that caused it to access /proc/mounts excessively. Marty Leisner provided a syscall trace that identified the bug. The fix was offered as a patch to 4.30. Adjusted the IRIX 6.4 private structure definition for the XFS node to accommodate patch 2970. Igor Schein identified the patch and the required adjustment. 4.32 May 11, 1998 Corrected Solaris 2.7 code for reporting PCFS (floppy disk) node numbers. Casper Dik supplied the fix. The fix was offered as a patch to 4.31. Corrected a bug in conditional repeat mode handling pointed out by Igor Schein . This was offered as a patch to 4.31. Improved reporting of AIX open(/dev/memory device) errors. Corrected a Solaris < 2.5 KA_T declaration error, pointed out by Robert Kiessling . Changed KA_T from a #define to a typedef for all dialects to prevent future problems of this kind. Changed the sample Perl 5 script big_brother.perl5 to report a four digit year from localtime(). Added support for AIX 4.3[.1]. Bill Pemberton provided a test system. Andrew Kephart and Tom Weaver provided technical assistance. Niklas Edmundsson did 4.3.1 testing. Added -qmaxmem option to CFLAGs for an AIX compilation with an xlc version 4.x compiler. Adjusted Linux socket handling for changes in the AX25 members of the sock struct. Richard Green pointed out the problem. Tested /dev/kmem-based lsof under Linux 2.0.34. 4.33 May 22, 1998 Added generic IPv6 support to common lsof sources and specific IPv6 support to AIX sources. Andrew Kephart supplied the additions and helped with testing. Bill Pemberton provided a test system. The modification affected sources for every dialect, whether it supports IPv6 or not, by changing the interfaces to the common Internet address function ent_inaddr(). Added support for the NetBSD UVM virtual memory system. Paul Kranenburg supplied technical details. Bracketed HP-UX 11 use of with #if/#endif _KERNEL. Corrected printing of PCB address in DEVICE column for IRIX. 4.34 June 26, 1998 Updated 00FAQ to discuss TCP and UDP ports private to the AIX kernel and 00README to describe how ACLs can be used to give lsof permission to read the kernel memory devices. Add information to 00FAQ and 00README about other OpenBSD architectures where lsof is reported to compile and run. Added section to 00FAQ discussing how an incorrect loader path environment variable value can prevent lsof from loading correctly. Improved Solaris namefs and doorfs support so that it is now possible to search for an open VDOOR file by the path name of its fattached file system object. Igor Schein requested the ability to do such a search. Even with the change, lsof can't always identify path names for open VDOOR files. Also at Igor's request, improved reporting of information on open Solaris VCHR files that share a common vnode, and Solaris UNIX domain socket files. Corrected print_kptr() argument error in PTX dnode.c, reported by Mark Price . Compensated for ncache element naming differences, introduced at PTX 4.4.2; Kurtis D. Rader reported the problem. Changed output column title from INODE to NODE to better reflect the column's contents of node IDs for more than just inodes. Improved Configuration and processing for Solaris AFS. Corrected AIX AFS 3.4 afs_rwlock_t simulation. Corrected a cast problem with two AIX knlist() calls, thus quieting an AIX 4.2.1 compiler argument type warning. Jon Champlin reported the problem. Added support to most dialect versions (exception: /proc-based Linux) to warn when the identity of the kernel where lsof was compiled doesn't match the running identity. The warning can be suppressed with -w. Note: determining AIX state requires calling oslevel, a potentially slow operation. Jon Champlin suggested this addition. !!!! WARNING !!!! !!!! WARNING !!!! !!!! WARNING !!!! Those using the lsof cross-configuration capability (see 00XCONFIG), should be aware that the kernel identity test feature introduces two new basic cross configuration environment variables, LSOF_ARCH and LSOF_VSTR. !!!! WARNING !!!! !!!! WARNING !!!! !!!! WARNING !!!! Identified a situation where a Solaris UNIX domain socket name is known and can be searched for by name; added the necessary code. 4.35 July 17, 1998 Made the kernel identity check an option with the HASKERNIDCK #define in machine.h. Enabled altering of HASKERNIDCK with the Customize script. Added a clause to the help output that indicates the build-time HASKERNIDCK status. Added more information to the NAME column for Solaris UNIX domain sockets. Made them searchable by their clone device path name. Igor Schein requested this. Completed the HP-UX 11 port with support for its optional 64 bit kernel. Rich Rauenzahn provided a test system. Corrected errors with HP-UX 11 lock reporting and private kernel structure and type definitions. Added support for HP-UX NFS3 files. Limited mount table warnings -- e.g., when -b is used -- to one set per mount point. Fixed some mount table scanning and usage bugs, including one in Solaris, reported by Kjetil Torgrim Homme . 4.36 August 4, 1998 Made corrections and additions to IPv6 support and to AF_ROUTE socket handling, supplied by Jean-Luc Richier . Jean-Luc's additions provide IPv6 support for the Inria IPv6 implementations on FreeBSD and NetBSD. Fixed two Solaris 2.5, 2.5.1, 2.6 and 2.7 TCP and UDP host name or IP address reporting bugs, reported by James Mathiesen . This fix was offered as a patch to 4.35. Updated the Customize script to cause ENTER to use all defaults. Amir J. Katz suggested this and helped test the changes. Updated Solaris ICMP and IP stream handling, based on a report from Igor Schein . Fixed a bug in the Digital UNIX mount table handling, reported by Bob Ward . While working on the bug, found and updated some obsolete AdvFS code. This fix was offered as a patch to 4.35. 4.37 September 15, 1998 Deactivated SGI IRIX support and archived revision 4.36 sources and binaries in pub/tools/unix/lsof/OLD. Improved performance of FD searching. This was offered as a patch to 4.36. Amir J. Katz pointed out that ranlib isn't needed for AIX or Solaris. Made appropriate Configure script changes. Fixed a file offset reporting bug for HP-UX VCHR and VBLK device nodes located on a VxFS root. Doug Siebert reported the bug. The fix was offered as a patch to 4.36. Resolved an HP-UX root device name reporting bug, partly caused by an out-dated local copy of the mount structure, by generating a local header file with the structure that can be compiled without needing _KERNEL defined. Doug Siebert also reported this bug. Changed some dialect source code -- Digital UNIX, Solaris, SunOS, and UnixWare -- to make more consistent with ps the user ID lsof reports in the USER column. Added a 00FAQ entry about it. Igor Schein reported the Solaris and SunOS lsof inconsistencies with what ps(1) reports. Ported lsof to Pyramid ReliantUNIX 5.44. Added brackets as comments to case, do, done, else, endif, esac, if, and while statements in Configure to assist in navigating its clauses. Added more Linux 2.0.x glibc work-arounds. Added support for UnixWare 7.0.1. Ralph Forsythe provided a new FreeBSD test system. 4.38 November 25, 1998 Added support for recent FreeBSD 3.0 distributions. A 3.0 test system was provided by David O'Brien . This was offered as a patch to 4.37. Updated the scripts/idrlogin.perl* files to look for sshd processes in addition to rlogind and telnetd ones. Added support for DU 5.0 Beta. Berkley Shands provided a test system. Added support for OpenBSD 2.4 with changes supplied by Kenneth Stailey . Changed the Solaris 2.7 tests and documentation to Solaris 7. Made some changes to the header files for NEXTSTEP 3.3 and added support for OPENSTEP 4.x with help from Michael A. Hovan III and Carl Lindberg . The combined dialect subdirectory is named n+os. One of Carl's changes propagates RC_CFLAGS to the library Makefile. Timothy J. Luoma helped test under NEXTSTEP 3.3 and OPENSTEP 4.2. Made UW 7.x version sensitive to the presence of ptf7038. Added peer PCB address to Unix domain socket Name column, even when a path name has been located. Information for these changes was supplied by Francis Le Bourse . Lee Penn provided a test system. Tested lsof under OSR 5.0.5 on a test system also provided by Lee Penn. Made path name argument processing more tolerant of errors per a suggestion from Julian Gordon . Acquired a new UnixWare 2.x test system, generously provided by Computer Classroom, Inc. -- Matthew Thurmaier , Ken Laing , and Andrew Merril . Updated Configure to accept a UnixWare version of 2.1.3. Updated kmem-based lsof for Linux 2.0.36. Updated NetBSD sources for a change in a UVM virtual mapping header file. Corrected a cache allocation bug in Sun format kernel name cache handling. The bug only shows up when the kernel name cache is inaccessible. 4.39 December 29, 1998 Corrected problems with large device number handling for 64 bit Solaris 7. The problems were reported by Steve Bellenot . Steve helped test the fixes. The fixes were offered as two patches to lsof 4.38. Improved FreeBSD Configure operations for header files that must be obtained from the kernel source tree, based on a suggestion from David O'Brien . For Bela Lubkin made optional with +f[cfn] the display of file structure address, shared use count, and node structure address. /proc-based Linux doesn't implement this feature, because it doesn't read kernel structures from kernel memory. Modified the PTX -X option to take advantage of the new file structure display option. Added shared.perl5 to the scripts/ subdirectory to provide an example of how +f[fn] might be used to track shared file descriptors and files. Added more /dev/kmem-based Linux glibc evasions, provided by Jeff Johnson and Maciej Lesniewski . Jeff helped test them on various Linux architectures. Tested on AIX 4.3.2; no changes were required. Doug Crabill provided a test system. Fixed -c option to detect missing command name when following option begins with `+'. 4.40 January 25, 1999 Added support for using the CDS compiler for Reliant Unix 5.44 and above. Made Reliant Unix MIPC support optional, dependent on the presence of . Based on a report from Michael Schmitz that /dev/kmem-based lsof misbehaves on a Linux 2.0.x m68k kernel without module support, made the absence of query_module() or get_kernel_syms() Linux kernel support a fatal error. Updated relevant sections of 00FAQ to reflect the change. Added the ability to force the Linux Configure stanza to use the /proc or /dev/kmem source base via a LINUX_BASE environment variable specification. This is a cross-configuration assist. Added "+D " and "+d " options for directory searching. +D searches the entire tree, starting at , including , its contents, and its subdirectory branches; +d searches only and its contents, but not its subdirectory branches. Improved lsof's searching of the specified name list to compensate for anticipated long lists from +d and +D. Made an egrep in the Solaris Configure stanza usable by the standard and XPG4 egrep's. Kenneth Stailey pointed out the improvement. Fixed bugs in /dev/kmem-based Linux and UnixWare Unix domain socket name searching. Changed a Linux Alpha #include to be conditional on the presence of its named header file, so that lsof will compile on Red Hat 5.1 and 5.2 (Linux kernel 2.0.35) where the header file is absent. The problem was reported by Alexandre Oliva . Fixed an AIX 4.3+ bug in procinfo struct space allocation, reported by Jeff Stewart . This was offered as a patch to 4.39. Added an lstatsafely() function to offer the same isolation for lstat() calls that statsafely() offers for stat() calls. This made DOSTAT_FUNCTION no longer necessary, so deleted it. With help from Laurent P. Montaron ported lsof to PTX 4.4.4. Laurent did a monumental job of identifying TCP/IP changes by their TCP version, rather than by their PTX (With mix 'n match PTX and TCP/IP versions, the PTX version often has no bearing on the TCP/IP version.), and changed the Configure script and pre-processor #if/#else/#endif blocks to match. He also updated Unix domain socket handling for PTX TCP/IP versions 4.5 and above. Updated CLIENT handle acquisition of fill_portmap() in print.c to use the more modern RPC function clnt_create() in place of clnttcp_create() where possible. PTX 4.4.4 requires clnt_create(). 4.41 February 27, 1999 Added FreeBSD 3.1 and 4.0 support with help from Sheldon Hearn , David O'Brien , and John Polstra . Corrected bungled AIX 4.3+ patch that went into lsof 4.40. Reorganized the Configure script to improve Makefile construction. A specific impetus for this was to allow FreeBSD system-wide make flags to be propagated to the lsof Makefiles, but other goals were to make sure that the DEBUG= make entry can over-ride standard CFLAGS values, and to better manage the identification of compilers and their versions. Two compiler-related values may now be supplied in environment variables: 1) the compiler path in LSOF_CC; and 2) the compiler version in LSOF_CCV. 00XCONFIG documents them. Added support for Pyramid Reliant Unix bsdsfs, msockfs, and sockfs file systems. Added an optional LSOF_CINFO string to Configure, producing a CINFO string in selected Makefiles, producing a #define LSOF_CINFO in selected version.h header files. The purpose of this is to allow Configure the option to propagate information to the lsof -v output. It is now used for Linux to identify the code base, and for HP-UX 10.30 and 11.0 and Solaris 7 to identify the kernel bit size. Added system information to NEXTSTEP and OPENSTEP -v output, from the second line of hostinfo's output. Fixed a login name buffer overflow problem in the processing of -u option values. This was offered as a patch to 4.40. !!!THIS IS A SERIOUS STACK OVERFLOW BUG; A LINUX EXPLOIT EXISTS FOR IT THAT OPENS A BASH SHELL WITH LSOF'S AUTHORITY -- E.G, SETGID(KMEM) POWER!!! Improved the Solaris mount table filter so the volume manager's fake mount point, "/vol", is ignored and doesn't supplant "/" in NAME column path assemblies. Igor Schein reported this bug and provided important help in finding it. This was offered as a patch to 4.40. Changed the Linux /dev/kmem-based lock ownership test to answer a problem reported by Tom Christiansen . This was offered as a patch to 4.40. Installed an HP-UX 11 patch, suggested by Kevin Vajk , that adjusts a private lsof kernel header file, derived via Q4, to correspond to an HP-UX patch bundle. Made NetBSD 1.3I sockproto structure adjustment. 4.42 March 30, 1999 Fixed a typo in the HP-UX dfile.c that caused +fF and +fN output controls to swap effect. Enabled for OpenBSD 2.5 per notice from Kenneth Stailey Made more VM accommodations for FreeBSD 4.0. Improved file system search reporting to include path name components when they're available, instead of mindlessly reporting the file system name in the NAME column. Guy Dallaire brought the need for this change to my attention. Updated Solaris 2.6 VxFS for Veritas Oracle Database Edition 2.0, VxFS version 3.3, and VxVm version 2.5.4, based on a report from Chris Kordish . Chris kindly provided a test system. Improved HP-UX ipc_s patch detection in Configure, response in .../dialects/hpux/hpux11/ipc_s.h, and documentation in 00FAQ, Kevin Vajk helped test. Added to Customize the option to suppress HASKERNIDCK selection for specified dialects. Suppressed it for /proc-based Linux lsof, and removed its test and code from there. Tin Le alerted me to the need for this update. Ported to official Digital UNIX 5.0 release. Changed DU lsof to use the knlist(3) function when no kernel file has been specified with -k. This change was suggested by Erich Wimmer . Updated Configure for latest NetBSD (1.3I?) with UVM support the default. 4.43 May 11, 1999 Corrected a typo in the Solaris gcc discussion in 00FAQ. Made changes to the Solaris 2.5[.1] private tcp_s structure. Both changes were done in response to reports from Igor Schein , who tested the Solaris 2.5 change. Made more IPv6 adjustments to lsof for Tru64 UNIX (Digital UNIX) 5.0, based on information obtained from Compaq by Berkley Shands . Corrected HP-UX error message about HP-UX 11 q4 usage. Amir Katz reported the correction. Fixed a GlibC 2.1 conflict in /proc-based Linux lsof. Fixed a man page typo reported by Vlad Harchev . Changed some Solaris 2.7 references to Solaris 7 in Configure and 00XPORTING. Added a Solaris example to the echo statements that are the install rule in the SunOS/Solaris Makefile. Added a field to the file structure output -- FILE-FLAG (file structure open flags, f_flag[s], and process file flags, typically u_pofile)) -- enabled with +f[gG]. Its field output character is 'G'. Figured out another piece of the HP-UX 11 patched ipc_s structure puzzle with the help of Keith Kalet . Fixed a PTX real vnode to real inode interpretation bug. Added link count to lsof output. Eric Dumazet requested and helped test it. The new +L option enables and filters it. Its field output character is `k'. Updated Configure script to recognize NetBSD 1.4. Updated AFSConfig to handle default answers to questions. Incorporated patch from Jonathan Sergent that enables /proc-based Linux lsof to run on both 32 and 64 bit kernels. Updated Configure script with a patch from David O'Brien that recognizes FreeBSD 3.2. 4.44 June 24, 1999 Corrected use of nlink member of hsnode for SunOS 4.1.x High Sierra File System files. John Dzubera reported the problem and helped test the fix. Also fixed a SunOS segmentation fault bug. These fixes were offered as a patch to 4.43. Improved handling of /proc-based Linux UNIX PCB address. Fixed a NEXTSTEP and OPENSTEP bug that made repeat option (-r) processing malfunction. This fix was offered as a patch to 4.43. Fixed Configure so it doesn't use -O in the Cflags for the bundled HP-UX C compiler. Jim Ankenbrandt reported the problem. Corrected output ordering of parent PID and process group ID when both -R and -g are specified. Enhanced the pdev.c and pdvn.c library modules for wider use. These dialect versions use the new library modules: DEC OSF/1, Digital UNIX, and Tru64 UNIX; Pyramid DC/OSx and Reliant UNIX; SCO OSR and UnixWare; and Sequent PTX. Added basic clone device support to /dev/kmem-based HP-UX lsof for HP-UX 10.30 and higher. Added raw socket support to /proc-based Linux lsof. Changed NODE-ADDR column title to NODE-ID in anticipation of using more general identification information in the column. Ported to UnixWare 7.1, using a test system kindly provided by Matt Thurmaier and Don Draper . Updated for NetBSD 1.4C VM changes, and a new current and root working directory structure. Made minor adjustment for latest Tru64 UNIX 5.0 Beta release. 4.45 July 30, 1999 Fixed quoting problem in DEC OSF/1, Digital Unix, and Tru64 UNIX Makefile's install rule. The problem was reported by Berkley Shands . Fixed bug in Tru64 UNIX 4 lsof that caused FDs to be skipped. These fixes were offered in a patch to 4.44. Fixed a repeat-mode /proc-based Linux lsof bug, reported by Sami Farin . This was offered as a patch to 4.44. Picked lint, some reported by Sami Farin. Corrected a 00DCACHE documentation error in a sample shell script. The problem was reported by Chad R. Larson . Changed commented-out entries in machine.h files so they require more thought and work when the comments are removed, based on a remark by Chad. Compensated for the practice of Solaris 7 and above to record the dev= value in /etc/mnttab in 32 bit mode, even on 64 bit systems. This was offered as a patch to 4.44. Added a C library test for /proc-based Linux lsof, so that the #include files can be adjusted for a non-GlibC environment. The need for this was reported by Andrew Hill . This was offered as a patch to 4.44. Added support for Auspex LFS 1.8.1 and 1.9.2 to SunOS 4.1.4 lsof. The support was requested by Quentin Fennessy , who provided information and did testing. Enabled IPv6 support code for NetBSD and OpenBSD, conditional on Configure script tests. Wolfgang Rupprecht supplied the NetBSD code and tested it. The OpenBSD code I constructed has been compiled but not tested. Updated the identd Perl 5 script, based on a report from Wendy Lin that the space in its response line in front of the user name violates RFC 1413. Added IPv6 support to /proc-based Linux lsof. Jonathan Sergent and Andrew Thomas Sydelko kindly provided a test system. Updated man page description of AIX multiplexed files to indicate that they might be /dev/ptc or /dev/pts, depending on the AIX version. The correction was suggested by Onno van der Linden . Sylvain Robitaille reports lsof passes his Y2K tests. 4.46 October 23, 1999 Corrected /proc-based Linux lsof to detect that an IPv6 address is a mapped IPv4 address. The problem was reported and analyzed by Arkadiusz Miskiewicz , who also tested the fix. Added a libc5 library /dev/kmem-based Linux lsof circumvention, supplied by Jason Lingohr . Corrected a bug in -t (terse) AIX output, reported by Wendy Lin . I introduced the bug at revision 4.43 when adding FILE_FLAG reporting. This was offered as a patch to 4.45. Added a work-around for a problem in the OpenBSD 2.3 header file. Volker Borchert provided and tested it. Improved description of cross-building lsof for a 64 bit Solaris 7 system on a 32 bit system with suggestions from Phillip Edwards . Fixed a gawk POSIX-mode pattern error in the Linux /dev/kmem-based Mksrc script, based on a tip from Ambrose C. Li . Fixed a bug in the Tru64 UNIX IPv6 handling, courtesy of a report from Casper Dik . Enabled support for OpenBSD 2.6. Enabled support for BSDI BSD/OS 4.1, based on a report from Jeffrey C Honig that only a Configure script change is necessary. Enabled Configure script to use gcc for building lsof for a 64 bit Solaris 7 and 8 kernels, if the gcc version is 2.95 or above. Improved -i option handling for systems with IPv6 support so that it will search for a host name in both IPv4 and IPv6 families, when that is possible. As a companion modification, changed -V processing to report a single error when a multiple host name match is requested. Casper Dik helped test. Fixed a DEC OSF/1, Digital UNIX, Tru64 UNIX repeat mode bug, reported by Mayer Ilovitz . Mayer helped test the fix. The fix was offered as a patch to 4.45. Changed Solaris socket file recognition scheme, so it is (nearly) the same through Solaris 8, where the previous clone device scheme no longer works. With significant assistance from Casper Dik, added support for Solaris 8 Beta and Beta refresh. The IPv6 support in Solaris 8 is still in some flux, so there are temporary compensations for the differences between Beta IPv6 support and Beta refresh IPv6 support. Casper and I hope those differences disappear by FCS. Improved the delivery of information on Solaris 2.5.1, 2.6, 7, and 8 door files. Fixed a repeat mode bug that surfaces when /etc/passwd changes between cycles. The bug report and diagnostic help were supplied by Igor Schein . The fix was offered as a patch to 4.45. Added support for INRIA IPv6 to NetBSD. Jean-Luc Richier provided patches and a test system on which to verify them. Added support for AIX 4.3.3. Jeff W. Stewart provided a test system. Made adjustments for FreeBSD 4.0-current. Improved reporting of information for AIX sockets that lack protocol control blocks. 4.47 November 29, 1999 Based on a query from Jean-Pierre Radley , changed the lsof top-level Makefile to propagate CFGF to the library Makefile. (DEBUG was already being propagated.) Added osrgcc and scogcc Configure abbreviations (to use gcc) for Jean-Pierre. In response to a query from Igor Schein , improved the Configure script test for Solaris 7 and 8 that decides if the compiler can produce 64 bit executables. Made an ugly hack, based on making a private rnode structure definition from q4 output, to compensate for HP-UX 10.20 and lower recent NFS3 patches. HP didn't supply an updated with the patches. The problem was reported by Will Partain . Elias Halldor Agustsson helped identify the patches as PHNE_18173, PHNE_19426, PHNE_19937, and PHNE_20091, and provided a test system. Switched BSDI test system from 2.1 and 3.1 to 4.0.1, courtesy of Terry Kennedy . Added some more dev_t hacks for Alpha FreeBSD 4.0. Added support for IPv6 on BSD 4.x. The support hasn't yet been tested, just compiled. Added support for the mnt file system (mntfs or /etc/mnttab) on Solaris 8. Tested on Solaris 8 BETA-Refresh. Made selection of optional fields (e.g., PPID with -FR) in a field output specification select the optional field, too, so that the option selector for the field (e.g., -R) isn't also required. This change was made in response to an inquiry from John DuBois . This may require some revision to scripts that parse all field output; two scripts in the lsof distribution's scripts/ subdirectory had to be updated. Corrected handling of Linux IPv4 addresses mapped in IPv6 addresses. Tested under OpenBSD 2.6. 4.48 January 14, 2000 Modified -i argument processing of colon-separated IPv6 addresses to recognize an IPv4 address mapped in an IPv6 address and handle it as an IPv4 address. This was offered as a patch to 4.47. Added a defined symbol (NOWARNBLKDEV) to control (inhibit) the issuance of a warning when no block devices are found. This was done anticipating its need in FreeBSD 4.x, but that dialect version no longer has any block devices, so HASBLKDEV was disabled for it instead. NOWARNBLKDEV was left in place for possible use in the future. Enabled KAME IPv6 Configure support for FreeBSD when is found. Disabled use of gcc to compile lsof for 64 bit HP-UX 11. Updated Configure to recognized FreeBSD 3.4. Based on suggestions from Bernt Christandl improved AFS configuration for AIX and Solaris, and updated AIX AFS 3.5 support. Johannes Tax , Hung T. Pham , and Curt Freeland provided test systems. Updated lsof's private rnode definition for AIX 4.3.3, since IBM still doesn't ship the header file and the rnode structure definition in doesn't match what the kernel uses. This was offered as a patch to 4.47. Weakened the test in the Linux /proc-based lsof of the field count of data lines in /proc/net/{tcp,udp}. It appears that recent 2.3.x Linux kernels have added untitled fields to these files. The bug report came from Gabor Liptak . Adjusted for a FreeBSD 4.0 change in the definition of [_]KERNEL. David O'Brien reported the problem and provided a test system. Removed the HASPPID bracket from Fppid (the -R option state variable) so that the field select table will compile even when HASPPID is not defined. This problem was introduced at revision 4.47 with code that causes some field output characters to set option states. The problem was reported by David Bacon . 4.49 April 3, 2000 Made clearer in man page that "Lxx" FDs are AIX loader table references. Also updated the 00FAQ discussion of the Stale Segment ID bug to include AIX 4.3.x. Modified support for NetBSD 1.4Q to include the header file to cope with an MFS change. Added support for OpenBSD UVM virtual memory. Added support for AIX systems with > 2GB of memory. Chris Sylvain reported the problem and provided the solution. Chris also supplied some minor code cleanup. This was offered as a patch to 4.48. Based on new information from Igor Schein made additional compensation in Configure script for 64 bit Solaris 7 and 8 gcc. Added some 00FAQ info on the effect ordering of the +fg and -FG options has on output format. Improved NetBSD IPv6 configuration, based on a suggestion from Thomas Klausner . Added code to convert IPv4-mapped-in-IPv6 addresses to IPv4 addresses. Updated the information in 00FAQ and the HP-UX 11 binary directory README files on the HP-UX 11 ipis_s patch with new information supplied by Eric McWhorter . Added documentation on changes to HASFSTYPE and HASNCACHE, and the new HASPRIVPRIPP. Adjusted Configure for FreeBSD 5.0. Made additional, necessary changes to Configure and the BSDI sources to eliminate load errors. Added KAME IPv6 support to FreeBSD at the request of Ollivier Robert , who provided a test system. Corrected the script that generates the CHECKSUMS files for binaries to correctly name the detached PGP certificate. The documentation bug was reported by Michael Hennecke . 4.50 June 29, 2000 Added a NetBSD alpha test host, courtesy of Ray Phillips . An lsof 4.49 binary, built on Ray's 1.4.1 system was made available prior to the 3.50 release. Upgraded the system map file tests in /dev/kmem-based Linux lsof, making the use of DEBIAN_LINUX_LSOF unnecessary. Tested the changes on a system made available by Vincent Kujala and Jim Mintha . Forced AIX to use the large-file-enabled versions of lstat (lstat64) and stat (stat64) if contains stat64. This should allow lsof to stat() AIX files > 2GB even when the builder has not defined the "large file enabled programming environment." Configure tests and puts -DHASSTAT64 in the Makefile's CFLAGS to make this happen. Fernando A.B. Whitaker reported the problem. This was offered as a patch to 4.48. Enabled Configure script to handle OpenBSD 2.7. Angelos D. Keromytis reported the availability of OpenBSD 2.7 and supplied the Configure script patch. Improved handling of DOOR and fattach()'d files in Solaris. Changed message about missing kernel symbol file from "not yet determined" to "none found". Updated FreeBSD, NetBSD, NEXTSTEP, OpenBSD, and OPENSTEP support to report "no PCB" and the values of the SO_CANTSENDMORE and SO_CANTRCVMORE state flags when a socket structure has no inpcb pointer. This modification was made to AIX lsof at revision 4.46. Added an entry to 00FAQ about sockets that have no inpcb pointer. Upgraded support for FreeBSD 5.0-CURRENT. Ben Smithurst supplied patches and did testing. David O'Brien supplied a test system. The update included dropping the Fctty part of file descriptor file system support, conditional on a Configure script test. I propagated those changes to BSDI, NetBSD, and OpenBSD in anticipation of their having the modification in the future. David also arranged with Michael Haro for a FreeBSD 3.4 test system. In response to an lsof 3.72 bug report from Jim Mewes , added more kernel address filtering to the lsof function, kread(), that reads Solaris kernel data. In response to a report from Marc Duponcheel , added tests to the /proc-based Linux lsof to ignore file systems of types "autofs" and "pipfs". Based on a report and information supplied by Casper Dik , updated the ncache_load() function in lib/rnch.c with new code that deals with a post Solaris 8 change in kernel name cache (DNLC) handling. Casper tested the update, which should be invisible to Solaris versions without the new DNLC code. Added support for Solaris VxFS QIO files, based on a report from Kieran Broadfoot . Kieran help test the support. Added support for PTX 4.4.6 and 4.5[.1] with help from the usual cast of good people at Sequent. Added support for 64 bit file sizes and offsets on BSDI, FreeBSD, NetBSD, and OpenBSD, based on a report from Dan Nelson . Dan supplied a patch and did FreeBSD testing. Added Configure script recognition of NetBSD 1.5, based on a report from Andrew Brown . Thomas Klausner updated the NetBSD port package to use a pre-release of this addition. At the last minute saw a notice via deja.com's UseNet search service that FreeBSD 3.5 had been released and lsof didn't grok it. Added recognition of 3.5 to lsof's Configure script, but didn't have the opportunity to test lsof on 3.5. 4.51 August 21, 2000 Added Configure script support for the upcoming Solaris 9 release based on suggestions from Casper Dik . Changed sample Perl scripts to assume that /usr/local/bin/perl is Perl 5 and Perl 4 may be found in /usr/local/bin/perl4. Updated Configure to recognize FreeBSD 4.1 and made a FreeBSD pre-release distribution available. Bela Lubkin tested lsof on the upcoming SCO OSR 5.0.6 release and reports that lsof appears to work properly. Updated the AIX compiler test in Configure to recognize its version 5. Updated AIX 4.3.3 support with automatic recognition of the proper rnode structure, based on machine bit width. Also added code to detect when processing the -X option that lsof has been compiled with the "other" AIX 4.3.3 user structure and to apply compensations. When a compensation method works, it's applied during subsequent -X processing; when none works, further -X processing is disabled. Added Tru64 UNIX 5.1 support. Updated Tru64 UNIX library text file support to recognize new kernel support for AdvFS library files. Berkley Shands and Klaus Saggerer USG [saggerer@zk3.dec.com> helped put me in contact with Chang Song , the developer of 5.1's new kernel name cache and he helped me develop new code in lsof to access it. Corrected reporting of PTX fattach()'d address. Changed Configure and dlsof.h for NetBSD and OpenBSD to use /usr/include/uvm header files when available. Andrew Brown , Thomas Klausner , and Wolfgang Rupprecht pointed out the need to do this for NetBSD. Andrew provided access to a NetBSD 1.5 system for verifying the changes. Installed snprintf() support, including a private version in the lsof library for those UNIX dialects without the function. Changed all sources to use it instead of sprintf() and strcpy(). Fixed a memory leak in the readvfs() functions of BSDI, DEC/OSF1, Digital UNIX, FreeBSD, NetBSD, OpenBSD, and Tru64 UNIX. Tested on Linux 2.4. Modified the Pyramid MkKernOpts script to compensate for `uname -s` configuration alternatives. Robert Dahlem supplied the modification. Obtained access to an FCS Solaris 8 64 bit system and built lsof on it, using Sun Workshop C 5.0 and gcc 2.96 20000814 (experimental). Both compilers produce a working lsof. 4.52 November 8, 2000 Completed work on an HP-UX 11.11 port that uses a pstat(2) interface provided by HP. To distinguish it from its predecessors for HP-UX, this lsof version is called PSTAT-based and the predecessor versions are now called /dev/kmem-based. I am indebted to the far-sightedness and support of these good people at HP for making PSTAT-based lsof possible: Carl Davidson, Louis Huemiller, Rich Rauenzahn, and Sailu Yallapragada. The PSTAT-based sources are in lsof_4.52/dialects/hpux/pstat, the /dev/kmem-based ones in lsof_4.52/dialects/hpux/kmem. Ported to IBM Monterey for Merced|Itanium, aka AIX 5L. It configures via the Configure script's "aix" abbreviation and has been tested on AIX 5L Beta 3. Jay Beck, Steve Dibbell, Loc Le, Nasser Momtaheni, and Malcom Zung of IBM provided generous support. Since AIX 5L is still in Beta testing, this port can't be considered complete. Added Configure support for OpenBSD 2.8. David Mazieres provided a test system. Based on a report from Marc Christensen added sockfs to the mount scan exemption list for /proc-based Linux lsof. Added large file, CDFS, and DOSFS for UnixWare 7.x. Added UnixWare device memory mapping support. All UnixWare changes were supplied by Eric Dumazet Eric also supplied some miscellaneous bug fixes. Deferred name cache loading until printname() needs to use the name cache. Terminated Pyramid, SunOS 4.1.x, and Ultrix support, because test systems are no longer available. Final Pyramid and Ultrix source code distributions for lsof revision 4.51 may be found on lsof.itap.purdue.edu in pub/tools/unix/lsof/OLD/src. The no longer supported SunOS 4.1.x source code is still distributed with the Solaris source code. Added code to set Solaris node address to real vnode address, when applicable. John Speno provided information that enabled me to update the Tru64 AdvFS (MSFS) node definition for AdvFS version 5. Added Tru64 5.x CFS support with help from Kris Chandrasekhar , Diane Lebel , and John Speno. The support only provides information about cached file attributes. Installed a Configure patch for HP-UX 11 supplied by Kenneth Stailey that adds another command to q4 input. Tested on FreeBSD 4.2. Will Day and Frank Winkler graciously supplied Solaris 8 binaries. Added Solaris 9 text file support, supplied by Casper Dik . 4.53 December 6, 2000 Added the AIX 5L j2_lock.h to the distribution with a Configure script step to use it when it's missing from /usr/include/j2. Removed SunOS 4.1.x support. Removed Linux 2.0.x /dev/kmem support. Fixed VBLK and VCHR special device file reporting to handle /dev information more accurately. Added a Apple Darwin / Mac OS X 1.2 port, provided by Allan Nathanson . Allan also arranged for a test system so I can maintain this port. An additional test system was provided by Dale Talcott. Dropped claims of support for all UnixWare versions except 7.1.0, since that is the only version on which I can test lsof. Even though lsof 4.53 is deprecated for UnixWare 2.1.3, installed a patch for it with testing done by A. Channing Clark . Dropped claims of support for all SCO OpenServer versions except 5.0.5, since that is the only version on which I can test lsof. 4.54 January 19, 2001 Added compensation for a change that made the FreeBSD mount structure invisible. I can only test back to 3.2 and the compensation works there, so it's been #ifdef'd for 3.2 and above. David O'Brien provided the necessary clue. Based on a report from Valdis Kletnieks , changed all IPv6 support to report a TYPE of IPv6 for sockets with IPv4 addresses mapped in IPv6 addresses. The previous lsof behavior was to report their TYPE as IPv4. Restored the Linux GlibC test to Configure, removed at revision 4.53, based on a report from John Dzubera , that RedHat Linux 6.0 still needs the test. Made setting of link count for Solaris more selective. Limited Readlink() recursion to MAXSYMLINKS. The bug was reported by Jan Dvorak . Dropped the *claim* that lsof runs on Solaris 2.5.1. It may well do so, but I no longer have access to a test system. Fixed an #endif comment typo, reported by Igor Schein. Fixed a typo in a cast for a Tru64 UNIX 5.1 function and updated Configure for Tru64 UNIX 5.0 and 5.1 with information from Jesse Perry . Corrected non-fatal typos in the AdvFS support in dnode.c for Tru64 UNIX. Added msdos file system support for NetBSD and OpenBSD. Andrew Brown requested and helped test it. 4.55 February 15, 2001 Based on a report from Bernd Eckenfels added support in lsof for files in /proc//maps that have been deleted. Changed PGRP output title to PGID, conforming to the most common current abbreviation for Process Group ID (PGID). While some systems continue to use *pgrp for internal kernel variable names, most systems that support the display of PGID via ps(1) now title it PGID. The lsof -g and -Fg options operations are unchanged in function; only titles and descriptions have changed. Also changed internal variable names from *PGRP and *pgrp to *PGID and *pgid where possible. Dropped the *claim* that lsof runs on HP-UX 9.x. It may well do so, but I no longer have access to a test system. In response to a suggestion from Jeff Howie added support for command name selection by regular expression. A new form of the -c option value is use to identify and specify a regular expression. Restore the *claim* that lsof works on UnixWare 7.0, since I re-acquired a test system. 4.56 May 3, 2001 Corrected some problems Amir Katz found with Insure++, one in lib/dvch.c, the rest in Solaris sources. Amir's report also helped me find an error in an snpf() call that caused (the unsupported) Solaris 2.5.1 lsof to crash. Wally Winzer, Jr. helped test. Added support for UnixWare 7.1.1 and above in-kernel UNIX sockets. John Hughes kindly provided code and access to a test system. John also provided a test system and advice for adding UnixWare 7.1.1 NonStop Cluster and CFS support. More help with that effort came from Kurt Gollhardt (SCO), Barbara Howe (SCO), Bela Lubkin (SCO), and Dewan Rashid . Archived a set of compilation hints (patches) from Bill Melvin that make it possible to compile the old, unsupported lsof 3.08 sources on UnixWare 1.x without NFS or CDFS support. Installed support supplied by Allan Nathanson for the Darwin "Gold Master" release, Mac OS X 10.0 (aka Darwin 1.3 in its public source version). Added Allan's CVS repository suggestions to the script that gets additional header files from an open source repository. Tested an HP-UX 11.11 kernel patch from Sailu Yallapragada that enables reporting of TCP/IP information for telnetd processes that use the telnet multiplexor. I don't yet know the kernel patch ID. Made the Solaris inclusion of conditional on the Solaris version. (It's apparently not needed at 2.6 and above.) Bill Watson brought this to my attention. Added alternate Linux 2.4.x lock extent test, supplied by Jim Mintha . Rearranged the lines and pre-processor tests in regex.h, lib/regex.c, and lib/snpf.c so that unifdef can be used to eliminate copyright and GPL statements when the files aren't being used for a particular dialect. (USE_LIB_* definitions in a dialect's machine.h header file determine if one or more of those three files are to be used.) Added preliminary support for Solaris 8 with VxFS 3.4. This support will be refined as I get information from Veritas about how they will distribute the kernel header files lsof needs. Those header files were omitted from the standard VxFS 3.4 distribution. Technical assistance and testing were provided by Calle Dybedahl , Gary Millen , Rainer Orth , Peter C. Vernam , and Donna Yobs Tested on FreeBSD 4.3-STABLE. Dropped the *claim* that lsof works on UNIX dialects where I no longer have test systems: BSDI 2.1, 3.[01] and 4.0; DEC OSF/1, Digital UNIX and True 64 UNIX 2.0 and 3.2; FreeBSD 2.1.[67], 2.2[.x], 3.[012345] and 4.[01]; HP-UX 10.20; NetBSD 1.[234]; SCO OpenServer 5.0.5; and SCO UnixWare 7.0 Tested on Solaris 9 BETA, s81_36. 4.57 July 19, 2001 Help (-h) and version (-v) output now have URLs for the newly created and timeliest lsof FAQ (00FAQ in the lsof distribution) at: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ and the man page for the current lsof distribution at: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man Based on a report from Steve Laubscher , modified dlsof.h for PTX 4.6[.1] to avoid a temporary dnlc_t definition needed at PTX 4.5.1. Corrected test for old Linux kernels in Configure. Henri Karrenbeld brought the error to my attention. Limited Linux claims to 2.1.72 and above in the documentation. Improved HP-UX 11 Configure stanza and stream socket handling. Constructed a work-around for the HP-UX 11 optional OnlineJFS package. The work-around sadly requires lsof to have a private version of the vx_inode structure, since the OnlineJFS package doesn't update . Troyan Krastev brought the bug to my attention and Michael Bracewell provided a test system where I developed the work-around. Added locale support to lsof's isprint() test, based on a suggestion from Dan Mercer . Lsof will use setlocale(), when that function and its supporting header file are available. Added OpenBSD 2.9 support. Based on a report from Aaron Rhodes and with testing help from Aaron, made the lsof 4.56 revision compile and work on OpenBSD 2.6. While that OpenBSD version is no longer supported, Aaron's report exposed a Configure script bug affecting OpenBSD versions lsof does support. Updated for FreeBSD 5.0-CURRENT. Szilveszter Adam help test. The lsof FreeBSD ports packager, David O'Brien , assisted. Tested on AIX 5.1. Loc Le and Nasser Momtaheni of IBM provided test systems. 4.58 September 13, 2001 Added options to safestrprt() and safestrprtn() to surround the string with '"' and to suppress the printing of an ending '\n'. Use of these functions in device cache file error message reporting answers a suggestion for better error reporting from John Jackson . Fixed a Solaris 2.6 and above problem related to searching for "large" (O_LARGEFILE) files by name; lsof was using the wrong version of [l]stat(2). The bug was reported by Daniel Trinkle . Added AIX 4.1.4 and above XTI socket support. Added OSR Xenix Shared Data and Semaphore file type support with modifications supplied by Bela Lubkin. Updated OPENSTEP support with modifications from Carl E. Lindberg . The changes enable the correct reporting of executable and library open files ("txt" type). Limited claims of OpenServer support to the versions where I currently test, 5.0.4 and 5.0.6. (Lsof probably works on 5.0.5.) Enabled processing of -C option for PSTAT-based HP-UX lsof. Enabled and tested on FreeBSD 4.4. Corrected a file system test example in 00QUICKSTART, based on a report from Jun Biao WANG . Made available for re-distribution a user-contributed port of lsof 4.51 to Reliant UNIX 5.45. Thomas Mauterer contributed the port. 4.59 October 20, 2001 With the closing of the Sequent Synergy Links Lab by IBM, terminated lsof support for PTX. The last tested PTX lsof revision, 4.58, is available on lsof.itap.purdue.edu in .../lsof/OLD/src. Adjusted for FreeBSD 5.0-CURRENT NFS header file changes, based on a report from Jos Backus . Corrected a bug in the way Linux lsof identifies the owner of a process. Lionel Cons reported the problem and tested the fix. Added code to avoid stat(2) calls on regular Linux files whenever possible. Lionel reported the need to do this (AFS files) and tested the new code. Added new output field for raw device number in hex. The field is identified with 'r'. This field is NOT selected when -F or -F0 is specified so that its appearance won't disturb existing scripts that process field output. Added support for OpenUNIX 8. A test system was provided by Larry Rosenman . Matthew Thurmaier and many people from Caldera provided technical assistance. Added an additional UVM test to the NetBSD Configure stanza. Andrew Brown supplied the test; it recognizes NetBSD 1.5Y UVM changes to the vnode structure recently committed by Chuck Silvers. Applied Configure and get-xnu-headers.sh script changes suppled by Allan Nathanson for Darwin 1.4. Added for Bela Lubkin OSR-specific environment variables to supply values to the Configure script. The variables are described in 00XCONFIG. Added an IP version selector to the -i option parameters. 4.60 November 9, 2001 Added special handling to and corrected bugs in the matching of IPv4 in IPv6 addresses to -i6:<...> selectors. Made 00FAQ corrections and updates, based on discussions with Igor Schein . Modified Configure script to detect a 64 bit capable gcc compiler and permit it to be used to build 64 bit (PA-RISC 2) lsof for HP-UX 11.00. Tested with HP's gcc package, which Rich Rauenzahn of HP kindly installed on a test system at HP. Stefan Marquardt helped test. Made lsof's method of killing its child process more robust, based on a suggestion from Bela Lubkin . Modified all dialect Makefile segments to accept select -v #define's from the environment -- a builder's comment, host, logname, system information and user name. This was done for Bela Lubkin, so he can "tune" the -v output when he packages lsof in the upcoming Caldera OSR 5.0.7 release. Changed Perl scripts in scripts/ to put the lsof path consistently in $LSOF. Also added a fix from Bela Lubkin to scripts/big_brother.perl5 that allows it to tolerate SCO OSR "ago" clauses in open UDP file information. Strengthened emphasis in scripts/00README that the scripts are examples that shouldn't be expected to run on all UNIX dialects without modification. At Bela Lubkin's suggestion changed the device cache file format examples in 00DCACHE and 00FAQ to avoid "%U%". That's an SCCS escape sequence. Added support for OpenBSD 3.0. Added +DAportable to CFLAGS for 32 bit HP-UX 11. Amir Katz suggested the addition. 4.61 January 22, 2002 Updated field output example Perl scripts in the scripts/ subdirectory to discover the lsof path, starting at .. and proceeding through the PATH environment variable's directories. Added minor OSR Configure script fixes, provided by Bela Lubkin . In response to a report from Joshua Wright modified NetBSD and OpenBSD Configure stanzas and sources so that lsof can be built when there is no system source tree (e.g., /usr/src/sys). In response to a report from Peter Valchev improved the UVM test in the OpenBSD Configure stanza. Updated Configure script to recognize FreeBSD 4.5. Updated for FreeBSD 5.0 procfs and pseudofs changes. Updated HP-UX stanza to see if the compiler named in the LSOF_CC environment variable is the bundled compiler. If it is, "-O" is omitted from the compiler flags. Updated Digital UNIX 4.x and Tru64 UNIX error message related to kernel name list failures. Added an FAQ section about how a kloadsrv daemon failure can cause knlist(3) to fail. The condition was reported by Douglas B. Jones Based on a report from Mark W. Eichin made Linux lsof capable of handling and reporting file sizes greater than 32 bits. Tested on Solaris 9 BETA-Refresh. Corrected a bug in the matching of IPv4 addresses, mapped in IPv6 addresses, to an IPv4 parameter to an -i option. Ported to 64 bit Power AIX 5.1 kernel with advice from David Clissold and Marc Stephenson , and on a test system provided by Loc Le . 4.62 March 7, 2002 Updated 00README to reflect the usefulness of gcc for building AIX lsof. Documented a report from Brian L. Gentry of success on AIX 4.3.3. I documented my success on 32 bit Power AIX 5.1 and my lack of success on ia64 AIX 5.1 and 64 bit Power AIX 5.1. Improved UnixWare >=7.1.1 reporting of UNIX socket NAME field information for NonStop Cluster systems with a patch provided by John Hughes . Offered John's improvement as a patch to lsof 4.61. Corrected bugs in handling of open files on block devices by OSR lsof. The bugs were reported by Bela Lubkin . Fixed bug in writing >32 bit device numbers for block devices to the device cache file. Added support for reporting block special nodes not in /dev (or /devices). That required "like device special" be changed to "like block special" and "like character special". (00FAQ was updated.) Based on a report from Peter Valchev improved the definition of the source for NetBSD and OpenBSD kernel symbols (the nlist() source file). NetBSD now defaults to getbootfile(3) if it is available, /netbsd otherwise. OpenBSD now defaults to /dev/ksyms if it is available, /bsd otherwise. Made possible compilation under BSD/OS (BSDI) 5.0 with changes to Configure, dialects/bsdi/dlsof, dialects/bsdi/dproc.c and lib/rnmh.c. The changes were suggested by Steven Hinkle . Note that these changes do not substantiate a claim that lsof works on BSDI 5.0, because I haven't tested it there. Updated OpenUNIX private , based on a report from Larry Rosenman that it had been updated by Caldera patch OU800PK3. Unfortunately the patch only corrects some of the problems with the header file, so it is still necessary to distribute a private patched version of it with the lsof sources. Applied a man page correction reported by Frederic Delanoy . Corrected cast bugs related to using the HP-UX bundled C compiler on HP-UX 11.11. 4.63 April 23, 2002 Added HPUX_BOOTFILE environment variable for use by the Configure script in determining HP-UX kernel configuration information -- e.g., the state of the ipis_s structure in the HP-UX 11 kernel. The change was suggested by Marc Bejarano . Marc also suggested some changes to the HP-UX section in 00FAQ that discusses Configure's use of q4 for HP-UX 11. Fixed a bug in the Solaris lsof file system matching code. It was not reporting that VCHR files in /devices were in / when /devices was in /, too. Corrected bugs in device number, file size, file offset, and raw device number field output generation. Added recognition of OpenBSD 3.1 to the Configure script with a suggestion from Peter Valchev . Note that this change does not constitute a claim that lsof works on OpenBSD 3.1, because I haven't tested it there. Built an automated test suite. (See 00TEST and the tests/ sub-directory of the lsof main directory). Bela Lubkin requested it. Dale Talcott, John Hughes, and Larry Rosenman helped me validate it on their systems. During the development of the test suite I discovered the following lsof bugs or missing features, and corrected or supplied them. * Corrected the reporting of locks for: o Digital UNIX 4.0d and Tru64 Unix 5.[01]; o HP-UX 10.30 and 11.00; o OpenUNIX 8; o UnixWare 7.1.1. * Enabled HP-UX 10.30 and 11.00 to report open NFS file link counts. * Corrected the reporting of UNIX domain socket names for Apple Darwin, FreeBSD 4.5 and above, NetBSD 1.4.1 and above, and for OpenBSD 3.0 and above. * Enabled HP-UX 11.11 to stat(2) large files. * Fixed handling of combination 32 and 64 bit device numbers in AIX 64 bit architectures. Updated the AIX 4.3.3 NFS rnode recognition code, first installed at revision 4.51. It looks like some IBM update has restored a single rnode structure independent of the machine bit width. Updated the NetBSD and OpenBSD sources so NetBSD can process DTYPE_PIPE files, as OpenBSD was already able to do. Updated Darwin get-xnu-headers.sh script to reflect information about a recent reorganization of the Darwin CVS hierarchy, supplied by Allan Nathanson . Added defense against the standard I/O descriptor attack. 4.64 June 26, 2002 Corrected some FreeBSD pre-processor directives. David O'Brien pointed them out. Updated lsof's main() function to: 1) close all open file descriptors above 2 before starting; and 2) to set a non-interfering umask. Moved GET_MAX_FD test from misc.c to proto.h, so that main() could use it. Added multiple-include protection to proto.h. Moved FAQ's test suite Q's & A's to a more appropriate section. Added a Q&A on HASSECURITY option and its affect on searching for open files. (That was already in the man page.) Updated hpux/kmem/dnode.c for HP-UX < 11 compilation with information from John Dzubera . While lsof doesn't support HP-UX < 11 any more, I try to avoid disabling it there when possible, and a locking fix for HP-UX >= 11 in lsof 4.63 inadvertently disabled compilation of lsof for HP-UX < 11. Fixed long-standing bug in HP-UX 10.20 lock reporting. Removed language from the test suite programs that requires an ANSI-C compiler. This allowed the test suite to be validated with cc and gcc on the un- supported HP-UX 10.20. At the suggestion of Manuel Bouyer switched NetBSD and OpenBSD lsof from using nlist() to using kvm_nlist(). Made the same change for BSDI, Darwin, and FreeBSD. Validated test suite on OPENSTEP 4.2. In response to a suggestion from Jeff Stoner enhanced support for the FD list of the -d option to allow it to be either an exclusion or inclusion list, using the '^' prefix to denote exclusions. Made adjustments for FreeBSD 4.6 and 5.0-CURRENT. Fixed a FreeBSD /etc/make.conf CFLAGS extraction bug, reported by Kris Kennaway , and new a bug in the fix, reported by Eric Cronin Added nullfs support for FreeBSD, NetBSD, and OpenBSD at the request of Andrew Brown . Modified all readmnt() functions to ignore mounted-on directory names that don't begin with '/'. Tested on NetBSD 1.6A and OpenBSD 3.1. Upgraded to Solaris 9 FCS with two changes to the BETA-Refresh support: 1) an adjustment to dnode.c for a change in the so_so (sonode) structure; and 2) addition of Solaris 9 FCS specific DNLC code. David Comay sent me the dnode.c change and Casper Dik helped with the new DNLC support code. Applied OpenUNIX changes that permit lsof to compile and run on the upcoming 8.0.1 release. The changes were supplied by Robert Lipe . Larry Rosenman provided a test system. Added Solaris fd file system support. 4.65 October 10, 2002 Adjusted for change in FreeBSD 5.0-CURRENT inode structure, reported by David O'Brien . Adjusted for changes in FreeBSD 5.0-CURRENT . One change was reported by Anders Nordby . Adjusted for FreeBSD 5.0-CURRENT on sparc64 architecture. Enhanced the error reporting of Solaris lsof when it detects a kvm_open() failure, and added a 00FAQ entry on the cause, based on a report from Peter J. Bertoncini . Enabled compiling of lsof for NetBSD 1.5 with the NULL file system, using a patch from Andrew Brown . Removed a hack in the LTbigf test program that was once needed when it was compiled on Solaris 9 BETA- Refresh with gcc. The hack isn't needed on Solaris 9 FCS. Janet Hempstead brought the need for this change to my attention. Applied a patch, supplied by Andrew Brown , that updates lsof for NetBSD version 1.6F. Corrected handling of the NetBSD nullfs. Updated to BSDI BSD/OS 4.3 on a test system kindly provided by Terry Kennedy . Updated to FreeBSD 4.7. Updated to Apple Darwin 1.5, 5.x and 6.x with patches supplied by Allan Nathanson . The patches include IPv6 support. Updated Configure to use the -bnolibpath loader option when building lsof on a PowerPC, running AIX 5 or greater. Valdis Kletnieks informed me this was needed. Lsof for AIX 5.x was initially developed on the IA64, where -bnolibpath can't be used and I didn't think to restore it to PowerPC loads when AIX 5.x became available for that architecture. Updated to UnixWare 7.1.3 on a test system provided by Larry Rosenman . Removed claims that lsof works on OpenUNIX 8.0.1, because UnixWare 7.1.3 is the release name of OpenUNIX 8.0.1. Based on a comment that his e-mail address was wrong in the lsof distribution from Kenneth Stailey , removed all e-mail addresses from lsof documentation files except this one, 00DIST. The addresses in 00DIST are used to send revision release notices to those who contributed to a revision, but the addresses in this file for previous revisions and in other documentation files sometimes grow stale and are never validated. 4.66 December 22, 2002 Acquired Solaris 7 and 8 test systems, courtesy of John Dzubera . Updated 00TEST and tests/TestDB accordingly. Clarified FreeBSD 5.0 architecture claims at the suggestion of David O'Brien . Also implemented David's suggestion to change Intel to x86. Installed changes to DNLC handling in OSR lsof in preparation for handling changes in the OSR 5.0.7 DNLC cache. Information about the changes and patches to handle them were supplied by Bela Lubkin . Upgraded True 64 UNIX support to the 5.1B release on a test system provided by Berkley Shands Had to used relaxed ANSI compilation because of an error in a system header file and other lsof source usages. Implemented the HASNOSOCKSECURITY compile-time option. When it and HASSECURITY are defined, lsof will be built to list only the user's open files, but will also list anyone else's open socket files, provided the "-i" option selects their listing. Updated the Customize script to ask about setting HASNOSOCKSECURITY. Left it undefined in all dialect machine.h header files. This change was requested by Kenneth Stailey for use with ntop. Added support for OpenBSD 3.2 and its kernel trace file. Improved lsof help (-h) and version (-v) information reporting. Fixed a FreeBSD 4.7 and above off-by-two UNIX domain socket path termination bug, reported by Ken Stailey 4.67 March 27, 2003 Began the transition of the lsof ftp server host name from vic.cc.purdue.edu to lsof.itap.purdue.edu. That reflects Purdue organizational changes. This first step makes the new name an alias to the old one. The old name, vic.cc.purdue.edu, will remain usable for an extended period. Corrected a revision number reference in section 17.17 of 00FAQ on the appearance of Solaris negative DNLC caching handing. Updated 00FAQ discussion of compilers for 64 bit Solaris. Validated test suite for 64 bit Solaris 8 and gcc. At the request of Alek O. Komarnitsky added the "+c " option to enable optional changing of the COMMAND column output maximum width from the default to . The default maximum width remains CMDL, as defined in lsof.h. Fixed three AIX kernel bit size detection bugs, one in the AIX Configure script stanza, the second and third in the AIX dproc.c get_kernel_access() function. The bugs were reported by Pierre-Yves Fontaniere , who tested the fixes. Added kernel event queue file support for FreeBSD, NetBSD and OpenBSD. Andrew Brown supplied the code. Updated to AIX 5.2 on a test system provided by Dale Talcott . Had to build work-arounds for two missing AIX 5.2 header files, and . Corrected an off-by-one UNIX socket addressing bug. Taught AIX lsof to handle both jfs and jfs2 files at the same time. Adjusted for an IBM mistake in the sizing of the fdsinfo structure in Toshiya Nakamura helped test, Updated to FreeBSD 4.8. Corrected another bug in FreeBSD UNIX domain socket name handling. Corrected gcc build problems on HP-UX 11i, reported by Yuliy Minchev . Updated BSDI BSD/OS support to 4.3.1. Augmented a lock ID test on NetBSD to check if the ID is an LWP pointer. 4.68 June 18, 2003 Enhanced Configure script's cleanup operations. Added support for OpenBSD 3.3, based on a report from Peter Valchev . Improved the description of the detached PGP signature certificate file in the main lsof README file, based on a suggestion from Diana Stockdale . Installed a work-around for FreeBSD 5.0-CURRENT on Alpha to avoid a compiler register use complaint. Corrected a 'c' option error message. Gnele reported the problem. Upgraded EXT2FS and UFS support for NetBSD and OpenBSD to handle new inode information, and the fast UFS1 and UFS2 file systems. With the help of Andrew Brown determined the NetBSD snapshot (1.6F) at which could be included under _KERNEL, thus eliminating the lsof netexport.h hack. The same change applies to OpenBSD versions 3.3 and above. Applied a patch from Armin Gruner that corrects the use of the HASPROCFS definition in the FreeBSD dialect sources. Corrected spelling errors in 00FAQ and in the generated 00.README.FIRST_ file of the distribution archive. John Jackson and Ray Phillips spotted and reported the errors. Corrected a spelling error in a comment and incorrect use of an alarm function in the LTsock test program. At the suggestion of Stuart Anderson added preliminary (and incomplete) SAM-FS file system support to Solaris lsof. Completion awaits availability of SAM-FS internals. Fixed a Solaris device name printing bug, reported by Ric Anderson , only visible when HASDCACHE is not defined. Ric helped test the fix. Fixed an AIX kernel bit size handling bug related to the NFS node (rnode) structure. Corrected a print_kptr() function call error in the AIX AFS code, reported by David Steiner . Upon further reflection and because I no longer have appropriate AIX AFS test systems, disabled AIX AFS support in the Configure script for AIX versions above 4.3.3.0 or AIX AFS versions above 3.5. Added support for FreeBSD 5.1. With advice from Allan Nathanson adjusted the Darwin get-xnu-headers.sh script to access the kernel header files needed by lsof from a new form of the Apple open source repository. Installed Linux and lsof library bug fixes and improvements, supplied by Marian Jancar . One Linux improvement handles mount strings that have octal escapes in them, eg., \040 for embedded blanks. Marian tested the changes. 4.69 October 16, 2003 Received and applied an OpenBSD patch from Peter Valchev that replaces a ctob() call with a sysconf() call. Peter claims sysconf() is needed for OpenBSD on SPARC. (It is not needed for NetBSD on SPARC.) With the upgrade of my only Solaris 7 test system to, Solaris 8, dropped the *claim* that lsof works on Solaris 7. That doesn't mean it won't work there, so those who want lsof for Solaris 7 probably should be able to build it there and it probably will work there. Revised lsof's DNLC handling for BSD derivatives, including: BSDI; Darwin, DEC OSF/1, Digital UNIX and Tru64 UNIX; FreeBSD; NetBSD; and OpenBSD. The latest NetBSD distribution's dropping of the vnode capability ID (v_id) required the revision. Adjusted to the latest FreeBSD 5.1-CURRENT. Added NetBSD support for using kvm_getproc2(). Added a patch from Andrew Brown to handle NetBSD enum conflicts and changes in the and header files. Added a "#define _KERNEL" to the AIX dnode2.c source file for compatibility with a new AIX 5.2 header file version. The addition was supplied by Dick Dunbar and was offered as a patch to lsof 4.68/ Added support for a second type of Solaris SAMFS. Stuart Anderson provided the support. SAMFS support in lsof SOLARIS remains scanty, because Sun won't release any details on its kernel structures. Dropped the *claim* that lsof works on AIX 4.3.3, because I was unable to test it there. That doesn't mean it won't work there, so those who want lsof for AIX 4.3.3 probably should be able to build it there and it probably will work there. Updated for Solaris 10 on test systems provided by Mike Miscevic . Casper Dik provided significant help. During the Solaris 10 port found and fixed an lofs handling bug that prevented reporting of open lofs file lock status. Updated the DNLC test, LTdnlc, to provide a possible explanation about file systems on which the test might fail. Modified the procedure for obtaining missing Darwin XNU kernel header files. The new one requires more manual intervention, but is the best that can be done with the way Apple open sources are now organized. 00FAQ explains the new procedures for those not used to downloading Apple open source files. Added support for Apple Darwin 7.0 (Mac OS X 10.3) with patches supplied by Allan Nathanson . Dropped the *claim* that lsof builds and works on Apple Darwin below 6.0. Validated lsof on FreeBSD 4.9, using a test system provided by Ben Lewis . Validated lsof on FreeBSD 5.1-CURRENT for Amd64. David O'Brien provided a test system. Changed the NetBSD Configure stanza to do header file searches in /usr/include by default. The LSOF_INCLUDE and NETBSD_SYS environment variables may still be used to specify other search paths. Discussions with Andrew Brown and Wolfgang S. Rupprecht led to the change. 4.70 January 16, 2004 Improved shell-portability of the linux stanza of the Configure script with a patch from Paul Jarc . Added a "silent" rule to tests/Makefile for Paul. Updated, extended and clarified the test suite documentation in 00FAQ and 00TEST. Fixed Solaris 10 dlsof.h typo, reported by Mike Miscevic . The typo prevents lsof from loading cleanly in Solaris 10 builds past 40. Fixed a Solaris HSFS node number reporting bug and added a structure definition work-around for Solaris 10. Converted PGP signing to GPG. My previous PGP key can be used, but the gpg "--allow-non-selfsigned-uid" option may have to be used when it is imported into a GPG key ring. Added bz2 compression. Updated for OpenBSD 3.4. Added a work-around for a missing header file in the s10_44 Solaris 10 build. Added support for FreeBSD 5.2-BETA and 5.2-CURRENT. Updated Linux AX25 support with modifications supplied by Lutz Poetschulat . Added raw IPv6 support to Linux lsof. Improved handling of parameters after "-i@". Improved file name test in LTdnlc.c. Added loop count controls to the reading of Solaris lock chains. The change was implemented as a result of a report from Steve Gonczi . Based on a report from John Jackson , enabled a Solaris 10 work-around for Solaris 9, too. (Patch 112233 installs an lgrp.h on Solaris 9 that needs the work-around.) With help from Andrew Brown and John Heasley added log-structured file system (LFS) support for NetBSD and OpenBSD. Added AMD64 to the list of FreeBSD 5.x-CURRENT supported architectures. FreeBSD.org provides a test system, courtesy of (I believe) David O'Brien . Added a cast to lseek() in the HP-UX /dev/kmem-based kread() function to make it work properly with the bundled HP C compiler. 4.71 March 11, 2004 Added text file support to Apple Darwin lsof and enabled the lsof executable portion of the LTbasic test. Added support for Darwin kernel queue, POSIX semaphore and POSIX shared memory files. Tested on Darwin 7.2 (aka Mac OS 10.3.2). Added process_kqueue() function prototypes for FreeBSD, NetBSD and OpenBSD. Picked some lint in AIX sources, lib/rnmh.c and tests/LTsock.c. Added "-x [fl]" cross-over option, which enables +d and +D processing to cross over symbolic links and|or file system mount points. Discussion with Johan Lindquist and Eric Williams (aka The Ghost In The Machine) on Linux news groups revealed the need for the option. Updated support for UnixWare 7.1.4. Added support for the optional reporting of socket options, socket states and TCP flags for most currently supported dialects. John Smith and Tristan Nefzger requested the information. The dialects and their versions for which this feature has become available include: AIX 4.3.2 and 5.[12] Apple Darwin 7.2 BSDI BSD/OS 4.3.1 Digital UNIX and Tru64 UNIX 4.0 FreeBSD 4.9 and 5.2 HP-UX 11 and 11.11 (aka 11i) NetBSD 1.6ZH OpenBSD 3.4 OPENSTEP 4.2 OpenUNIX 8 SCO OpenServer Release 5.0.6 Solaris 2.6, 8, 9 and 10 UnixWare 7.1.[134] Modified the Configure stanza for HP-UX 11 with better q4 detection. Steve Bonds <3vhmxxm02@sneakemail.com> supplied the modification. Applied a patch from Mike Miscevic to enable lsof to compile with the zone support in the Solaris 10 s10_b51 release. Added information on lsof zone behavior to 00FAQ. Added a "-z [z]" option to Solaris 10 lsof. It enables the listing of zone name and can also be used to select the listing of processes and their files from specified zones. 4.72 July 13, 2004 Corrected Solaris 10 ZONE column title display bug with a patch from Joep Vesseur . Joep's fix was offered as a patch to 4.71. Based on a report from Jean-Pierre Radley about an unexpected GNU uname Configure interaction on OSR, and working from information received from Bela Lubkin, changed the OSR Configure stanza to use /bin/uname instead of uname. Added an FAQ entry about Configure version detection problems. Added the +m and "+m m" options in response to a dialog with Robert T. Brown . The options allow the creation of a mount table supplement file which can be used on selected dialects to get device numbers when stat(2) and lstat(2) can't deliver them. (That's generally the result of an inaccessible NFS server.) Currently the new options are supported only on Linux. Made cpumask_t typedef _KERNEL compensation for FreeBSD 5.2-CURRENT. Refined it for 5.2.1-RELEASE with testing help from Scott Ellentuch . Added support for FreeBSD 4.10. Larry Rosenman kindly provided a test system. Added support for NetBSD 2.0 with patches supplied by Andrew Brown . Andrew also provided two test systems. Made handling of Linux maps file more robust, based on a report from Jan Blunck . As a side benefit, made handling of generated stat(2) information more flexible. As a result of a discussion with Jason Fortezzo , adjusted lsof for Solaris to obtain the maximum user name length from ut_name of the utmpx structure, if exists. Tested under OpenBSD 3.5. Updated 00README information about using gcc (via the Configure aixgcc abbrevisiation) to compile lsof on AIX. Ann Janssen made me aware the information was out of date. Added an AIX SIGDANGER handler and some 00FAQ sections on lsof memory usage after a discussion with Tom Qin about lsof memory usage. Added scripts/sort_res.perl5, contributed by Fabian Frederick . The script displays lsof output sorted by size and path name. Improved handling of files on Linux NFS mount points that use the root_squash option, based on discussions with Paul Szabo . Updated FreeBSD 5.2-CURRENT support, based on a problem report from Filippo Natali . Corrected improper FreeeBSD 5.x-CURRENT #if condition, reported by Kim Culhan . Added a Configure script work-around for AIX 5.2 lsof with JFS2, compiled by gcc >= 3.3. The work-around was supplied by Florian M. Weps . 4.73 October 21, 2004 Added an __XPG4_CHAR_CLASS__ #define before #include'ing on Solaris to restore lsof's ability to display special characters such as acute-e. Added wide-character (e.g., UTF-8) support where possible, prompted by a request from Kyungjoon Lee . Some older dialects -- e.g., NetBSD 1.4.1 -- don't support wide characters, so the wide character support is enabled by definitions in each dialect's machine.h. Dialects with wide- character support are listed in 00FAQ. Make a FreeBSD 5.2-CURRENT adjustment for , supplied by Sergey A. Osokin . Implemented a Linux feature request made by Jakub Jelinek that enhances lsof's ability to locate UNIX domain sockets whose paths are named as arguments. Jakub supplied suggested code. Dropped *claims* that lsof works on AIX below 5.1, SCO Dropped *claims* that lsof works on AIX below 5.1, SCO Openserver 5.0.4, Tru64 UNIX 5.0, and UnixWare below 7.1.4. Lsof will probably build and work on those UNIX dialect versions, but I no longer have any way to test lsof on them. Added support for FreeBSD 5.3 and 6.0. The FreeBSD 5.3 support hasn't been tested. Added FD test code that will allow dialect versions to test FD option selections. Used the new code in the PSTAT-based HP-UX lsof to enable it to avoid scanning the mount table when its information is not needed. The addition was made in response to a query from Harvey Garner about lsof performance in a busy NFS environment. Upgraded lsof's AIX support level to AIX 5.3, based on a report from Dick Dunbar . (I have not tested lsof under AIX 5.3.) Based on Dick's recommendation and local testing changed the C for AIX version 6 and higher -qmaxmem option value to -1. Made LSOF_AR environment variable more useful and documented it in 00XCONFIG. Corrected the use of sum(1) to generate signatures for the lsof distribution and binaries to match the documentation that claims it is sum -r output. Jin Guojun noticed and reported the problem. Tested under OpenBSD 3.6. Added checksum and GPG certificate files for the bz2, gz and Z lsof distribution archives. The new files reside with the distribution archives and supplement the signature information already inside the archives. Validated on Solaris 10, i8xpc, build s10_63. 4.74 January 17, 2005 Fixed a Solaris segment fault bug on systems that lack a /dev/allkmem device. Offered the fix as a patch to lsof 4.73. The bug was reported by Donald Zoch . Updated lsof for FreeBSD 6.0 and higher for a change in , based on a report from Sergey A. Osokin . Made the update available in a 4.74 'A' edition pre-release. Filed an HP bug report about missing pstat(2) CWD info for LOFS on HP-UX 11.11 and higher. The missing CWD info was noticed by Ermin Borovac . Added info to 00FAQ about the problem, which can cause the lsof test suite's LTbasic test to fail. Updated the q4-generated tcp_s.h in the lsof distribution and added socket option support for HP-UX 11.00. Erwin Reyns helped test. Updated for Solaris 10, build s10_69, with a patch supplied by Mike Miscevic . Added v_path support to Solaris 10 lsof. That relieves it of having to read and decode the kernel DNLC, and delivers full paths more reliably. Added specialized NFS4 support to Solaris 10 lsof. Applied Solaris 10 patches to lsof supplied by Casper Dik . Updated lsof for NetBSD 2.99.10 and tested it on a system provided by Andrew Brown . Added support for the FreeBSD 6.0-CURRENT f_vnode pointer in the file structure. Added BSDI, FreeBSD, NetBSD and OpenBSD support for the *effnlink member of the inode structure. This makes the lsof LTnlink test run faster on all modified dialects and correctly on OpenBSD. Added ptyfs support for NetBSD, using modifications provided by Andrew Brown. Changed the netbsd Configure stanza to look by default for system header files in both /usr/include and /usr/src. (The NETBSD_SYS environment variable can still be used to select an alternate for /usr/src.) Corrects two FreeBSD 4.10 RPC/XDR type definitions. Added an FAQ Q&A about setuid and setgid restrictions in HP-UX 11.11. The information in the answer was supplied by Frank Sanders . Added abbreviations for AXI FCIO and FSNAPSHOT file flags. Holger VanKoll reported the missing FCIO. Adjusted lsof's private AIX 64 bit rnode structure for 64 bit AIX 5.2 systems. (IBM doesn't distribute a correct for it.) Corrected a Linux socket inode printing bug reported by Igor Schein . Updated for FreeBSD 4.11. The support compiles but hasn't been tested. Back-ported a FreeBSD 6.0-CURRENT fix to FreeBSD 5.3-RELEASE-p1. That was done to solve a compilation problem reported by Radko Keves . 4.75 May 16, 2005 Dropped the *claim* that lsof works on DEC OSF/1 and Digital UNIX, since my last 4.0 test system has been removed. The last tested distribution of lsof on DEC OSF/1 and Digital UNIX was revision 4.74. It has been archived on lsof.itap.purdue.edu in pub/tools/unix/lsof/OLD/src. Added negation forms to the values in the -g (PGID) and -p (PID) lists. Negated PGID and PID values, like negated UID or login name values, are applied without ORing or ANDing and take effect before any other selection criteria are applied. At the request of Marcin Gozdalik added a -X option for Linux. The option inhibits the reading of the /proc/net/tcp* and /proc/net/udp* files. Based on a report from David Gutierrez changed DEC OSF/1 process table allocation to request memory in smaller increments. Based on a report from jayjwa updated the Customize script to use "tail -n 1" where possible. Enabled support for FreeBSD 5.4. Improved the BSDI, FreeBSD, NetBSD, OpenBSD and Solaris kvm_open() and kvm_openfiles() error messages. Enabled support for NetBSD 2.99.12. Improved HP-UX Configure stanza with help from Piet Starreveld . Picked some lint Piet found. Enabled IPv6 support for HP-UX > 11. Piet Starreveld helped test it on 11.23, among others. Updated for HP-UX 11.23 on the ia64 architecture. Updated to latest FreeBSD 6.0-CURRENT, using a test system provided by Andrzej Tobola . Added support for SCO OSR 6.0.0 and UnixWare 7.1.4 with help from Richard at SCO. Corrected a Linux bug in NFS handling, reported by Karel Zak . Karel supplied a patch. Improved the code for accessing an AIX 3.2 and higher sockaddr_un structure, thus eliminating a segmentation fault possibility. Updated for AIX 5.3. Added preliminary (DEBUG) support for the AIX SANFS file system. Fixed a bug in the Solaris 10 processing of the vnode's v_path pointer with code supplied by Edward Jajko . The fix was offered as a patch to 4.74. Dropped support for OpenUNIX 8, since a test system is no longer available. Archived an OpenUNIX-only distribution of the last revision (4.74) tested on OpenUNIX in pub/tools/unix/lsof/OLD/src. Tested under Openbsd 3.7. Tested under Darwin 7.7.0. Enabled building on amd64 Solaris 10 with hints from Marc Aurele La France . Marc provided a test system. Supplied a missing quote in the FreeBSD Configure stanza. Carl Cook reported the problem. Removed "-O" option from tests/Makefile so that the HP-UX bundled compiler won't complain. 4.76 August 30, 2005 Corrected an example and spelling errors in man page. Updated for Apple Darwin 8.x with changes supplied by Allan Nathanson . Allan also provided a test system. Completed documentation of CLRLFILEADD in all machine.h files. At the request of Chris Markle added partial listen queue length to socket options displayed when -Tf is specified. Partial queue length is not reported for all dialects. (00FAQ lists the ones where it is reported.) Updated for FreeBSD 7.0 with information supplied by Andrzej Tobola . Updated Solaris VxFS support for VxFS versions 4 and above with technical advice from Craig Harmer , Gary Millen and Chuck Silvers . Testing help was provided by Michael Antlitz , Steve Ginsberg and Kenneth Stailey . Fixed a Solaris address space map processing bug. Janardhan Molumuri reported the bug and help me identify it. Made the fix available as a patch to 4.75. Added support for Solaris 10 port and CTFS files. The CTFS support is incomplete, because I don't know how to get inode number, size and link count. (There's a new 00FAQ entry about that.) Investigated a report from Christopher J Warweg that the CHECKSUMS for the lsof 4.75 binary for 64 bit Solaris 8 was incorrect. It was my packaging error. I rebuilt and repackaged the binary. Enabled support for Linux map file names with embedded spaces. 4.77 April 10, 2006 Added -X option support for Solaris 10 and above. When -X is specified lsof will report cached v_node path names for unlinked files, followed by "(deleted)". Improved cached vnode path name handling by adding "(?)" to the end of path names of questionable accuracy. Updated 00FAQ to reflect these changes. Updated for FreeBSD 7.0-CURRENT. Fixed name addition spacing bug, reported by Stuart Anderson . Also updated Solaris 10 SAMFS support at Stuart's request. Added missing "break;" and another HASSTATVFS test to the NetBSD and OpenBSD dnode.c. Bill Behr reported those needs. Fixed an HP-UX 11 file descriptor "chunk" size problem, reported by Per Allansson . Per helped devise the fix and tested it. This fix was offered as a patch to lsof 4.76. Updated for FreeBSD 6.0-STABLE and FreeBSD 6.1-PRERELEASE. Updated scripts/sort_res.perl5 with changes supplied by Frederick Fabian , the author of the script. Corrected +|-M man page documentation error, reported by Roger Cornelius . Improved FreeBSD user device random seed generation in response to a problem report from Danny Braniss . Eliminated three syntax error bugs and other compiler complaints from the PSTAT-based lsof. H. Merijn Brand reported the problems and tested the fixes. Eliminated compiler complaints in the test suite. Investigated problems with the building of lsof on PA-RISC HP-UX 11.23, based on a report from John Orndorff . Found that neither the HP bundled C compiler nor gcc would build lsof, but the HP unbundled ANSI C compiler would. Concluded that HP bundled C compiler can't handle . Devised a work-around to gcc's omission of the rpcent structure definition of that allows it to compile lsof's print.c, but the resulting binary doesn't run reliably. Documented the situation in 00FAQ. Changed reporting of unknown file types. The number of an unknown type is now reported as four octets. The change was made in response to a Linux lsof bug report from Karel Zak . Dropped the *claim* that lsof works on BSDI BSD/OS since my last test system has been removed. The last tested distribution of lsof for BSDI BSD/OS was revision 4.76. It has been archived on lsof.itap.purdue.edu in pub/tools/unix/lsof/OLD/src. As a result of discussing the lsof source tar's MD5 checksum with Andrew Bell , changed the description of a suitable MD5 tool in the lsof distribution's documentation to name the openssl "dgst" command. Enabled compilation on Solaris 10 1/06 with a fix sent by Jason Fortezzo . Made the fix available as a patch to 4.76. Adjusted to FreeBSD 5.5-PRERELEASE. Corrected a bug in the lsof library's process_file() function to enable the locating of AIX XTI sockets by their TCP/IP address values. The bug was reported by Michel Dubois . Based on a bug report from Karel Zak added command name length checking to as many dialects as possible (Linux for Karel) for the "-c c" option. Updated for OpenBSD 3.[89]. Tested the 3.9 update on a system provided by David Mazieres. I have not tested on OpenBSD 3.8, but David reports lsof 4.76 worked there. Ended regression testing of lsof on 32 bit Solaris 8 with the ending of access to a test system. Lsof continues to be tested on 64 bit Solaris 8. 4.78 April 24, 2007 Added more information to the lsof FAQ about missing link counts and sizes on Linux files. Simplified Linux stat() and lstat() usage. Relocated #define's that prevent OpenBSD compilation on systems without a /proc file system. Pieter Bowman reported the problem. Added code to avoid processing Linux /proc//maps file entries with zero device and node numbers. Some such entries now have names associated with them that are not path names -- e.g., "[heap]", "[stack]" or "[vdso]". Scott Worley reported lsof's mishandling of such entries. Added SELinux security context support, provided by James Antill . I have not tested this, but James and Karel Zak have. Added the #include of to Solaris lsof to enabled compilation on Solaris 10 6/06. Peter Harvey Peter.Harvey@Sun.COM diagnosed the problem and supplied a patch. Added better support for JFS2 on AIX 5.2 and 5.3, based on bug reports and help from Thomas Braunbeck and Tom Whitty . Documented that lsof supports AIX 5.3 only up through maintenance level 1 (ML1). Enabled Solaris lsof to locate the AFS vnode operation address for OpenAFS 1.4.1. The fix was supplied by Robert Jelinek . Enabled support for Solaris 10 ZFS. If the necessary ZFS header files aren't found, lsof offers the option to drop ZFS support, to use internal, possibly inaccurate structure definitions, or to supply a path to the missing header files. Horst Scheuermann provided a development system and helped test the support. Corrected a typo in the man page, reported by Eric S. Raymond . Changed the spelling of macroes to macros in lsof source and documentations files, based on a suggestion from Josh Soref and verification with the OED. The following dialects are no longer supported: 32 bit AIX 5.2, HP-UX 11, OpenStep 4.2, Solaris 2.6, Solaris 8, True Unix 64 and UnixWare 7.1.4. Lsof may work on them, but I no longer have test systems for them. Support for OpenBSD ends at its version 3.9 for lack of interest in the port. 4.79 April 15, 2008 **************** IMPORTANT NOTE ****************** * * * Lsof support has been reduced to the following * * dialects: AIX, FreeBSD, Linux and Solaris, and * * only in selected versions of those dialects. * * The selected versions are listed in this file * * and in other lsof documentation. * * * * I have made this move because of retirement * * and because I no longer have many test systems * * available to me. * * * * Vic Abell * * * ************************************************** Fixed a Solaris VXFS permission problem when accessing the VXFS inode offsets. The bug was reported by Gregory A. Ivanov . Gregory tested the fix. Moved an #include later in FreeBSD dlsof.h to enable compilation on recent FreeBSD releases. The change was supplied by Roy Marples . Improved Linux /proc file stream reading speed by applying an expanded version of a patch from Eric Dumazet that allocates a page size buffer to each stream. Improved TCP, TCP6, UDP and UDP6 hashing by determining the hash bucket count from the /proc/net sockstat and sockstat6 files. The improvement was suggested by Eric and he provided sample code. Eric also tested both improvements. Modified Configure script to build lsof on FreeBSD 6.2. Tested it on a system provided by Larry Rosenman . Fixed a Linux maps file processing bug that prevented path names from having an embedded colon. James Lingard reported the bug and helped with its fix. Based on reports from Eric Dumazet and Samuel Thibault added support for the Linux 2.6.22 kernel's /proc//fdinfo files -- i.e., file offset and flags. Samuel Thibault provided a test system. Fixed a Linux UNIX socket memory leak, reported by Philip Shin . Phillip supplied the fix. With generous assistance from HP added support for an HP-UX 11.23 patch that makes TLI/XTI socket address information available. Fixed a header file problem for FreeBSD 6.2 on the Alpha architecture. The problem was reported by Pekka Honkanen . Pekka tested the fix. Based on a report and using suggested fixes from Karel Zak , made these changes to Linux lsof: corrected a getpidcon() error message; insured that inode numbers are handled correctly for their unsigned long long type; and improved SELinux handling. At the request of Alon Bar-Lev added the LINUX_HASSELINUX environment variable to enable or inhibit SElinux support unconditionally. Updated Configure for FreeBSD 8.0-CURRENT and tested lsof on AMD64 there. Added a patch provided by Oles Hnatkevych for FreeBSD systems where the root file system is on a CD9660 device. Added compensation for the disappearance of FMARK and FDEFER from the FreeBSD 8.0-CURRENT . Updated FreeBSD lsof with ZFS support. Larry Rosenman , Erwin Lansing , Wesley Shields and Dmitry Morozovsky provided test systems. Fixed a socket file identification problem reported by Pavol Rusnak . Pavol also reported the cause of the problem. Added the ability to format the repeat mode marker line with strftime(3), where the dialect supports the localtime(3) and strftime(3) C library functions. The addition was suggested by Mike Depot , who also tested it. The addition required creating a new main lsof source module, util.c, that contains functions whose compilation conflicts with the general header file tree defined by lsof.h and dlsof.h. Based on reports from Andrei V. Lavreniyuk and Pav Lucistnik updated the FreeBSD 7.0 and above file lock handling to use new locking structures. The update requires a terrible hack to get a definition for the lock owner structure from a kernel source module into a local lsof header file. 4.80 May 12, 2008 Updated for a FreeBSD 7.0 and above byte level locking change. The problem was reported by Conrad J. Sabatier , who helped test the update. Wesley Shields provided an 8.0-CURRENT test system. Propagated the FreeBSD 7.0 and above locking changes to FreeBSD 6.x, based on a report from Edwin Groothuis . Added warnings for unsupported dialects or versions. Added Linux support for the UDPLITE protocol. Eric Dumazet supplied a patch. Added a missing quote to the Configure script's FreeBSD stanza. Added a usage.o rule to the HP-UX PSTAT-based Makefile. I mistakenly deleted the rule at revision 4.79. The missing rule was reported by Kawaljeet Kaur who tested the corrected Makefile. 4.81 October 21, 2008 Updated the Darwin libproc sources with changes from Allan Nathanson . Tested them on a iMac mini, provided by Apple Inc. Changed dummy declarations in library source files to eliminate complaints about unused variables and empty object files. This change may not work on dialects I can no longer test; it has been tested on some versions of AIX, Darwin, FreeBSD, Linux and Solaris. At the request of Hal Brooks added support for Linux /proc/net/packet files. Hal tested it. Added socket file only performance enhancements to Linux and PSTAT-based HPUX lsof. Added htonl call around improper usage of INADDR_LOOPBACK; report from an Apple engineer forwarded by Allan Nathanson . Adjusted for FreeBSD-8.0 change in device number handling. The adjustment should work for FreeBSD 5 and above, should the 8.0 change be propagated downward. The problem was reported by Pav Lucistnik . An updated test system was provided by Erwin Lansing . Reduced AIX support to version 5.3, since test systems with older versions are no longer available to me. At the request of Marjo F. Mercado and Phil Shin applied some speed improvements to lsof, particularly when the files of interest are /Internet files -- i.e., selected with lsof's "-i" option. Added a two new options to assist the improvements: 1) "-c^" to tell lsof to exclude the named command(s); and 2) "-stcp|ud>:[^]state' to tell lsof to include in its reporting or exclude ('^') from its reporting Internet files in the named states (e.g., LISTEN, ^CLOSE_WAIT, IDLE, etc.) For the most part these changes apply only to AIX, Darwin, FreeBSD, PSTAT-based HP-UX, Linux and Solaris, since those are the only places I could test them. They are controlled by the HASTCPUDPSTATE definition in each dialect's machine.h header file. Marjo and Phil provided HP-UX 11.23 and 11.31 test systems. Fixed a stat(2) problem on HP-UX 11.31 while testing the speed improvements. Adjusted for kernel header file changes in FreeBSD 8.0-CURRENT. Larry Rosenman provided a test system. Added a warning for Solaris systems where VxFS node info can't be obtained from the VxFS utility library. The warning was requested by Tom Matthews . Corrected mishandling of file system path name arguments that have trailing slashes, except, of course, the root file system, "/". Allan Nathanson reported the bug. 4.82 March 25, 2009 Corrected an over-zealous exclusion test that caused lsof to report nothing when it was given no arguments and built with HASSECURITY and HASNOSOCKSECURITY enabled. Joshua Kinard reported the bug and supplied information for reproducing it. Based on a report from Dan Trinkle corrected use of for 32 bit Solaris 10 and above compilations. Simultaneously eliminated a casting complaint in arg.c and updated Configure to use the appropriate 64 bit compilation option (-xarch=v9 or -m64) with the Solaris Sun C compiler. Updated for FreeBSD 7.1-PRERELEASE with information supplied by Larry Rosenman . Updated the Darwin libproc sources with changes from Allan Nathanson . Tested them on a iMac mini, provided by Apple Inc. Allan also provided man page corrections. Updated the FreeBSD Makefile to use the ${MAKE} variable for ZFS dnode2.c module compilation, based on a suggestion from Alexis Ballier . Improved the Solaris VxFS library location test, based on a suggestion from Jason Fortezzo . Jason tested the change. Updated Solaris 10 ZFS support for ZFS version 4 and ZFS pool version 10, using a test system kindly provided by Vladislav Nespor . Renata Maria Dart tested on ZFS version 4, verifying that the update works there, too. (ZFS pool version 10 is apparently the ZFS version shipped with the 10/08 update to Solaris. The original ZFS support targeted ZFS version 3.) I still consider ZFS support in Solaris lsof a hack, because it depends on a znode structure definition that I developed using dbx. Sun is remiss in not distributing the ZFS header files used to build the distributed kernel. Because of the znode structure definition hack, I can't guarantee that lsof ZFS support will work for any other versions of ZFS. Solaris 10: adjusted to a change in the way devices are stored in the kernel; fixed a problem in zone handling; and added rudimentary sharedfs support. Carson Gaspar reported the device number problem, provided a test system, and tested the changes. Peter Vines reported the zone handling problem and tested the fix. Adapted to FreeBSD 8.0-CURRENT changes in device number computation. Problem was reported by Erwin Lansing . Larry Rosenman provided a test system. Corrected Solaris Configure test for appropriate VxFS library when using gcc to compile lsof. Updated for loss of KAME IPv6 FreeBSD accommodations. Adapted to FreeBSD 7.2. Made Configure script recognized FreeBSD 6.3. 4.83 January 18, 2010 Converted Solaris 10 and above ZFS support to use the CTF debugger library, libctf. Code was supplied by Robert Byrnes . Corrected a typo in the testing of the LINUX_HASSELINUX environment variable in the Configure script. The error was reported by Mike Frysinger . At Mike's request made Configure script accept LSOF_RANLIB (ranlib command), LSOF_CFGF (additional configuration flags) and LSOF_CFGL (additional library specifications) from the environment. Enabled complilation of Solaris 10 lsof after a recent Sun patch which changed the PC file system's structure. Peter Vernam reported the problem and helped with the fix. Made the sort of configuration CFLAGS in the CkTestDB script impervious to locale settings. Ported to Solaris 11, using a test system kindly provided by David Day . Adjusted to the disappearance of in FreeBSD 8.0-BETA1. Changed Solaris node type lookup to a hashed method and added some ability for it to handle duplicate vnodeop names in /dev/ksyms. Updated for FreeBSD 9.0-CURRENT. Andrzej Tobola provided a test system. Extends the fix to FreeBSD 6.0 and above via a Configure test and a compile-time definition. The need for the extension was reported by Erik Trulsson > Made corrections to FAQ typographical errors, suggested by Josh Soref . Added __UCLIBC__ test to Linux dlsof.h so lsof would compile on an Intel ARM XScale processor. The addition was provided by Doug Kehn . Added test for to FreeBSD configuration. Improved its use in lsof.h. The changes were supplied by Martin Wilke . 4.84 July 29, 2010 Fixed a man page nroff command error with a correction supplied by Josh Soref . Made Configure script recognize FreeBSD 7.3. Larry Rosenman provided a test system. Improved task support, initially for Linux only, with help provided by Jerome Marchand and Miklos Szeredi . The support includes a new compile-time definition, HASTASKS, and a new run time option, "-K" to select task reporting. While adding help output support for "-K", reorganized the printing of help columns to make it much easier to add a new option description. Updated the Solaris PC file system structure patch in revision 4.83 so it will compile with gcc. Disabled the Solaris lgrp_root work-around in the Solaris machine.h so it won't cause compilation problems on Solaris 11. It no longer causes compilation problems on my Solaris 9 and 10 test systems, but some older Solaris 9 and 10 versions may still need it, so the work-around was left in the Sun machine.h and a FAQ entry was created about it. Updated for Solaris 11 b134, using a test system kindly provided by Carson Gaspar . Made provisions for the next ZFS version. Added info about the failure of the LTnlink test on ZFS file systems. Corrected typo in Configure script, reported by Dmitry Berezin . 4.85 September 27, 2011 John Dzubera kindly provided a patched Solaris 9 test system with the lgrp_root conflict and I was able to devise an automatic work-around for the conflict. The special note in .../dialects/sun/machine.h was removed and the 17.28.1 FAQ entry was modified to reflect the update. Added a Solaris 11 work-around for a typedef problem with . Carson Gaspar reported the problem and supplied the work-around. Added support for FreeBSD 7.4 and 8.2; tested on systems provided by Larry Rosenman . Added support for 32 bit Solaris 11 lsof with mods supplied by Jan Wortelboer . Added Solaris 11 support for using an alternate genunix location. Bill Goodridge reported the alternate location. Added further Linux cross configuration support to lsof's Configure script. The additional support was supplied by Grant Erickson . See the descriptions of the LINUX_* environmen variables in 00XCONFIG for more information. Tested lsof on Linux kernel 2.6.32 and picked some lint that surfaced during the test. Added fixes and changes for Apple Mac OS X 10.6, provided by Allan Nathanson . Allan also provided a test system. Tested on FreeBSD 6.4 i386, using a test system provided by Terry Kennedy . Updated for recent FreeBSD ZFS changes on an 8.2 amd64 test system also provided by Terry. Changed documentation to indicate FreeBSD 7.x is no longer supported, since I no longer have a test system. Made some changes to the lsof man page, suggested by Navid . Added compensation for Solaris 10 systems that have patch 144488-10. The patch requires that the new header file be included while _KERNEL is defined. Brett Bartick reported the problem first, followed by Stuart Anderson . Michael Hocke suggested a work-around which I refined to limit it to the specific Solaris 10 instance and then tested on a system provided by Charles Stephens Added the +|-e option for Linux. It exempts file systems named by path from function calls that might block in the kernel -- i.e., stat(2) and lstat(2), and when the +e form is used, readlink (2). The new packager of lsof for the Linux Fedora and RHEL distributions, Peter Schiffer , asked for the feature so it could be used with Clearcase file systems, whose implementation can block stat(2) calls. I consider this feature very risky and easy to misuse -- e.g., specifying the file system as '/' would exempt all file systems. I don't intend to propagate this option to any other UNIX dialect that lsof currently supports. Made FreeBSD 9 adjustment. Fixed a Linux bug that prevented the display of paths for abstract UNIX sockets. Masatake Yamato reported the bug and supplied a patch. Added compensation for the removal of RPC header files from GlibC 2.14 for Linux. Marek Behun reported the problem and supplied a patch. Added support for Linux Netlink protocol. Masatake Yamato requested the support and supplied a patch. Peter Schiffer provided a test system. Corrected Linux UDP6-lite path. The error was reported by Masatake Yamato and he also supplied a patch. 4.86 April 10, 2012 Lsof for AIX is no longer supported on any versions of that operating system. Added information about the clang compiler for FreeBSD to the FAQ. Corrected an arg.c bug in the accumulation of +|-e option values, reported by Peter Schiffer . This correction was supplied as a patch to revision 4.85. Enabled FreeBSD 10 support and tested it there on a system provided by Larry Rosenman . Updated for latest Solaris 11 with patches supplied by Carson Gaspar . Carson supplied a test system. Adjusted Linux file system search method to compensate for NFS mounts that have duplicate device numbers. The problem was reported by Peter Schiffer , who provided a test system. At the request of Peter Schiffer , added support for Linux SCTP socket files. Peter provided a test system. Applied a warning patch supplied by Peter. Added support for Mac OS X 10.7 (Lion), provided by Allan Nathanson . Allan also supplied a test system. Enabled FreeBSD 8.3 support and tested it there on a system provided by Larry Rosenman . Corrected the FAQ information on ZFS with Solaris 10 after Steven Blackmon and Prasad Jampala pointed out that it was incorrect -- i.e., outdated by the libctf changes at revision 4.83. Added code to handle a Linux NFS-mounted root. Jia He reported the need for this. 4.87 January 2, 2013 Added an entry to 00FAQ about lsof behavior when the HASSECURITY and HASNOSOCKSECURITY options are defined. Carson Gaspar pointed out the need for this clarification. Added a work-around for a missing definition of mach_port_t in Darwin 9 (Mac OS/X 10.5.8). The work-around was supplied by Jim Reid . Added support for Linux anon_inodefs, provided by Masatake YAMATO . Documented a Solaris 9 and 10 portmap reporting problem (+M) in 00FAQ. The problem was reported by Clint Roberts . I have no solution to the problem, but discuss a possible work-around in the answer to this 00FAQ question: "Why doesn't lsof report portmap registrations for some Solaris versions?" Added FreeBSD support for the oldnfs and newnfs file system types. Daniel Braniss reported the need for the addition. Added ICMP socket support for Linux with code provided by Masatake YAMATO . Corrected the reporting of process group ID for libproc versions of Mac OS X with a patch from Jeff Trawick . The patch has not been applied to Darwin kmem versions, because of little call for them and inadequate test system access. The patch has been tested on Mac OS X 10.8 (Mountain Lion), courtesy of a test system provided by Allan Nathanson . Added thread support to those FreeBSD versions that have ki_numthreads in their kinfo_proc structure. This also activates the -K option for those FreeBSD versions. Jeff Trawick reported problems with FreeBSD lsof when threads are present and this addition solves those problems. Made changes to 00FAQ and the distribution, suggested by Warren Young . The 00FAQ changes center on sections that discuss the -s option. The changes to the distribution include a ChangeLog file that is either a pointer to or a copy of 00DIST, the distribution notes. Added support to FreeBSD for using the clang compiler. Added Linux support for using the getxattr() call to obtain socket protocol identification when it is can't be obtained from the /proc/net files that lsof examines. Masatake YAMATO developed the kernel patch to getxattr() and supplied the lsof patch. 4.88 October 13, 2014 Reduced to 50 the number of open file descriptors lsof attempts to close while trying to protect itself from a file descriptor exec() attack. This limits the overhead lsof incurs on systems that have large file descriptor limits, yet provides sufficient open descriptors for the library functions lsof calls. Updated for changes in FreeBSD 10 with advice from Eygene Ryabinkin . Taught Configure to recognize FreeBSD 8.4. Herein am noting that lsof for Solaris 10 or 11 is no longer supported. I no longer have test systems. Some support is still available from Casper Dik and a Solaris 11 patch he provided is included in this revision. Initialized local variables in the Linux process_id() function. Jia He reported the problem. Added support for FreeBSD 11. Updated FreeBSD ZFS Configure stanza to supply a dummy opt_kdtrace.h when needed. Added tmpfs file system support for FreeBSD. Since a test system is no longer available, dropped the claim of FreeBSD 4.9 support. Added the +|-E options for Linux. -E displays endpoint info; +E displays endpoint info and endpopint files. Masatake YAMATO requested this support and suggested code to implement it. Fixed a Linux bug handling processes whose command includes a non-printing character, particularly a NEWLINE character, and clarified printing of single '\\' characters in command and file names. Stephane Chazelas reported the problem. Added support for Linux RDMA and CRYPTO protocol names and UNIX socket type with code from Masatake YAMATO . Fixed field output to insure that the field descriptor field is always selected, since it identifies the file set. The bug was reported by Gary Plewa . 4.89 July 7, 2015 Applied correction from Casper Dik to his patch for Solaris 11 that I applied incorrectly in revision 4.88. Updated for latest version of FreeBSD 11.0-CURRENT. Compensated for a missing FreeBSD 10.0 typedef of bool on the i386 architecture. Allen Hewes provided a test system. Andrey Chernov provided useful advice. Improved tests/Add2TestDB script with a patch from Peter Schiffer . Added patches from Peter to eliminate Linux gcc warnings. Updated Lsof.8 with improvements supplied by Bjarni Ingi Gislason . Changed FreeBSD global CFLAGS extraction per Terry Kennedy . Also made sure -DNEEDS_BOOL_TYPEDEF is #define'd when the resulting CFLAGS doesn't contain it. Terry reported that need. Improved Linux test for tcp.h in response to a report from Cato Auestad . Cato did the testing. Fixed Linux UNIX socket search by name bug reported by Stephane Chazelas . Added Linux display of UNIX socket endpoint information with code provided by Masatake YAMATO . Peter Schiffer provided a test system. Insured that type definitions from were again made visible to lsof on FreeBSD 11 after a system header file change hid them. 4.90 February 14, 2018 !!!NOTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! It is likely that this is the last lsof revision I ! ! will issue, unless serious bugs are detected, Stay ! ! tuned to lsof-l for information about future support ! ! of lsof. ! ! ! ! I thank all the many contributors to lsof over the ! ! many years (20+?) I have been distributing lsof ! ! versions 1, 2, 3 and 4. ! ! ! ! Vic Abell ! ! ! !!!NOTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Taught the Configure script to create a dummy opt_random.h for FreeBSD systems whose includes it. Added support for the FreeBSD ZFUSE file system. Corrected the quoting in a Darwin putchar() statement in the dfile.c source file. Andrew Janke reported my error. Added support for the FreeBSD DTYPE_PTS file descriptor and for unknown descriptors that reference the kernel's badfileops operation switch. Enabled FreeBSD 12.0 support. Tested the changes on systems provided by Larry Rosenman . Enhanced -K option with the form "-K i" to direct lsof to (i)gnore tasks. A query from Rachel Kroll suggested this option. Linux task reports now include both process and task command names, making lsof's "-c " option work correctly. Added a patch to prevent NFS blocking in Linux supplied by Kristyna Streitova . Installed a FreeBSD patch that prevents examining a TCP state structure during a race condition. The patch was supplied by Bryan Drewery . Updated FreeBSD for new UFS inode structure that lacks an i_dev member in the most recent 12.0-CURRENT. Larry Rosenman reported the problem and provided a test system. Added "#define KLD_MODULE" to dlsof.h and dnode2.c to prevent from generating an "ARM_NARCH is 0" error. This is needed so lsof can access kernel structures. Larry Rosenman supplied the addition. Added recognition of the FreeBSD 11 file system name "nullfs". Jamie Landeg-Jones supplied the fix. Added a patch from Larry Rosenman that is needed on FreeBSD 12 so the lsof compilation can obtain the inpcb and tcpcb structures from their respective header files. Updated FreeBSD dmnt.c for the ino64 changes. Inserted a patch for Solaris 12.x to avoid compilation errors from , based on information provided by Jorn Clausen . Jorn tested the patch. Added performance enhancement that uses the FreeBSD closefrom() and dup2() C library functions when available. The enhancement was supplied by Conrad Meyer . Corrected FreeBSD lsof's gathering of ZFS file device numbers. Updated lsof test library for FreeBSD. Updated socket optons information collection from the socket structure per changes supplied by Gleb Smirnoff . Added patch to dlsof.h that avoids a _KERNEL conflict with bzero. Mateusz Guzik supplied the patch. Corrected test library to handle 64 bit FreeBSD device numbers. Added #defines for FreeBSD 12, src r324225, from Gleb Smirnoff . Incorporated Linux pseudoterminal endpoint processing (+|-E) provided by Masatake YAMATO with access to test systems provided by Peter Schiffer . Corrected Linux command extraction for commands that include parentheses -- e.g., "(sd-pam)". 4.91 March 26, 2018 A bug has been reported in the PTY endpoint processing of Linux lsof 4.90 by Peter Wu , making it necessary for me to release another revision of lsof. This revision applies two fixes that correct the Linux PTY endpoint processing bug. Masatake YAMATO supplied the fixes. 4.92 July 14, 2018 THIS IS A FREEBSD-ONLY DISTRIBUTION! Fixes Configure script section that creates the FreeBSD lockf_owner.h header file; fixes conflicts with FreeBSD kernel header files. Mateusz Gusik supplied part of the fix. Released lsof to GitHub with Purdue releases documented in support/GitHub-release. 4.92.1 May 6, 2019 !!!NOTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! The maintainership is switched from Vic to lsof-org ! ! at GitHub team officially. ! ! We thank Vic for working on lsof over the years. ! ! ! ! lsof-org at GitHub team (https://github.com/lsof-org) ! !!!NOTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! This is just for testing "Release" feature of GitHub. Many documentations are not updated yet. URLs in -v output and -h output are updated. 4.93.0 May 7, 2019 [freebsd] Made FreeBSD 13 adjustment. [darwin] Fix a typo causing a build error. Fix a potential memory leak. [linux] use tirpc for rpc if libc doesn't provide rpc.h. Fix a typo in man page. [linux] fix memory leaks detected by valgrind about unix endpoint information. Update the description about -fg and -fG options on linux. 4.93.1 May 7, 2019 Fix a broken symbolic link. 4.93.2 May 8, 2019 Update the version number embedded in lsof executable. 4.94.0 November 11, 2020 (All changes in this version are ported from lsof-org/lsof-linux repository at GitHub). Introduced a new test harness. The harness can run test cases specific to a dialect. It is designed for running test cases on CI environment like Travis-CI. However, it is runnable locally with following command line: $ ./check.sh DIALECT after making lsof executable. [linux] Fixed a bug +|-E options output for pipe. If two processes use the same fd number for a pipe connecting them, the option didn't print the information about it. [linux] Fixed a bug +|-E options output for PTY. If two processes use the same fd number for a PTY connecting them, the option didn't print the information about it. [linux] Fixed a bug +|-E options output for PTY. The code for detecting a slave device was incorrect. [linux] Fixed a potential bug +|-E options output for PTY. A structure field for the feature was not initialized. [linux] Added a code for decoding O_PATH flag in +fg option. [linux] Added a code for decoding O_CLOEXEC flag as CX in +fg option. [linux] Added a code for decoding O_TMPFILE flag as TMPF in +fg option. [linux] Added Linux display of INET socket endpoint information with +|-E option. The option handles INET sockets using IPC. [linux] Added support for POSIX MQ of Linux implementation. A POSIX message queue (MQ) is represented in a fd on Linux. lsof reported it as a regular file. lsof with this change reports it as a file with PSXMQ type if mqueue file system is mounted. [linux] Added Linux display of POSIX message queue endpoint information with +|-E option. mqueue file system must be mounted to display the information. [linux] Added Linux display of INET6 socket endpoint information with +|-E option. The option handles INET6 sockets using IPC. [FreeBSD] update to include on recent -CURRENT since it is no longer implicitly included via header pollution. [linux] Added Linux display of eventfd endpoint information with +|-E option. The option handles eventfd using IPC. [FreeBSD] include for recent change requiring refcount(9). Enhanced -r option. With `c' specifier, lsof can stop itself when the number of iterations reaches at . [linux] Fixed accessing an uninitialized local variable. Detected by valgrind. [linux] fix a crash when printing the endpoint for unaccepted unix socket with +E option. This closes the github issue #74 reported by @jolmg. [linux] abort execution when failing in memory allocation for socket private data. [linux] decode the name of DCCP socket type. [linux] decode more netlink protocol numbers (RDMA, CRYPTO, and SMC). [linux] print the connection state of unix domain socket Lsof can print the state of TCP socket like: nc 22247 yamato 3u IPv4 471409 0t0 TCP localhost:38802->localhost:9999 (ESTABLISHED) This change exnteds this feature to support unix domain sockets. LISTEN, UNCONNECTED, CONNECTING, CONNECTED, DISCONNECTING, and UNKNOWN can be taken as a state. An example of output: evince 17333 yamato 1u unix 0x0000000054183795 0t0 89141 type=STREAM (CONNECTED) This feature is enabled by default. To turn off printing state information, use -T option. Don't display command usage even when a file (or directory) listed in command line doesn't exist. This closes the github issue #90 reported by @rowlap. [FreeBSD] merge all the FreeBSD specific fixes from the FreeBSD sysutils/lsof port [linux] allow reproducible builds In a reproducible build all varied information is removed. This change does so, by checking if the standard SOURCE_DATE_EPOCH variable is set. If it is, we are attempting a reproducible build and will strip varying information. About the standard, see https://reproducible-builds.org/specs/source-date-epoch/ Provided in github pull request #93 by @T4cC0re. [freebsd] update for r363214 - no user visible changes Added the way to include (or exclude) all numbered file descriptors in -d option. "fd" is a pseudo file descriptor name for the purpose. See the following output on Linux; lsof doesn't print cwd, rtd, txt, and mem files. # ./lsof -p $$ -a -d fd COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME bash 866421 root 0u CHR 136,1 0t0 4 /dev/pts/1 bash 866421 root 1u CHR 136,1 0t0 4 /dev/pts/1 bash 866421 root 2u CHR 136,1 0t0 4 /dev/pts/1 bash 866421 root 255u CHR 136,1 0t0 4 /dev/pts/1 docs: fixed minor grammatical error in instructions in Customize file The change is provided by @hardikpnsp. man page: improve phrasing and add examples The change is provided by Martin D Kealey. man page: improve explanation of -t implying -w The change is provided by Martin D Kealey. test cases, [linux]: fix tests for large inode-numbers (i >= 2^32) The change is provided by Henry Peteet. [linux] handle ffff:ffff in ipv6 addr correctly The listen address and port of an AF_INET6 socket were not display if the socket listened at an ipv6 address including ffff:ffff. Here is a command session demonstrating the bug: # ip -6 addr add abcd:ef10:ffff:ffff:ffff:ffff:ffff:ff62 dev lo # nc -6 -l abcd:ef10:ffff:ffff:ffff:ffff:ffff:ff62 8888 & [1] 6762 # ./lsof -p 6762 -a -d fd -P -n COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nc 6762 yamato 0u CHR 136,6 0t0 9 /dev/pts/6 nc 6762 yamato 1u CHR 136,6 0t0 9 /dev/pts/6 nc 6762 yamato 2u CHR 136,6 0t0 9 /dev/pts/6 nc 6762 yamato 3u sock 0,9 0t0 5833594 protocol: TCPv6 The last line should be: nc 6762 yamato 3u IPv6 5833594 0t0 TCP [abcd:ef10:ffff:ffff:ffff:ffff:ffff:ff62]:8888 (LISTEN) The original code decoding an ipv6 address uses UINT32_MAX constant incorrect way. @zhrf2020 reported this bug in #102. @zhrf2020 provided the initial version of fix, #109. man page,[linux]: enumerate abbreviated flags printed with '+f g' option Make -Fo option work -Fo option is for printing file offset. For regular files, the option didn't work. Here is a command session demonstrating the fix: # ./lsof -Fo -o0| grep ^o | sort | uniq -c 90586 o0t0 87 o0t101 84 o0t103 ... @JustAnotherArchivist reported this bug in #118. man page: fix definition of the `o` field on programmatic output The change is provided by @JustAnotherArchivist who reported the original issue in #118. [linux]: show the pid monitored by a pidfd With this change, lsof prints pidfd in the following form: [pidfd:%d] where %d represents the pid monitored by the pidfd. Example output: # ./lsof -p 12573 -p 12710 | grep pidfd dbus-brok 12573 jet 11u a_inode 0,13 0 13312 [pidfd:12575] dbus-brok 12710 jet 10u a_inode 0,13 0 13312 [pidfd:12711] fd 11 of pid 12573 monitors pid 12575. fd 10 of pid 12710 monitors pid 12711. This change closed #116. Don't select the file descriptor field by default. The version 4.88 introduced the change for selecting the file descriptor field by default. However, the change is not suitable for users who wants to print only PID field. @po5857 suggests the use case and the way to improve the man page. [linux]: enumerate fds monitored by an eventpoll fd With this change, lsof prints an eventpoll fd in the following form: [eventpoll:,,...,...] Here fdX is a file descriptor monitored by the eventpoll fd. If an eventpoll fd monitors too many file descriptors, lsof truncates the list of fds. "..." at the end of list implies the truncation. Example output: # sudo ./lsof -p 1 -a -d 10,11,12 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME systemd 1 root 10u a_inode 0,13 0 11624 [eventpoll:11,12] systemd 1 root 11r REG 0,4 0 17680 /proc/1/mountinfo systemd 1 root 12r a_inode 0,13 0 11624 inotify systemd monitors fd 11 and fd 12 via eventpoll fd 10. [linux]: implement "make check" The target runs check.bash. 4.95.0 April 28, 2022 [n+obsd] fix syntax error Corrected end of comment. This change closes #138. @albert-github reported this issue in #138, and provided the fix in #140 Don't ignore failures in test/Makefile Tobias Geerinckx-Rice provides the fix. Update perl scripts for the past few decades of progress Generally, perl is available on base systems - people who are manually installing perl into /usr/local/bin are the exception rather than the rule. In addition, Perl 5 was release in 1994, so Perl 4 isn't relevant any more. We've also standardized on the .pl extension, rather than .perl5 or whatever. Provided by @dilinger (Andres Salomon) in #149. A commit in the pull request includes work of Nicholas Bamber. Drop LSOF_CCDATE across all dialects to ensure reproducible builds Simplify things for reproducible builds by just getting rid of the embedded date/time string. With LSOF_CCDATE gone, keeping SOURCE_DATE_EPOCH around doesn't make much sense, so drop that as well. Folks doing reproducible builds should still override the LSOF_HOST, LSOF_LOGNAME, LSOF_SYSINFO, and LSOF_USER variables (as they were previously doing before SOURCE_DATE_EPOCH). Provided by @dilinger (Andres Salomon) in #150. [FreeBSD] get the ISO9660 filesystem working again The ISO9660 filesystem broke starting with FreeBSD 7 due to the header location changing. Fix the header search path to get it to be detected again. Fix the header inclusion order. Also add the new way of finding dev_t on more recent FreeBSD versions. Provided by Damjan Jovanovic in #151. [FreeBSD] add support for msdosfs on FreeBSD Provided by Damjan Jovanovic in #151. Fix FD field description. In 811dc78 the output format was changed to not printf the `f` field by default, however the field description in `lsof_fields.h`, as seen in `-F?` output still included the `(always selected)` text. Provided by @algorythmic (Grisha Levit) in #158. Adjust alignment of buffer passed to stat(). The original code passes char[] buffer to stat(). This can be cause a SIGBUS. #160 reported an actual crash on armv7a + glibc-2.33 platform. See also https://sourceware.org/bugzilla/show_bug.cgi?id=27993. Reported by @10ne1 in #160. Clean up source code and documentats. - remove trailing whitespace, - fix some issues in scripts found through shellcheck, and - fix spelling Provided by @a1346054 in #163. man page: fix hyphen issues Properly use '-' and '\-' in the man page, ensuring that users can cut & paste commandline options without issue. Original patch from Raoul Gunnar Borenius , and submitted/expanded by @dilinger (Andres Salomon) in #168. [FreeBSD] update for FreeBSD 13 & 14, and various internal changes submitted by @DmitryAndric & @emaste. [FreeBSD] remove various old FreeBSD versions from support submitted by @emaste [FreeBSD] configure: suggest variable to set if FreeBSD sys not found submitted by @emaste [FreeBSD] Use user mode APIs on FreeBSD Extensively changes the FreeBSD dialect to use user mode APIs (sysctls and libutil's kinfo_getfile()), only falling back to kvm access when it's available and required for certain features. lsof can now run as an ordinary user, though not all processes may be visible and some features will be absent without kvm access (file lock state, kqueue info, some pipe details, nullfs details). This also fixes numerous long standing issues: file lock state is now visible on all filesystems, the cwd, root dir, jail dir, text file and controlling TTY are now visible, filenames are shown for all filesystems, procfs is working again and supports file searches even when there are multiple procfs mountpoints, the code is shorter, cleaner and should need much less future maintenance. It builds and works from FreeBSD 9.0 to 14-CURRENT, though older versions have less features (eg. 12 doesn't provide socket buffer usage, 11 also lacks TCP flags and state). Provided by @DamjanJovanovic in #184. Fix broken LSOF_CFLAGS_OVERRIDE. Provided by Fabrice Fontaine in #172. [linux] Remove sysvlegacy function. Provided by Fabrice Fontaine in #195. [linux] use close_range instead of calling close repeatedly At the starting up, lsof closes its file descriptors greater than 2 by calling close(2) repeatedly. As reported in #186, it can take long time. Linux 5.9 introduced close_range(2). The new system call can close multiple file descriptors faster. @qianzhangyl reported the original issue (#186). Add -Q option for adjusting exit status when failed to find a search item (#129) In the original code, lsof returned 1 when it failed to find a search item. With the new option, lsof returns 0 in the case. Document -Q option in manpage/00QUICKSTART, and adjust -h output by @dilinger (Andres Salomon) in #129. Improve readability of complex adverbial clause by adding a comma. Provided by Danny Fowler in #156. 4.96.0 September 16, 2022 [linux] fix hash functions used for finding local tcp/udp IPCs There were typos in the code calculating hash values. The typos might break the flatness of hashtables where the endpoint information about locally used tcp/udp was stored. Theoretically, this fix may improve the performance of lsof with [+|-]E option. Inspired by the issue #206 reported by Tomasz Kłoczko (@kloczek). Show copyright notice in --version output. [linux] compile with -Wall option [linux] Avoid some easy collissions for udp/udp6 sockets when hashing [linux] Changing the number of ipcbuckets to 4096 [darwin] fix build with -fno-common (Cfp redefinition) gcc-10 and llvm-11 changed the default from -fcommon to -fno-common: https://gcc.gnu.org/PR85678 As a result build fails as: duplicate symbol '_Cfp' in: ddev.o dfile.o Cfp is already explicitly defined in dstore.c. The change turns header definition into declaration. Provided by Sergei Trofimovich (@trofi) in #221. The same fix is applied to libproc backend by Jiajie Chen (@jiegec) in #226. [linux] Make build reproducible by checking SOURCE_DATE_EPOCH and considering LSOF_{HOST,LOGNAME,SYSINFO,USER} as "none" when it is set. Provided by Danilo Spinella in #217 [darwin] remove /usr/include prefix from include for Darwin 19+ The /usr/include path is missing since macOS Catalina. Fixes issue #234. Provided by Jiajie Chen in #235 [linux] obtain correct information of memory-mapped file. Provided by Teng Hu in #239 [FreeBSD] configure: suggest variable to set if FreeBSD sys not found Submitted by @emaste Updated 00FAQ with lookup to open files via mountpoint Provided by Jacob Chapman in #240 [FreeBSD] modernize API usage and remove legacy FreeBSD releases Contributor DamjanJovanovic (#184) Ed Maste (#250, #251, #252), Warner Losh (#253) 4.96.1 September 16, 2022 [FreeBSD] Unconditionally define HASKQUEUE (mjguzik) 4.96.2 September 16, 2022 [FreeBSD] fix FreeBSD < 14 4.96.3 September 16, 2022 [FreeBSD] Fix kqueue compat for releases < 14 4.96.4 October 18, 2022 [FreeBSD] sys/files.h no longer needs _KERNEL defined to include it (bsdimp #256) docs: Describe fd number truncation in output (#261) 4.96.5 December 26, 2022 [linux] Use correct scanf/printf format for uint64_t (#266) Avoid C89-only constructs in Configure (#265) [freebsd] add for recent changes 4.97.0 January 17, 2023 [decof/du/tru64] Remove support because the os is no longer updated for more than 10 years [openstep/nextstep] Remove support because the os is no longer updated for more than 20 years Add experimental build system based on Autotools (#270) Fixed LTsock testing on darwin (#272) Remove NEW and OLD folders (#6) Fix FreeBSD testcases (#271) Rewrite documentation and publish at https://lsof.readthedocs.io/ 4.98.0 January 22, 2023 Fix two potential null pointer access bug when gethostbyname2() returns an empty address list Add support for older automake versions (on e.g. CentOS 7) Migrate testing scripts and programs to autotools Extend CI to build on more Linux distros [linux] Fix handling of empty command name, closing #246. Add test from #246, where lsof returns stale command name when the command name is empty. If getting command name failed, return NULL instead of empty string Add --with/without-libtirpc option to autotools-based build system and automatically detect libtirpc by default Add -H switch to print human readable size, e.g. 123.4K (#260) [linux] Fix implicit declaration error when HASPTYEPT is undefined Add support for musl libc-based Linux distros Add --enable-security argument to configure to allow only the root user to list all open files Add --enable-no-sock-security argument to configure to allow anyone to list anyone else's socket files when combined with --enable-security [linux] Always enable 64 bit off_t in configure.ac [netbsd] Import patches from pkgsrc and port autotools-based build system to NetBSD [netbsd] Fix lock status reading 4.99.0 November 10, 2023 [netbsd] Get device number of tmpfs instead of reporting zero [openbsd] Rewrite OpenBSD support because OpenBSD disallows kernel memory access and lsof has to switch to user mode API. Currently, most features are working, but file path reporting and lock status are not working for lack of kernel support. As a consequence, OpenBSD dialect is separated in a new folder. [darwin] Remove /dev/kmem backend because it no longer exists on current macOS releases. Use libproc backend instead. [linux] Do not hard-code fd numbers in epoll test, fixing tests on Void Linux [freebsd] Use kf_file_nlink if provided by kernel instead of stat(). This commit requires kernel with https://reviews.freebsd.org/D38169. It brings back the ability to list deleted files via `lsof +L1`. Closes #264. [linux] Add --with-selinux configure option. [solaris] Re-introduce support for recent Solaris & OpenIndiana releases. [darwin] Display kern ctl info, learned from apple lsof version. [linux] Improve performance by using closefrom(). Closes #281. [aix] Fix compilation on AIX 7.2 and add autotools build system support for AIX. [aix] Suppress warnings properly on AIX version greater than 5.0. Closes #187. Introduce alpha version of liblsof which allows users to use lsof functionality via C functions instead of spawning a subprocess and parsing the output. This version may contain BUGs and memory leaks, and the API may change before it stablizes. 4.99.1 December 16, 2023 Fix compilation error when HASIPv6 is not defined. (@chenrui333) Add configure option --disable-liblsof to disable installation of liblsof. (@subnut, #300) [freebsd] fix segfault from fs info (FreeBSD bug 267760) 4.99.2 December 16, 2023 fix version file 4.99.3 December 16, 2023 fix 00DIST file -> tabs 4.99.4 November 18, 2024 fix version parser for clang (lsof-org#305) (#306) In lsof manapge: mention /etc/services for -P option (#309) [freebsd] don't use kf_sock_inpcb on modern versions. In FreeBSD 14 and after the generic internet protocol control block and protocol specific (TCP) control block are the same pointer. The latter embeds the former. The kf_sock_inpcb is planned for removal in FreeBSD 15. [freebsd] Recognize FreeBSD 15 Fix typos in docs (#314) [linux] Do not embed kernel version in CFLAGS (#314) [linux] Linux 6.9 changed the pidfs appearence in procfs. Try to maintain original output in lsof (#317) [linux] closefrom_shim: Add optimized fallback for platforms without closefrom or close_range (#316) lib/misc.c: fix build against -std=c23 (`void (*)()`) changed the meaning) (#327) 4.9?.? ????????? ??, ???? Vic Abell July 14, 2018 The lsof-org team at GitHub December 28, 2022