HomeFreeBSD

hexdump(1): Speed up -s flag on devices

Description

hexdump(1): Speed up -s flag on devices

Using the -s flag on devices is extraordinarily slow due to using fseek(3) a
little too conservatively. Address this by using fseek on character/block
devices as well, falling back to getchar(3) only if we fail to seek or we're
operating on tape drives, where fseek may succeed while not actually being
supported.

PR: 86485
Submitted by: arundel (originally; modified since then)
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D10939

Details

Provenance
kevansAuthored on
Reviewer
cem
Differential Revision
D10939: hexdump(1): Speed up -s flag on devices
Parents
rS327566: Revert r327360, which can cause boot problems on high-CPU-count (>60)
Branches
Unknown
Tags
Unknown