From: наб Date: Mon, 16 May 2022 19:51:43 +0000 (+0200) Subject: fseek.3: mention seek-past-the-end semantics, defer to lseek(2) X-Git-Tag: man-pages-5.19-rc1~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d8ce99e36a07a2faae43b791deecca601b748bfc;p=thirdparty%2Fman-pages.git fseek.3: mention seek-past-the-end semantics, defer to lseek(2) 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 Signed-off-by: Alejandro Colomar --- diff --git a/man3/fseek.3 b/man3/fseek.3 index a98ed17d42..6942808c44 100644 --- a/man3/fseek.3 +++ b/man3/fseek.3 @@ -93,6 +93,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 ()