Home | History | Annotate | only in /src/usr.bin/fstat
History log of /src/usr.bin/fstat
RevisionDateAuthorComments
 1.28 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.27 19-Jun-2022  simonb Add basic ZFS support to fstat(1).
XXX: Use a local zfs_znode.h for a znode_t definition because the ZFS
kernel code makes it too hard to include headers from userland.
 1.26 13-Oct-2019  mrg introduce some common variables for use in GCC warning disables:

GCC_NO_FORMAT_TRUNCATION -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints. many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
 1.25 23-Dec-2016  mrg branches: 1.25.14;
for 64 bit mips platforms where we built userland largely as n32 by
default, build a handful of tools as n64 so they work properly.

unfortunately, they're also static as dynamic n64 has a problem.

of these tools pstat is probably the lowest hanging fruit to convert
to sysctl. systat would be close were it not for the netstat screen,
which includes netstat itself.

the rest are difficult to perhaps foolish.


the upside is that netstat, pmap and fstat all work properly now.
 1.24 23-Jan-2016  christos branches: 1.24.2;
put _KMEMUSER in the Makefile
 1.23 10-Sep-2011  christos add libutil.
 1.22 14-Apr-2009  lukem Enable WARNS=4 by default for usr.bin, except for:
awk bdes checknr compile_et error gss hxtool kgetcred kinit
klist ldd less lex locale login m4 man menuc mk_cmds
mklocale msgc openssl rpcgen rpcinfo sdiff spell ssh
string2key telnet tn3270 verify_krb5_conf xlint
 1.21 22-Jul-2008  christos branches: 1.21.6;
a better attempt on printing dtype_misc
 1.20 28-May-2007  tls branches: 1.20.12;
Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry. RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros. Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default. Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
 1.19 10-Feb-2006  christos PR/32788: KAMADA Ken'ichi: add support for tmpfs
 1.18 17-Jul-2005  christos WARNS=3, knf, ansi prototypes
 1.17 10-Jan-2005  lukem Only compile in IPv6 support if ${USE_INET6} != "no"

MKINET6 is for providing IPv6 infrastructure.
USE_INET6 is for compiling IPv6 support into the programs (needs MKINET6).
 1.16 12-Dec-2004  christos Add ptyfs.
 1.15 17-Jan-2000  itojun IPv6 support.
NetBSD PR: 9199 (with minor changes)
 1.14 12-Sep-1999  chs the PMAP_NEW option is gone as the new interface is no longer optional.
 1.13 02-Aug-1999  jdolecek add support for ntfs
 1.12 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.11 18-Feb-1999  lukem as suggested by chuck cranor, pull in some openbsd mods:
* display ip address details of tcp/udp connections
* display isofs details
* use %p instead of %lx in error messages

other mods by me:
* don't put \n at the end of err()/warn() format
* man page cleanups (use .Dq and .Pq as appropriate)
 1.10 04-Mar-1998  mycroft fstat(1) also depends on UVM and PMAP_NEW.
 1.9 09-Jan-1997  tls RCS ID police
 1.8 03-Aug-1994  deraadt do not need -I/sys
 1.7 13-Jun-1994  mycroft Merge local changes.
 1.6 20-May-1994  pk Aid cross-compiling, like iostat
 1.5 09-May-1994  cgd clean up import
 1.4 28-Jan-1994  cgd needs -lkvm, not -lutil
 1.3 31-Jul-1993  mycroft Add RCS indentifiers.
 1.2 17-Jun-1993  mycroft Don't need -I/sys. (Why was it here?)
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 09-May-1994  cgd new fstat
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.20.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.21.6.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.24.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.25.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.36 06-Sep-2019  wiz Use \(em.
 1.35 06-Sep-2019  christos Add -O to print offsets; align columns properly.
 1.34 03-Jul-2017  wiz branches: 1.34.6;
Remove workaround for ancient HTML generation code.
 1.33 15-Dec-2013  wiz Sort SYNOPSIS and option descriptions. Bump date for previous.
 1.32 15-Dec-2013  mlelstv New -A option. Add an output column with the address of the
kernel object (vnode or file) that can be matched with prstat(8) output.
 1.31 03-Oct-2012  wiz - In the example for `-f', reference a directory that is actually
available in a default installation (/usr/src isn't);
- put together two lines which belong to the same sentence;
- remove a spurious space character;
- remove unneeded consecutive argument for `.Nm' macro.

From Bug Hunting.
 1.30 08-Oct-2011  jnemeth branches: 1.30.2; 1.30.8;
add an xref to fstat(2)
 1.29 06-Sep-2011  wiz Remove trailing whitespace and use Sx for section crossreference.
 1.28 06-Sep-2011  christos move UNIX socket mention in the BUGS section.
 1.27 05-Sep-2011  wiz Remove duplicate RCS Id and split file system.
 1.26 03-Sep-2011  christos Mention that fstat -f will not list open unix sockets on that filesystem.
 1.25 04-Jan-2009  wiz Sockets: Do not mention printing flags, because they are not printed.
From Stephan A. Rickauer via jmc@openbsd.

Bump date.
 1.24 29-Jul-2006  hubertf Xref sockstat(1)
 1.23 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.22 07-Nov-2002  enami - file ... instead of filename ...
- "An asterisk (``*'')" instead of "A (``*'')" to be more consistient with
rest of this manpage.
- Fix typo; ``w'' instead of ``''.
- There is no section named Sockets. There is only SOCKETS.
 1.21 30-Sep-2002  grant New sentence, new line.
 1.20 08-Feb-2002  ross Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.19 07-Feb-2002  ross Edit -mdoc usage.

* There is no -indent option to .Bd or .Bl, although you would
never know that from its frequent use in this tree. There is a
"-offset indent" combination that makes sense, and you can certainly
say "-width indent".

* Also, you can't markup the -width option argument, tho you CAN
use a callable macro. So "-width Ar filename" doesn't make sense,
but either "-width Ar" or "-width filename" does, as might something
like "-width xxfilename" for a little extra space.

* There are a lot of needlessly complex hanging tag macros in man4 used
to create simple item lists. Those should be simplified one of these
days before someone copies and edits yet another man4 page.
 1.18 01-Dec-2001  wiz Punctuation nit, sort sections.
 1.17 06-May-2001  wiz Change xref for vmstat(8) to vmstat(1).
Whitespace, punctuation and spelling fixes while I'm here.
 1.16 19-Nov-1999  kristerw Typos (from OpenBSD)
 1.15 15-Nov-1999  sommerfeld Improve summary line so jhawk can find this command using apropos
 1.14 22-Mar-1999  garbled branches: 1.14.6;
More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Many more to
come.
 1.13 16-Mar-1999  kleink Fix Xref; from Geoff C. Wing in PR bin/7166.
 1.12 18-Feb-1999  lukem as suggested by chuck cranor, pull in some openbsd mods:
* display ip address details of tcp/udp connections
* display isofs details
* use %p instead of %lx in error messages

other mods by me:
* don't put \n at the end of err()/warn() format
* man page cleanups (use .Dq and .Pq as appropriate)
 1.11 28-Apr-1998  fair Change occurrences of "UNIX" to .Ux or .At as appropriate.
 1.10 18-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register
 1.9 09-Jan-1997  tls RCS ID police
 1.8 27-Sep-1995  jtc vmstat is in section 8; PR #1532
 1.7 06-Aug-1994  jtc vmunix -> netbsd (PR #375)
 1.6 13-Jun-1994  mycroft branches: 1.6.2;
Merge local changes.
 1.5 09-May-1994  cgd clean up import
 1.4 03-Feb-1994  jtc vmunix -> netbsd
 1.3 11-Jan-1994  jtc Fix spelling errors.
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 09-May-1994  cgd new fstat
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.6.2.1 06-Aug-1994  mycroft update from trunk
 1.14.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.30.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.30.8.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.30.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.30.2.1 30-Oct-2012  yamt sync with head
 1.34.6.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.120 02-Nov-2023  martin Back out the following revisions on behalf of core:

sys/sys/lwp.h: revision 1.228
sys/sys/pipe.h: revision 1.40
sys/kern/uipc_socket.c: revision 1.306
sys/kern/kern_sleepq.c: revision 1.84
sys/rump/librump/rumpkern/locks_up.c: revision 1.13
sys/kern/sys_pipe.c: revision 1.165
usr.bin/fstat/fstat.c: revision 1.119
sys/rump/librump/rumpkern/locks.c: revision 1.87
sys/ddb/db_xxx.c: revision 1.78
sys/ddb/db_command.c: revision 1.187
sys/sys/condvar.h: revision 1.18
sys/ddb/db_interface.h: revision 1.42
sys/sys/socketvar.h: revision 1.166
sys/kern/uipc_syscalls.c: revision 1.209
sys/kern/kern_condvar.c: revision 1.60

Add cv_fdrestart() [...]
Use cv_fdrestart() to implement fo_restart.
Simplify/streamline pipes a little bit [...]

This changes have caused regressions and need to be debugged.
The cv_fdrestart() addition needs more discussion.
 1.119 13-Oct-2023  ad Simplify/streamline pipes a little bit:

- Allocate only one struct pipe not two (no need to be bidirectional here).
- Then use f_flag (FREAD/FWRITE) to figure out what to do in the fileops.
- Never wake the other side or acquire long-term (I/O) lock unless needed.
- Whenever possible, defer wakeups until after locks have been released.
- Do some things locklessly in pipe_ioctl() and pipe_poll().

Some notable results:

- -30% latency on a 486DX2/66 doing 1 byte ping-pong within a single process.
- 2.5x less lock contention during "make cleandir" of src on a 48 CPU machine.
- 1.5x bandwith with 1kB messages on the same 48 CPU machine (8kB: same b/w).
 1.118 10-Jul-2023  christos Add memfd_create(2) from GSoC 2023 by Theodore Preduta
 1.117 28-Oct-2022  ozaki-r Adjust userland commands for struct inpcb separation

Only kvm users are affected.
 1.116 28-Oct-2022  ozaki-r Adjust userland commands for struct inpcb integration

Only kvm users are affected.
 1.115 19-Jun-2022  simonb Add basic ZFS support to fstat(1).
XXX: Use a local zfs_znode.h for a znode_t definition because the ZFS
kernel code makes it too hard to include headers from userland.
 1.114 26-Aug-2020  christos Provide a helpful error message if we don't have privs to read kernel
addresses.
 1.113 06-Sep-2019  christos Add -O to print offsets; align columns properly.
 1.112 03-Feb-2019  mrg - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
this case, and thus can't be marked __dead easily
 1.111 30-Dec-2016  christos branches: 1.111.14;
Print the interface for bpf.
 1.110 22-Dec-2015  christos branches: 1.110.2;
print the tag symbolically if we don't support it.
 1.109 08-Mar-2015  mlelstv Resolve names of datagram services correctly.
 1.108 14-Feb-2014  christos fix protocol printing order.
 1.107 17-Jan-2014  christos make fstat -f search for unix sockets.
 1.106 15-Dec-2013  mlelstv Fix output for -A -f ...
 1.105 15-Dec-2013  wiz sync usage with man page
 1.104 15-Dec-2013  mlelstv New -A option. Add an output column with the address of the
kernel object (vnode or file) that can be matched with prstat(8) output.
 1.103 19-Oct-2013  christos use correct function and symbolic constants
 1.102 19-Oct-2013  christos use new scopeid functions
 1.101 18-Oct-2013  christos avoid pointer gymnastics
 1.100 25-Nov-2012  christos - add more debugging.
- in misctrans() we need the file index not the file type.
 1.99 19-Oct-2012  christos print major device numbers symbolically from kinfo_drivers
 1.98 19-Oct-2012  christos more info for unix sockets. XXX: chroot handling
 1.97 26-Sep-2012  christos fix non-numeric address and port printing.
 1.96 24-Mar-2012  christos branches: 1.96.2;
byte swap the inet6 ports.
 1.95 09-Oct-2011  chs branches: 1.95.2; 1.95.4;
fix rdev reporting for UFS2 and ext2fs.
 1.94 23-Sep-2011  mrg apply some (uintptr_t) so that printing printers works on i386 (likely
all 32 bit.)
 1.93 22-Sep-2011  christos - factor out common code in the inet and inet6 printing.
- add appletalk (ddp) support.
 1.92 10-Sep-2011  christos - remove bogus casts
- print recycled vnode flags
 1.91 03-Sep-2011  christos - minor KNF
- for system processes (0, 1) where fd_lastfile == -1, fail early.
- instead of printing the pcb connection address, print the pathname if
possible for unix domain sockets.
 1.90 14-Apr-2011  rmind Add DTYPE_SEM.
 1.89 24-May-2009  ad More changes to improve kern_descrip.c.

- Avoid atomics in more places.
- Remove the per-descriptor mutex, and just use filedesc_t::fd_lock.
It was only being used to synchronize close, and in any case we needed
to take fd_lock to free the descriptor slot.
- Optimize certain paths for the <NDFDFILE case.
- Sprinkle more comments and assertions.
- Cache more stuff in filedesc_t.
- Fix numerous minor bugs spotted along the way.
- Restructure how the open files array is maintained, for clarity and so
that we can eliminate the membar_consumer() call in fd_getfile(). This is
mostly syntactic sugar; the main functional change is that fd_nfiles now
lives alongside the open file array.

Some measurements with libmicro:

- simple file syscalls are like close() are between 1 to 10% faster.
- some nice improvements, e.g. poll(1000) which is ~50% faster.
 1.88 12-Apr-2009  lukem Fix sign-compare issues.
 1.87 29-Dec-2008  christos branches: 1.87.2;
64 bit dev_t
 1.86 09-Sep-2008  gmcgarry Cast f_type to signed integer before comparison with negative values.
 1.85 23-Jul-2008  lukem Add back rev 1.83. (hi christos!)
 1.84 22-Jul-2008  christos a better attempt on printing dtype_misc
 1.83 21-Jul-2008  lukem Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
 1.82 04-Apr-2008  christos branches: 1.82.4;
handle NULL better.
 1.81 04-Apr-2008  christos elementary handling for different types of DTYPE_FOO.
XXX: DTYPE_CRYPTO is unused.
XXX: should we change fd_clone() to pass a DTYPE_FOO?
 1.80 04-Apr-2008  christos catch up with struct filedesc changes.
 1.79 23-Mar-2008  he Please repeat after me: I shall not define _KERNEL before including
<sys/types.h> in user-land programs. Doing so causes build problems
for lots of our ports due to differences in how <sys/bswap.h> ends up
defining the swap functions/macros.
 1.78 22-Mar-2008  ad Catch up with recent file descriptor changes.
 1.77 15-Dec-2007  perry convert __attribute__s to applicable cdefs.h macros
 1.76 09-Sep-2007  dyoung Bug fix: filed.fd_ofiles is always a pointer to the open files
table, so always read the table from kernel virtual memory at that
address. Do not ever try to read the table from filed0.fd_dfiles,
because it just isn't necessary, and sometimes we read a stale
table from there.
 1.75 11-May-2006  yamt branches: 1.75.12;
tweak for user.h cleanup.
while i'm here, remove unnecessary #include.
 1.74 11-May-2006  mrg maxfiles -> fstat_maxfiles. (this _KERNEL definition code needs to not
clash with kernel headers....)
 1.73 10-Feb-2006  christos PR/32788: KAMADA Ken'ichi: add support for tmpfs
 1.72 17-Jul-2005  christos WARNS=3, knf, ansi prototypes
 1.71 14-Dec-2004  atatat Cast fst.fileid to unsigned long and print it as such. Inode numbers
are never negative.
 1.70 12-Dec-2004  christos Add ptyfs.
 1.69 16-Nov-2004  itojun NI_WITHSCOPEID was not picked up by IETF standardization process.
 1.68 30-Oct-2004  dsl Add (unsigned char) cast to ctype functions
 1.67 21-Apr-2004  christos Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
 1.66 02-Apr-2004  aymeric fix the way the ext2fs-specific size and mode variables are fetched:
they are indirectly gotten from kernel memory and as such should be read
with KVM_READ.
This fixes fstat core dumps when some process holds a reference in a Linux
ext2fs filesystem.
Thanks to Aleksy Schubert (alx.at.mimuw.dot.edu.dot.pl) for debugging this
with me.
 1.65 21-Oct-2003  fvdl branches: 1.65.2;
Don't compare integers and NULL.
 1.64 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.63 15-Jul-2003  itojun use bounded string op
 1.62 02-Apr-2003  fvdl Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.
 1.61 02-Feb-2003  christos undo mallocvar.h changes!
 1.60 01-Feb-2003  tron Include "sys/mallocvar.h" with "_KERNEL" defined in time to avoid
build failure because MALLOC_DECLARE() is not defined.
 1.59 20-Jan-2003  martin Make it compile again on LP64 archs.
XXX - we *realy* need some format string macros for size_t/off_t!
 1.58 19-Jan-2003  dsl Use kvm_getprocs2 so independant of kernel version
(change aggreed by christos)
 1.57 26-Oct-2002  yamt add VT_LFS case.
 1.56 23-Oct-2002  jdolecek merge rev. 1.50.2.1 (made by lukem):
rudimentary support for for displaying DTYPE_KQUEUE fds
 1.55 12-Feb-2002  simonb Add an extra column for inode numbers, and pull back the mode field to
just 5 columns if in "numeric" mode. Other fields should dynamically
resize, but not today...
 1.54 25-Nov-2001  jdolecek for (new)pipes, print 'n' if it's in nonblocking mode, and 'a' if it's
set to async
 1.53 26-Oct-2001  lukem remove #include <ufs/ufs/quota.h> where it was just to appease
<ufs/ufs/inode.h>, since the latter now includes the former. leave the former
in source that obviously uses specific bits of it (for completeness.)
 1.52 28-Sep-2001  jdolecek remove accidentaly left debug printf

change the pipe descriptor output to include 'r' or 'w' to explicitly
indicate it's open for reading or writing, similarily to "regular" descriptors
 1.51 28-Sep-2001  jdolecek the descriptor flags may also contain other stuff besides FWRITE|FREAD,
so do '& FWRITE' instead of '== FWRITE' in the check in pipe-related code
 1.50 08-Jul-2001  jdolecek branches: 1.50.2;
fix comment
 1.49 19-Jun-2001  wiz `accessible' only has one `a'.
 1.48 17-Jun-2001  lukem convert if ... else if ... tree to a switch
 1.47 16-Jun-2001  jdolecek Add support for DTYPE_PIPE pipes (a.k.a NEW_PIPE)
 1.46 05-Jun-2001  mrg don't #define _LKM to work around header lossage; it is no longer necessary.
 1.45 04-Jan-2001  lukem use %ll_ instead of the less standard %q_
 1.44 14-Aug-2000  enami Redo previous a bit different way so that mount point of top layer is shown
instead of lowest one and ``fstat file-on-upperlayer'' works.
 1.43 14-Aug-2000  enami Print lower vnode if vnode is on a layered filesystem.
 1.42 27-May-2000  sommerfeld branches: 1.42.4;
Bring into line with recent ktrace changes
 1.41 04-Feb-2000  jdolecek add support for msdosfs
 1.40 04-Feb-2000  jdolecek move the mapping of vnode type to file type to separate function getftype()
and use it where appropriate
 1.39 04-Feb-2000  jdolecek fix typo
 1.38 17-Jan-2000  itojun IPv6 support.
NetBSD PR: 9199 (with minor changes)
 1.37 02-Aug-1999  jdolecek add support for ntfs
 1.36 08-Jul-1999  tron Define "_LKM" before including kernel includes with "_KERNEL" defined
so that "opt_ffs.h" gets skipped.
 1.35 02-May-1999  thorpej Adjust for cwdinfo changes.
 1.34 18-Feb-1999  lukem as suggested by chuck cranor, pull in some openbsd mods:
* display ip address details of tcp/udp connections
* display isofs details
* use %p instead of %lx in error messages

other mods by me:
* don't put \n at the end of err()/warn() format
* man page cleanups (use .Dq and .Pq as appropriate)
 1.33 28-Jul-1998  mycroft const propagation.
 1.32 28-Jul-1998  mycroft const propagation.
 1.31 18-Jul-1998  lukem use AF_LOCAL instead of AF_UNIX
 1.30 16-Jul-1998  ross Fix LP64 problems from (5!) July deltas.
 1.29 06-Jul-1998  fair one more thing...
 1.28 06-Jul-1998  fair convert the remainder of the fprintf() to {err,warn}{,x}()
 1.27 06-Jul-1998  fair fix build error - forgot to #include <err.h> for errx()
 1.26 06-Jul-1998  mrg - change setgid kmem programs (that lend themselves to this) so setegid(getgid())
and the top, and then set the effective gid back to kmem around the call to
kvm_openfiles(). this reduces the time group kmem is available.
- for those above that also allow this, setgid(getgid()) after the call to
kvm_openfiles() to fully revoke priviledges.
- some KNF
- use err(3) over fprintf(3) in some places
 1.25 03-Jul-1998  msaitoh check return value of kvm_read() more safe
 1.24 20-Oct-1997  thorpej Update for changes to how nfsnode attributes are stored.
 1.23 18-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register
 1.22 18-Oct-1997  lukem getopt returns -1 not EOF
 1.21 18-Oct-1997  mrg merge lite-2.
 1.20 12-Jun-1997  bouyer Make this compile again, and add support for ext2fs.
Also 2 ufs->ffs conversions in pstat.8.
 1.19 03-Mar-1997  explorer Add a double quote to make emacs's color mode happy...
 1.18 11-Feb-1997  mrg remove dangerous sprintf and strcpy calls.
 1.17 09-Jan-1997  tls RCS ID police
 1.16 05-May-1996  mhitch Change -N and -M option string to specify the options have an argument.
Fixes PR#2374.
 1.15 20-Feb-1996  fvdl Fix NFS include files; sync with Lite2
 1.14 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.13 15-Feb-1995  mycroft Check for bogus file descriptor tables.
 1.12 24-Dec-1994  cgd type sanity
 1.11 13-Jun-1994  mycroft Merge local changes.
 1.10 13-Jun-1994  cgd include file fix
 1.9 09-May-1994  cgd get it to work with old private data allocation
 1.8 09-May-1994  cgd clean up import
 1.7 05-May-1994  cgd update for changed flags
 1.6 26-Oct-1993  cgd Fixed multiple off-by-one bugs which caused the open file printing to
not print the last open file. patch from David Greenman
<davidg@implode.rain.com>.
 1.5 01-Aug-1993  mycroft Add RCS identifiers.
 1.4 20-May-1993  cgd don't explicitly include select.h, but keep header cleanup
 1.3 20-May-1993  cgd fix for new select stuff
 1.2 11-Apr-1993  cgd NFS not properly defined. glass gets another point.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.3 01-Sep-1995  jtc imported from 44lite2
 1.1.1.2 09-May-1994  cgd new fstat
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.42.4.2 13-Feb-2002  he Pull up revision 1.55 (requested by simonb):
Add an extra column for inode numbers, and pull back the mode field
to just 5 columns if in "numeric" mode.
 1.42.4.1 02-Oct-2000  enami Pullup rev. 1.43 and 1.44. This makes fstat works with layered filesystem
and fixes PR#11113. Approved by thorpej.
 1.50.2.1 10-Jul-2001  lukem add rudimentary support for displaying DTYPE_KQUEUE fds
 1.65.2.1 02-Apr-2004  tron Pull up revision 1.66 (requested by aymeric in ticket #50):
fix the way the ext2fs-specific size and mode variables are fetched:
they are indirectly gotten from kernel memory and as such should be read
with KVM_READ.
This fixes fstat core dumps when some process holds a reference in a Linux
ext2fs filesystem.
Thanks to Aleksy Schubert (alx.at.mimuw.dot.edu.dot.pl) for debugging this
with me.
 1.75.12.2 09-Jan-2008  matt sync with HEAD
 1.75.12.1 06-Nov-2007  matt sync with HEAD
 1.82.4.2 24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.82.4.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.87.2.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.95.4.1 02-Apr-2012  riz Pull up following revision(s) (requested by 143 in ticket #christos):
usr.bin/fstat/fstat.c: revision 1.96
byte swap the inet6 ports.
 1.95.2.4 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.95.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.95.2.2 30-Oct-2012  yamt sync with head
 1.95.2.1 17-Apr-2012  yamt sync with head
 1.96.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.96.2.2 25-Feb-2013  tls resync with head
 1.96.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.110.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.111.14.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.111.14.1 10-Jun-2019  christos Sync with HEAD
 1.11 19-Jun-2022  simonb Add basic ZFS support to fstat(1).
XXX: Use a local zfs_znode.h for a znode_t definition because the ZFS
kernel code makes it too hard to include headers from userland.
 1.10 06-Sep-2019  christos Add -O to print offsets; align columns properly.
 1.9 12-Apr-2009  lukem branches: 1.9.46;
Fix sign-compare issues.
 1.8 22-Jul-2008  christos branches: 1.8.6;
a better attempt on printing dtype_misc
 1.7 10-Feb-2006  christos branches: 1.7.22;
PR/32788: KAMADA Ken'ichi: add support for tmpfs
 1.6 17-Jul-2005  christos WARNS=3, knf, ansi prototypes
 1.5 12-Dec-2004  christos Add ptyfs.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.3 04-Feb-2000  jdolecek move the mapping of vnode type to file type to separate function getftype()
and use it where appropriate
 1.2 02-Aug-1999  jdolecek add support for ntfs
 1.1 18-Feb-1999  lukem as suggested by chuck cranor, pull in some openbsd mods:
* display ip address details of tcp/udp connections
* display isofs details
* use %p instead of %lx in error messages

other mods by me:
* don't put \n at the end of err()/warn() format
* man page cleanups (use .Dq and .Pq as appropriate)
 1.7.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.8.6.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.9.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.7 12-Apr-2009  lukem Fix sign-compare issues.
 1.6 11-May-2006  yamt branches: 1.6.30;
tweak for user.h cleanup.
while i'm here, remove unnecessary #include.
 1.5 17-Jul-2005  christos WARNS=3, knf, ansi prototypes
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.3 02-Feb-2003  christos undo mallocvar.h changes!
 1.2 01-Feb-2003  tron Include "sys/mallocvar.h" with "_KERNEL" defined in time to avoid
build failure because MALLOC_DECLARE() is not defined.
 1.1 18-Feb-1999  lukem as suggested by chuck cranor, pull in some openbsd mods:
* display ip address details of tcp/udp connections
* display isofs details
* use %p instead of %lx in error messages

other mods by me:
* don't put \n at the end of err()/warn() format
* man page cleanups (use .Dq and .Pq as appropriate)
 1.6.30.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.27 29-Jul-2023  riastradh sys: Rename sys/miscfd.h -> sys/memfd.h.

Let's not create new dumping grounds for miscellaneous stuff; one
header file for one purpose.
 1.26 10-Jul-2023  christos move the memfd struct to a separate file. Requested by riastradh@
 1.25 10-Jul-2023  christos Add memfd_create(2) from GSoC 2023 by Theodore Preduta
 1.24 13-Sep-2020  isaki Support audio descriptor for fstat(1).
sys/dev/audio/*.h: export only what we need for fstat.
 1.23 02-May-2020  christos nuke random stuff that does not exist anymore.
 1.22 06-Sep-2019  christos Add -O to print offsets; align columns properly.
 1.21 03-Feb-2019  thorpej Implement support for "pshared" POSIX semaphores.

Fixes lib/53273 (and Firefox's multi-process tab feature).
 1.20 26-Jun-2018  msaitoh branches: 1.20.2;
Print BPF direction correctly.
 1.19 26-Jun-2018  msaitoh Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.18 04-Jun-2018  nat Update fstat for audio(4) and pad(4) devices.

XXX - pullup 8.

Ok christos@.
 1.17 30-Dec-2016  christos branches: 1.17.6; 1.17.12;
Print the interface for bpf.
 1.16 23-Jan-2016  christos branches: 1.16.2;
put _KMEMUSER in the Makefile
 1.15 30-Dec-2015  christos Add rnd ops.
 1.14 10-Aug-2014  tls Merge tls-earlyentropy branch into HEAD.
 1.13 01-Jul-2013  riastradh branches: 1.13.4;
Fix races in /dev/u?random initialization and accounting.

- Push /dev/random `information-theoretic' accounting into cprng(9).
- Use percpu(9) for the per-CPU CPRNGs.
- Use atomics with correct memory barriers for lazy CPRNG creation.
- Remove /dev/random file kmem grovelling from fstat(1).
 1.12 23-Jun-2013  riastradh Rework rndsink(9) abstraction and adapt arc4random(9) and cprng(9).

rndsink(9):
- Simplify API.
- Simplify locking scheme.
- Add a man page.
- Avoid races in destruction.
- Avoid races in requesting entropy now and scheduling entropy later.

Periodic distribution of entropy to sinks reduces the need for the
last one, but this way we don't need to rely on periodic distribution
(e.g., in a future tickless NetBSD).

rndsinks_lock should probably eventually merge with the rndpool lock,
but we'll put that off for now.

cprng(9):
- Make struct cprng_strong opaque.
- Move rndpseudo.c parts that futz with cprng guts to subr_cprng.c.
- Fix kevent locking. (Is kevent locking documented anywhere?)
- Stub out rump cprng further until we can rumpify rndsink instead.
- Strip code to grovel through struct cprng_strong in fstat.
 1.11 25-Nov-2012  christos support printing rnd descriptor info
 1.10 25-Nov-2012  christos return stuff for ksem
 1.9 27-Oct-2012  alnsn Report jit'ed bpf fildes in fstat.
 1.8 10-Sep-2011  christos branches: 1.8.2; 1.8.8;
add all the possible fileops here, and if there is one we know about
print that instead of the passed name.
 1.7 13-Jul-2009  christos move _KMEMUSER higher!
 1.6 13-Jul-2009  christos need _KMEMUSER too.
 1.5 13-Jul-2009  christos sys/mqueue.h needs sys/types.h now
 1.4 12-Apr-2009  lukem Fix sign-compare issues.
 1.3 26-Feb-2009  christos only print warnings if vflg.
 1.2 23-Jul-2008  christos branches: 1.2.2; 1.2.6; 1.2.8;
handle more types.
 1.1 22-Jul-2008  christos a better attempt on printing dtype_misc
 1.2.8.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.2.6.1 30-Mar-2009  snj Pull up following revision(s) (requested by dholland in ticket #618):
usr.bin/fstat/misc.c: revision 1.3
only print warnings if vflg.
 1.2.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.2.1 23-Jul-2008  wrstuden file misc.c was added on branch wrstuden-revivesa on 2008-09-18 04:29:12 +0000
 1.8.8.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.8.2 25-Feb-2013  tls resync with head
 1.8.8.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.8.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.8.2.1 30-Oct-2012  yamt sync with head
 1.13.4.1 07-Apr-2014  tls Be a little more clear and consistent about harvesting entropy from devices:

1) deprecate RND_FLAG_NO_ESTIMATE

2) define RND_FLAG_COLLECT_TIME, RND_FLAG_COLLECT_VALUE

3) define RND_FLAG_ESTIMATE_TIME, RND_FLAG_ESTIMATE_VALUE

4) define RND_FLAG_DEFAULT: RND_FLAG_COLLECT_TIME|
RND_FLAG_COLLECT_VALUE|RND_FLAG_ESTIMATE_TIME

5) Make entropy harvesting from environmental sensors a little more generic
and remove it from individual sensor drivers.

6) Remove individual open-coded delta-estimators for values from a few
places in the tree (uvm, environmental drivers).

7) 0 -> RND_FLAG_DEFAULT, actually gather entropy from various drivers
that had stubbed out code, other minor cleanups.
 1.16.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.17.12.2 28-Jul-2018  pgoyette Sync with HEAD
 1.17.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.17.6.1 09-Jun-2018  martin Pull up following revision(s) (requested by nat in ticket #873):
usr.bin/fstat/misc.c: revision 1.18
Update fstat for audio(4) and pad(4) devices.
XXX - pullup 8.
Ok christos@.
 1.20.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.20.2.1 10-Jun-2019  christos Sync with HEAD
 1.13 18-Oct-2014  snj src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.12 12-Apr-2009  lukem Fix sign-compare issues.
 1.11 28-Apr-2008  martin branches: 1.11.8;
Remove clause 3 and 4 from TNF licenses
 1.10 11-May-2006  yamt branches: 1.10.20;
tweak for user.h cleanup.
while i'm here, remove unnecessary #include.
 1.9 17-Jul-2005  christos WARNS=3, knf, ansi prototypes
 1.8 02-Feb-2003  christos undo mallocvar.h changes!
 1.7 01-Feb-2003  tron Include "sys/mallocvar.h" with "_KERNEL" defined in time to avoid
build failure because MALLOC_DECLARE() is not defined.
 1.6 04-Feb-2000  jdolecek use dprintf() instead of printf(), as other filesystem modules do
 1.5 04-Feb-2000  jdolecek move the mapping of vnode type to file type to separate function getftype()
and use it where appropriate
 1.4 04-Feb-2000  jdolecek set mode accordingly to file type (similarily to what nfs_filestat() does)
file type is now viewed correctly for files on ntfs
 1.3 01-Nov-1999  jdolecek adapt to last ntfs changes - struct ntnode doesn't contain i_mode
anymore, get the mode from appropriate ntfsmount structure
 1.2 12-Sep-1999  jdolecek branches: 1.2.2;
pull in <sys/mount.h> (with _KERNEL) to get definition of struct netexport,
used in struct ntfsmount
 1.1 02-Aug-1999  jdolecek add support for ntfs
 1.2.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.20.1 18-May-2008  yamt sync with head.
 1.11.8.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.7 09-Jun-2017  chs rearrange sys/mount.h so that all of the kernel-only parts are together
and not exposed to userland, except do expose struct mount if __EXPOSE_MOUNT
is defined. define __EXPOSE_MOUNT in the kmem grovellers that want
the definition. needed for ZFS.
 1.6 12-Apr-2009  lukem Fix sign-compare issues.
 1.5 28-Apr-2008  martin branches: 1.5.8;
Remove clause 3 and 4 from TNF licenses
 1.4 24-Jan-2008  ad branches: 1.4.4;
specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

- Kill checkalias(). Allow multiple vnodes to reference a single device.

- Don't play dangerous tricks with block vnodes to ensure that only one
vnode can describe a block device. Instead, prohibit concurrent opens of
block devices. As a bonus remove the unreliable code that prevents
multiple file system mounts on the same device. It's no longer needed.

- Track opens by vnode and by device. Issue cdev_close() when the last open
goes away, instead of abusing vnode::v_usecount to tell if the device is
open.
 1.3 11-May-2006  yamt branches: 1.3.12;
tweak for user.h cleanup.
while i'm here, remove unnecessary #include.
 1.2 14-Dec-2004  atatat Slurp in the struct mount at vp->v_mount and the struct specinfo at
vp->v_specinfo to get the proper st_dev and st_rdev numbers. We're
already picking over the kernel, so let's do it right. That means
also asserting the file type for the /dev/pts directory (S_IFDIR) and
nodes therein (S_IFCHR).

Remove getptsmajor(), since we no longer need it. Besides, it was
being used wrongly.
 1.1 12-Dec-2004  christos Add ptyfs.
 1.3.12.1 23-Mar-2008  matt sync with HEAD
 1.4.4.1 18-May-2008  yamt sync with head.
 1.5.8.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.11 09-Jun-2017  chs rearrange sys/mount.h so that all of the kernel-only parts are together
and not exposed to userland, except do expose struct mount if __EXPOSE_MOUNT
is defined. define __EXPOSE_MOUNT in the kmem grovellers that want
the definition. needed for ZFS.
 1.10 23-Jan-2016  christos put _KMEMUSER in the Makefile
 1.9 29-May-2011  rmind - Prevent tmpfs.h from inclusion in userland.
- Clean up and KNF tmpfs.h a little bit.
 1.8 12-Apr-2009  lukem Fix sign-compare issues.
 1.7 29-Jul-2008  pooka branches: 1.7.6;
Solve the fstat-wants-to-look-at-kernel-data-structures in a nicer
way: don't export the fs internals to innocent userspace programs
which just want to mount the file system.
 1.6 28-Jul-2008  pooka include correct header
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 27-May-2006  yamt branches: 1.4.18;
remove __POOL_EXPOSE.
 1.3 11-May-2006  yamt branches: 1.3.2;
tweak for user.h cleanup.
while i'm here, remove unnecessary #include.
 1.2 16-Feb-2006  jmmv Adapt to some name changes in the tmpfs_node structure (to fix the build
under vax with gcc 2.95). Provided by he@.
 1.1 10-Feb-2006  christos PR/32788: KAMADA Ken'ichi: add support for tmpfs
 1.3.2.1 19-Jun-2006  chap Sync with head.
 1.4.18.1 18-May-2008  yamt sync with head.
 1.7.6.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1 19-Jun-2022  simonb Add basic ZFS support to fstat(1).
XXX: Use a local zfs_znode.h for a znode_t definition because the ZFS
kernel code makes it too hard to include headers from userland.
 1.1 19-Jun-2022  simonb Add basic ZFS support to fstat(1).
XXX: Use a local zfs_znode.h for a znode_t definition because the ZFS
kernel code makes it too hard to include headers from userland.

RSS XML Feed