HomeFreeBSD

zpool: flush output before sleeping

Description

zpool: flush output before sleeping

Several zpool commands (status, list, iostat) have modes that present
some information, sleep a while, present the current state, sleep, etc.
Some of those had ways to invoke them that when piped would appear to do
nothing for a while, because non-terminals are block-buffered, not
line-buffered, by default. Fix this by forcing a flush before sleeping.

In particular, all of these buffered:

  • zpool status <pool> <interval>
  • zpool iostat -y<m> <pool> <interval>
  • zpool list <pool> <interval>

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #15593

Details

Provenance
rob.norris_klarasystems.comAuthored on Dec 5 2023, 7:53 PM
GitHub <noreply@github.com>Committed on Dec 5 2023, 7:53 PM
Parents
rGc7b6119268b8: Allow block cloning across encrypted datasets
Branches
Unknown
Tags
Unknown