From 6b8acd9e01d95e281add4249dd2e331de9417656 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 12 Oct 2025 18:12:43 +0100 Subject: [PATCH] Add sparse_output option and control flags, and an output_not_seekable transfer flag, to structures for "sparse output" mode in future (#45). --- src/include/options.h | 1 + src/include/pv-internal.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/include/options.h b/src/include/options.h index 94a30fa..fefdfcf 100644 --- a/src/include/options.h +++ b/src/include/options.h @@ -88,6 +88,7 @@ struct opts_s { bool no_splice; /* flag set if never to use splice */ bool stop_at_size; /* set if we stop at "size" bytes */ bool sync_after_write; /* set if we sync after every write */ + bool sparse_output; /* set if we leave holes in the output */ bool direct_io; /* set if O_DIRECT is to be used */ bool discard_input; /* set to write nothing to output */ bool show_stats; /* set to write statistics at the end */ diff --git a/src/include/pv-internal.h b/src/include/pv-internal.h index e835ba5..208e357 100644 --- a/src/include/pv-internal.h +++ b/src/include/pv-internal.h @@ -205,6 +205,7 @@ struct pvstate_s { bool no_display; /* do nothing other than pipe data */ bool stop_at_size; /* set if we stop at "size" bytes */ bool sync_after_write; /* set if we sync after every write */ + bool sparse_output; /* set if we leave holes in the output */ bool direct_io; /* set if O_DIRECT is to be used */ bool direct_io_changed; /* set when direct_io is changed */ bool no_splice; /* never use splice() */ @@ -437,6 +438,7 @@ struct pvstate_s { bool splice_used; #endif bool read_error_warning_shown; + bool output_not_seekable; /* set if lseek() fails on output */ } transfer; };