Skip to content

Commit 8128760

Browse files
committed
regen
1 parent f36d04f commit 8128760

File tree

4 files changed

+57
-14
lines changed

4 files changed

+57
-14
lines changed

man/libzip.html

Lines changed: 12 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/libzip.man

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
3131
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3232
.\"
33-
.TH "LIBZIP" "3" "May 5, 2025" "NiH" "Library Functions Manual"
33+
.TH "LIBZIP" "3" "September 16, 2025" "NiH" "Library Functions Manual"
3434
.nh
3535
.if n .ad l
3636
.SH "NAME"
@@ -128,12 +128,22 @@ It is the responsibility of the programmer to ensure that all
128128
directory separators are passed as forward slashes to
129129
\fBlibzip\fR.
130130
.SH "THREAD SAFETY"
131-
In general, different zip archives opened by
132-
\fBlibzip\fR
133-
are independent of each other and can be used by parallel-running
131+
In general, different
132+
\fIzip_t\fR
133+
objects are independent of each other and can be used by parallel-running
134134
threads without locking.
135-
If you want to use an archive from multiple threads, you have to
136-
synchronize access to it yourself.
135+
.PP
136+
If you want to use one
137+
\fIzip_t\fR
138+
object from multiple threads, you have to synchronize access to it yourself.
139+
.PP
140+
Alternatively, if you only want to read from an archive, you can open the
141+
archive multiple times to create a separate
142+
\fIzip_t\fR
143+
object for each thread; to avoid making changes by mistake, use the flag
144+
\fRZIP_RDONLY\fR
145+
when opening the archive.
146+
.PP
137147
If you use an archive as a source for
138148
zip_file_add(3)
139149
or

man/zip_open.html

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/zip_open.man

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
3131
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3232
.\"
33-
.TH "ZIP_OPEN" "3" "May 5, 2025" "NiH" "Library Functions Manual"
33+
.TH "ZIP_OPEN" "3" "September 16, 2025" "NiH" "Library Functions Manual"
3434
.nh
3535
.if n .ad l
3636
.SH "NAME"
@@ -122,6 +122,20 @@ to indicate the error, while
122122
sets
123123
\fIze\fR
124124
to indicate the error.
125+
.SH "CAVEATS"
126+
Opening the same archive multiple times can lead to problems: When a modified archive is closed, the underlying file is rewritten and thus invalidates all other
127+
\fIzip_t\fR
128+
objects for that archive, which will fail in unpredictable ways.
129+
Also, writing may fail on some platforms if the file is in use by another
130+
\fIzip_t\fR
131+
object.
132+
.PP
133+
Thus, it is only valid to open the same archive multiple times as long as you make changes to at most one
134+
\fIzip_t\fR
135+
object and close that last.
136+
Using the flag
137+
\fRZIP_RDONLY\fR
138+
helps enforce that.
125139
.SH "EXAMPLES"
126140
Here's an example of how you could report errors during
127141
\fBzip_open\fR:

0 commit comments

Comments
 (0)