HardenedBSD/usr.bin/hexdump
Ricardo Branco e23954bd42 hexdump: Do not trust st_size if it equals zero.
Fix for hexdump -s not being able to skip files residing in
pseudo-filesystems that advertise a zero size value.

Historically, many pseudofs-based filesystems (e.g., procfs) report
a va_size of 0 for numerous files classified as regular files.
Typically, the contents of these files are generated on demand
from kernel data as sbuf(9) strings at the time they are read.
Accurately reporting the size of these files is challenging, as it
often involves generating their contents. These pseudofs implementations
frequently report the size as 0. This is a historical behavior and also
aligns with Linux behavior. To maintain compatibility, we have chosen
to preserve the existing behavior and address it in the userland
application, rather than modifying it in the kernel (by updating the
correct value for va_size).

PR:		bin/276106
MFC after:	1 week
2024-01-04 00:16:50 -08:00
..
tests
conv.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
display.c hexdump: Do not trust st_size if it equals zero. 2024-01-04 00:16:50 -08:00
hexdump.1
hexdump.c
hexdump.h
hexsyntax.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
Makefile
Makefile.depend
od.1
odsyntax.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
parse.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00