freebsd-src/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 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
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 usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
hexdump.c Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
hexdump.h usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
hexsyntax.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
Makefile usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
od.1 usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
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