Bug 122043

Summary: [patch] du(1) does not support byte-count-based reporting (-b argument)
Product: Base System Reporter: Drkshadow <freebsd-bugs.20.drkshadow>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me Keywords: patch
Priority: Normal    
Version: 6.2-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.txt none

Description Drkshadow 2008-03-24 09:10:02 UTC
du(1) that comes with FreeBSD does not understand the -b argument, and these is no way to achieve such functionality using the BLOCKSIZE environment variable. As far as I know, this option is not required by POSIX, but it's trivially implemented using a different member of the stat(2) structure and an if to separate block counts from byte counts.

The only issue that I can see is for filesystems containing files that sum up to more than 8 exabytes in size -- in this case, the 64-bit integer used to store the byte count will overflow. Multiply this by 512 for the maximum size for block-based counting. If it becomes an issue, a check can be put in to compare the addition and, if the result is less than the additive value, throw an error.

Fix: Patch attached with submission follows:
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:18 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:36:43 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>