On 5/16/22 21:51, наб wrote:
If the user is unfamiliar with seeking semantics, they may sensibly assume that seeking past the end is invalid Reported-in: https://twitter.com/eatijr/status/1526264195808911361 Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@xxxxxxxxxxxxxxxxxx>
Patch applied, наб. Thanks, Alex
--- man3/fseek.3 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/man3/fseek.3 b/man3/fseek.3 index 01bd34c5b..c19303421 100644 --- a/man3/fseek.3 +++ b/man3/fseek.3 @@ -118,6 +118,14 @@ On some non-UNIX systems, an .I fpos_t object may be a complex object and these routines may be the only way to portably reposition a text stream. +.PP +If the stream refers to a regular file +and the resulting stream offset is beyond the size of the file, +subsequent writes will extend the file with a hole, up to the offset, +before committing any data. +See +.BR lseek (2) +for details on file seeking semantics. .SH RETURN VALUE The .BR rewind ()
-- Alejandro Colomar Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es/