about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile1
-rw-r--r--gzseek.325
2 files changed, 25 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 45081d8..ffac1f1 100644
--- a/Makefile
+++ b/Makefile
@@ -57,6 +57,7 @@ MLINKS += compress.3 compress2.3
 MLINKS += crc32.3 crc32_z.3
 MLINKS += gzopen.3 gzdopen.3
 MLINKS += gzseek.3 gzrewind.3
+MLINKS += gzseek.3 gztell.3
 MLINKS += inflateReset.3 inflateReset2.3
 MLINKS += uncompress.3 uncompress2.3
 
diff --git a/gzseek.3 b/gzseek.3
index cf1bc71..dd69a5c 100644
--- a/gzseek.3
+++ b/gzseek.3
@@ -4,7 +4,8 @@
 .
 .Sh NAME
 .Nm gzseek ,
-.Nm gzrewind
+.Nm gzrewind ,
+.Nm gztell
 .Nd seek compressed file
 .
 .Sh LIBRARY
@@ -16,6 +17,8 @@
 .Fn gzseek "gzFile file" "z_off_t offset" "int whence"
 .Ft int
 .Fn gzrewind "gzFile file"
+.Ft z_off_t
+.Fn gztell "gzFile file"
 .
 .Sh DESCRIPTION
 Sets the starting position
@@ -58,6 +61,26 @@ only for reading.
 is equivalent to
 .Li (int) Ns Fn gzseek file 0L SEEK_SET .
 .
+.Pp
+.Fn gztell
+returns the starting position
+for the next
+.Xr gzread 3
+or
+.Xr gzwrite 3
+on the given compressed file.
+This position represents a number of bytes
+in the uncompressed data stream,
+and is zero when starting,
+even if appending or reading
+a gzip stream from the middle of a file using
+.Xr gzdopen 3 .
+.
+.Pp
+.Fn gztell file
+is equivalent to
+.Fn gzseek file 0L SEEK_CUR .
+.
 .Sh RETURN VALUES
 .Fn gzseek
 returns the resulting offset location