freebsd-src/bin/df
Ankush Mondal 5395471516 df: Fix -k flag consistency with other BLOCKSIZE flags
This patch resolves inconsistent behavior between the -k option and
other related flags, including -P. Previously, using -k resulted in
output displayed in 1024-byte blocks, which did not align with the
behavior of similar options such as -m and -g, where output is shown in
1M-blocks and 1G-blocks respectively.

The updated implementation ensures that -k now correctly displays sizes
in 1K-blocks. In addition, the patch incorporates the POSIX requirement
that when both -k -P are specified, the block size must be explicitly
forced to 1024-blocks.

Together, these changes make the behavior of -k consistent, predictable,
and compliant with the standard.

Signed-off-by: Ankush Mondal <mondalankush9851@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1906
2026-01-09 13:17:12 -07:00
..
df.1 manpages: prefer linking to xo_options.7 over xo_parse_args.3 2025-07-16 12:02:24 -06:00
df.c df: Fix -k flag consistency with other BLOCKSIZE flags 2026-01-09 13:17:12 -07:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00