]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
fseek.3: mention seek-past-the-end semantics, defer to lseek(2)
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Mon, 16 May 2022 19:51:43 +0000 (21:51 +0200)
committerAlejandro Colomar <alx.manpages@gmail.com>
Mon, 16 May 2022 22:02:54 +0000 (00:02 +0200)
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@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
man3/fseek.3

index a98ed17d42d14bd7c5794345281e725c13f7e795..6942808c447ced64ffd31e058f32caa9392e888c 100644 (file)
@@ -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 ()