Hi!
Given that you can't process that file as anything other than
regular-file-optimised wc -c, and it's a really pathological input,
I'd say just doing a saturating addition for the total is fine.
Funnily enough, I did torture-test df this morning, and the same happens
there. Admittedly, I'd say that's really not an issue, since you'd need
to actually have an absurd amount of filesystems, with a nominal total
of over 16E.
The only realistic scenario I can imagine here is, like, a 2P ZFS pool
with >8096 descendant filesystems; it sounds pathological, and it kind of
is, but I did get there, and if you go to a slightly larger pool you get
vaguely within the order of magnitude of the realm of what some workloads
are seeing, if you have ZFS configured as a docker backend, for example;
but then --total is also completely meaningless in that case; I'd classify
this as a purely theoretical scenario not worth more code than maybe
just saturating the addition if you have an easy-to-use primitive.
Best,
наб